Update tag
Renames a tag or changes its colour or description. Send only what you want to change.
Renaming re-derives the slug, so the new name must not collide with another tag in the brand. Assignments are unaffected: every prompt and competitor carrying the tag keeps it.
Requires the write:tags scope, and the workspace must be enabled for API writes.
PATCH /v1/brands/{brand_id}/tags/{tag_id}Authorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Idempotency-Key | string | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
tag_id | uuid | required | From List tags |
Query parameters
None.
Body
application/json. At least one field is required.
| Field | Type | Required | Description |
|---|---|---|---|
name | string, 1–64 chars | optional | Re-derives the slug |
color | string | null | optional | Hex value like #4F46E5. null clears it |
description | string | null, up to 200 chars | optional | null clears it |
Request
cURL
curl --request PATCH \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/tags/9f2c1d84-6b31-4a2e-9c77-1e5b0a3f8d42' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: <unique-per-attempt>' \
--header 'Content-Type: application/json' \
--data '{"color":"#DC2626"}'Response
200
{
"data": {
"tag": {
"id": "9f2c1d84-6b31-4a2e-9c77-1e5b0a3f8d42",
"name": "Bottom funnel",
"slug": "bottom-funnel",
"color": "#DC2626",
"description": null
}
},
"request_id": "req_7d21b0af59c34e18b6ac"
}Response fields
The complete tag after the change. Same shape as List tags.
| Field | Type | Description |
|---|---|---|
data.tag.id | uuid | required |
data.tag.name | string | required |
data.tag.slug | string | required. Re-derived when the name changes |
data.tag.color | string | null | required |
data.tag.description | string | null | required |
request_id | string | required |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Unknown field, a body with none of the three fields, or a colour that is not hex |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 403 | insufficient_scope | The key does not carry write:tags |
| 404 | not_found | The tag does not exist or belongs to another brand |
| 409 | conflict | The new name derives a slug another tag already uses |
| 429 | rate_limited | Over 60 requests per minute |
Notes
A tag from another brand returns 404, the same as one that does not exist — the two are
deliberately indistinguishable.
null clears, omission preserves. {"color": null} removes the colour; leaving color out
keeps it.
Last updated on