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.
- Type: stringmin length:1max length:100required
The tag's name, unique within your account.
- Type: stringmin length:1max length:50
An optional display colour, free-form text.
- Type: stringmin length:1max length:50
An optional display icon, free-form text.
- Type: boolean
When
trueand you already have a tag with this name, the request returns that tag — updated with anycolororiconyou sent — instead of failing withCONFLICT. The existing tag keeps its stored name spelling.
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
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"
}