Create a tag

Creates a new tag in your account.

The name must be one you don't already use — names are compared case-insensitively, so Trade and trade count as the same and the second request returns CONFLICT.

Send "upsert": true to make the call safe to repeat: when the tag already exists it is returned — updated with any color or icon you sent — instead of failing with CONFLICT. One call then guarantees the tag exists before you reference it on inventory lines.

Requires the inventory:write scope.

Body
required
application/json
  • name
    Type: string
    min length:  
    1
    max length:  
    100
    required

    The tag's name, unique within your account.

  • color
    Type: string
    min length:  
    1
    max length:  
    50

    An optional display colour, free-form text.

  • icon
    Type: string
    min length:  
    1
    max length:  
    50

    An optional display icon, free-form text.

  • upsert
    Type: boolean

    When true and you already have a tag with this name, the request returns that tag — updated with any color or icon you sent — instead of failing with CONFLICT. The existing tag keeps its stored name spelling.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/inventory/tags
curl https://public-api.cardnexus.com/v1/inventory/tags \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "Trade binder",
  "color": "",
  "icon": "",
  "upsert": true
}'
{
  "name": "Trade binder",
  "color": "#22c55e",
  "icon": "star"
}