PromptsCreate Tag

Create Tag

Create a tag in a domain, with an optional color. Requires the admin, co-admin or editor role.

curl --request POST \
  --url https://api.aiclicks.io/api/v1/tags \
  --header 'Authorization: Bearer ak_live_xxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
    "name": "Pricing",
    "color_id": "green"
  }'
{
  "data": {
    "id": "d4e5f6a7-8b9c-4d0e-a1f2-b3c4d5e6f7a8",
    "name": "Pricing",
    "color_id": "green",
    "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3"
  },
  "generated_at": "2026-11-09T10:00:11.218000+00:00"
}

Creates one tag in a domain. After you create the tag, you can attach it to prompts with POST /api/v1/prompts/tags, POST /api/v1/prompts or POST /api/v1/prompts/update.

Tag names are unique in a domain. The check ignores letter case. If a tag with the same name exists, the call returns 409.

The caller must have the admin, co-admin or editor role on the team. The team manager can always create tags. A viewer gets 403.

Authorizations

header
Authorizationstring
Required

Your API key in the format Bearer ak_live_<your-key>. Create a key in the dashboard under Settings → Developers. The key must have access to the team that owns domain_id.

header
Content-Typestring
Required

Must be application/json.

Body parameters

body
domain_idstring
Required

UUID of the domain for the new tag.

body
namestring
Required

The tag name. The API removes spaces at the start and end. The name must not be empty. The maximum is 60 characters. The name must not contain < or >.

body
color_idstring

The color of the tag. Default slate. Use one of these values: slate, gray, blue, amber, red, orange, green, teal, indigo, purple, pink. Other values return 422.

Response

data.idstring
Required

UUID of the new tag. Use this value in tag_ids, add_tag_ids or remove_tag_ids.

data.namestring
Required

The tag name as stored.

data.color_idstring
Required

The color key of the tag. GET /api/v1/tags gives the full color object with hex values.

data.domain_idstring
Required

UUID of the domain of the tag.

generated_atstring
Required

ISO-8601 time when the server made this response.

Side effects

Errors

401 Unauthorizederror

The API key is missing, malformed or revoked.

403 Forbiddenerror

The caller does not have the admin, co-admin or editor role. Or the caller is not a member of the team, or the API key has no access to this domain. The plan of the team can also not include API access.

404 Not Founderror

The domain or its team does not exist.

409 Conflicterror

A tag with the same name exists in the domain. The check ignores letter case.

422 Unprocessable Entityerror

The body is not valid. For example, name is empty, has more than 60 characters or contains < or >. Or color_id is not a known color.

429 Too Many Requestserror

You sent too many requests. Read the Retry-After header to know how long to wait.