POST
/
components
/
v1
/
badge
cURL
curl --request POST \
  --url https://api-sandbox.appcharge.com/components/v1/badge \
  --header 'Content-Type: application/json' \
  --header 'x-publisher-token: <api-key>' \
  --data '{
  "name": "New Year Celebration",
  "publisherBadgeId": "new_year_celebration",
  "type": "emblem",
  "badgeImageUrl": "https://example.com/images/new-year-ribbon.png"
}'
{
  "id": "507f1f77bcf86cd799439011",
  "name": "New Year Celebration",
  "publisherBadgeId": "new_year_celebration",
  "type": "emblem",
  "badgeImageUrl": "https://cdn.appcharge.com/507f1f77bcf86cd799439011_emblem.png",
  "badgeExternalImageUrl": "https://example.com/images/new-year-emblem.png"
}

Authorizations

x-publisher-token
string
header
required

Publisher token, as displayed in the Publisher Dashboard.

Body

application/json

Create an emblem badge.

name
string
required

Badge name.

Example:

"New Year Celebration"

publisherBadgeId
string
required

Badge ID that you define.

Example:

"new_year_celebration"

type
enum<string>
required

Badge type.

Available options:
emblem
Example:

"emblem"

badgeImageUrl
string<url>
required

URL to a valid, publicly accessible badge image. Must be in PNG or JPEG format.

Example:

"https://example.com/images/new-year-ribbon.png"

Response

Badge created successfully.

Response schema for an emblem badge.

id
string
required

Badge ID.

Example:

"507f1f77bcf86cd799439011"

name
string
required

Badge name.

Example:

"New Year Celebration"

publisherBadgeId
string
required

Badge ID that you defined.

Example:

"new_year_celebration"

type
enum<string>
required

Badge type.

Available options:
emblem
Example:

"emblem"

badgeImageUrl
string<url>
required

URL of badge image stored on Appcharge CDN.

Example:

"https://cdn.appcharge.com/507f1f77bcf86cd799439011_emblem.png"

badgeExternalImageUrl
string<url>

Original URL of the badge image if uploaded via external link.

Example:

"https://example.com/images/new-year-emblem.png"