Skip to main content
POST
/
community
/
{id}
/
badge
/
{badgeId}
/
attribution
Create badge attribution
curl --request POST \
  --url https://api.op.xyz/v1/community/{id}/badge/{badgeId}/attribution \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "wallet": "<string>",
  "code": "<string>",
  "autoClaim": true,
  "metadata": {}
}
'
{
  "id": "<string>",
  "earnedAt": "2023-11-07T05:31:56Z",
  "claimedAt": "2023-11-07T05:31:56Z",
  "transactionHash": "<string>",
  "tokenId": "<string>",
  "badge": {
    "id": "<string>",
    "key": "<string>",
    "title": "<string>",
    "type": "achievement",
    "description": "<string>",
    "badge": "<string>",
    "requirements": {
      "title": "<string>",
      "description": "<string>"
    },
    "rewards": [
      {
        "id": "<string>",
        "image": "<string>",
        "provider": "Vault",
        "providerImage": "<string>",
        "name": "<string>",
        "type": "native",
        "status": "open",
        "amount": [
          123
        ],
        "description": "<string>",
        "endDate": "2023-11-07T05:31:56Z",
        "maxSpend": 123,
        "vaultId": "<string>",
        "contract": "<string>",
        "chainId": "<string>",
        "transactionHash": "<string>",
        "deletedAt": "2023-11-07T05:31:56Z",
        "sentAt": "2023-11-07T05:31:56Z"
      }
    ],
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "author": {},
    "community": {}
  },
  "account": {},
  "membership": {
    "id": "<string>",
    "role": "<string>",
    "wallet": "<string>",
    "addMethod": "<string>",
    "confirmedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

id
string
required

Community ID

badgeId
string
required

Body

application/json
wallet
string
required

Wallet address (if not using a claim code)

code
string
required

Claim code (if not using a wallet address)

autoClaim
boolean

Automatically claim the badge for the member. On-chain badges will be airdropped to the wallet immediately.

metadata
object

Additional metadata to be included in the badge attribution

Response

200 - application/json
id
string
required
earnedAt
string<date-time>
required
claimedAt
string<date-time>
required
transactionHash
string
required
tokenId
string
required
badge
object
required
account
object
required
membership
object
required