Returning.AIDevelopers
v1

API reference / Legacy / Badges

.md

Create badge

Create badge

Last updated 26 Sep 2026API v1

Method
POST
Path
https://api.returning.ai/badges

Authentication#

Header
Authorization: Bearer <API_KEY>

Behaviour#

Legacy category

This endpoint is retained for compatibility, historical admin tooling, or test workflows. Do not use it as the default choice for new integrations unless the backend team confirms this exact route is still supported for your community.

What it is for

Create badge.

How to use it

Send a POST request to /badges with the documented body, query parameters, headers, or multipart fields. Prefer the newer authenticated /v1/... integration API where available.

Successful response

HTTP 2xx. Older endpoints may return a legacy response envelope or a resource-specific payload rather than the newer { status, message, data } wrapper.

Common error states
  • 400 invalid request body, query, ObjectId, pagination, file format, or missing required field.
  • 401 missing, invalid, expired, or insufficient API key/token.
  • 403 key is valid but cannot access this community/channel/user/resource, where supported by the service.
  • 404 route or target resource was not found. Several legacy root routes return 404 on https://api.returning.ai; confirm with Returning.AI before using them.
  • 409 duplicate or conflicting state for create/update operations, where applicable.
  • 500 unexpected Returning.AI service error.
Legacy status

Compatibility endpoint retained for older integrations. Do not use this endpoint for new integrations unless Returning.AI specifically tells you to maintain a legacy flow. Prefer the current /v1/... endpoint in the matching non-Legacy category when one exists.

Request#

Headers#

Authorization#stringREQUIRED
API key.

RuleBearer <API_KEY>

x-api-key#stringREQUIRED
Legacy server API key header. Prefer Authorization: Bearer <API_KEY> for /v1/... integration APIs.
Content-Type#stringREQUIRED
Request body format.

Ruleapplication/json

Body#

title#stringREQUIRED

Eg"It's title"

action#stringREQUIRED

Eg"custom"

quantity#integerOPTIONAL

Eg100

image#stringOPTIONAL
description#stringOPTIONAL

Eg"This is description"

darkImage#stringOPTIONAL
lightImage#stringOPTIONAL
awarded#booleanOPTIONAL

Egfalse

applied#booleanOPTIONAL

Egfalse

enabledDarkAndLight#booleanOPTIONAL

Egfalse

award#booleanOPTIONAL

Egtrue

awardCurrency#booleanOPTIONAL

Egtrue

awardXpQuantity#integerOPTIONAL

Eg100

awardCurrencyQuantity#integerOPTIONAL

Eg100

attachRequired#booleanOPTIONAL

Egtrue

curl --request POST \
  --url https://api.returning.ai/badges \
  --header 'Authorization: Bearer <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "It's title",
    "action": "custom",
    "quantity": 100,
    "image": "",
    "description": "This is description",
    "darkImage": "",
    "lightImage": "",
    "awarded": false,
    "applied": false,
    "enabledDarkAndLight": false,
    "award": true,
    "awardCurrency": true,
    "awardXpQuantity": 100,
    "awardCurrencyQuantity": 100,
    "attachRequired": true
  }'

Response#

meta#objectALWAYS

Eg{ ... }

success#booleanALWAYS

Egtrue

message#stringALWAYS

Eg"Badge has been created successfully"

devMessage#stringALWAYS

Eg"Badge has been created successfully"

body#objectALWAYS

Eg{ ... }

title#stringALWAYS

Eg"General"

action#stringALWAYS

Eg"custom"

quantity#stringALWAYS

Eg"3"

description#stringALWAYS

Eg"One trade on a live account that makes 30%. Send account statement to #Tickmill-badge channel"

attachRequired#stringALWAYS

Eg"true"

awarded#stringALWAYS

Eg"true"

id#stringALWAYS

Eg"{_id}"

image#stringALWAYS

Eg"https://chartsnapshot.s3.us-east-2.amazonaws.com/apireturningai/tester/1721927206522-d763c952a89131696dd3bdf79fa0108.png"

{
  "meta": {
    "success": true,
    "message": "Badge has been created successfully",
    "devMessage": "Badge has been created successfully"
  },
  "body": {
    "title": "General",
    "action": "custom",
    "quantity": "3",
    "description": "One trade on a live account that makes 30%. Send account statement to #Tickmill-badge channel",
    "attachRequired": "true",
    "awarded": "true",
    "id": "{_id}",
    "image": "https://chartsnapshot.s3.us-east-2.amazonaws.com/apireturningai/tester/1721927206522-d763c952a89131696dd3bdf79fa0108.png"
  }
}

Errors#

Fix the request03

400Fix the request
Invalid request. Check required parameters, body fields, file format, pagination values, and ObjectId values.
401Fix the request
Missing, invalid, expired, or insufficient API key/token. Older permission middleware may also return 401 for missing permissions.
403Fix the request
The API key is valid but is not allowed to access this community, channel, user, or resource.

Fix the data01

409Fix the data
The request conflicts with an existing resource or immutable state, such as a duplicate slug/key/name or an already-processed record.

Retry with backoff01

500Retry with backoff
Unexpected Returning.AI service error.
{
  "status": "fail",
  "message": "Invalid request. Check required parameters, body fields, file format, pagination values, and ObjectId values."
}

Next step#

Update badgePUT/badges/{id}