POST
/
community
/
{id}
/
badge
Create badge
curl --request POST \
  --url https://api.op.xyz/v1/community/{id}/badge \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "status": "live",
  "title": "<string>",
  "image": "<string>",
  "type": "achievement",
  "description": "<string>",
  "chainId": "11155111",
  "contract": "<string>",
  "claimEndDate": "2023-11-07T05:31:56Z",
  "maxClaims": 123,
  "tags": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "author": {
    "name": "<string>",
    "uri": "<string>"
  }
}'
When creating badges you can make use of Community Files to upload images and and use the OpenPage image cdn as the source URL. For IPFS images an easy and cost effective solution is to use a service like Pinata to upload and pin the IPFS image.
New Badges created via the API are marked as approved by default. To begin creating badge attributions you will need to update the status to live using the Update Badge endpoint. Once Badges are set to live they will be visible publicly on OpenPage and across the OpenPage ecosystem.
Approved badges can be previewed at: https://op.xyz/badges/{badgeId}

Authorizations

X-Api-Key
string
header
required

Path Parameters

id
string
required

Community ID

Body

application/json
title
string
required
image
string
required

The image URL of the badge. Can be an IPFS url or OpenPage File.

type
enum<string>
required
Available options:
achievement,
attendance
description
string
required
claimEndDate
string<date-time>
required
maxClaims
number
required
tags
object[]
required

Array of tags. Members with matching tags are eligible to claim the badge.

author
object
required
status
enum<string>
Available options:
draft,
under_review,
approved,
rejected,
live
Example:

"live"

chainId
string

The chain ID of the badge.

Example:

"11155111"

contract
string