Skip to Content
APIEndpointsUpdate tag

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

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
tag_iduuidrequiredFrom List tags

Query parameters

None.

Body

application/json. At least one field is required.

FieldTypeRequiredDescription
namestring, 1–64 charsoptionalRe-derives the slug
colorstring | nulloptionalHex value like #4F46E5. null clears it
descriptionstring | null, up to 200 charsoptionalnull clears it

Request

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

{ "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.

FieldTypeDescription
data.tag.iduuidrequired
data.tag.namestringrequired
data.tag.slugstringrequired. Re-derived when the name changes
data.tag.colorstring | nullrequired
data.tag.descriptionstring | nullrequired
request_idstringrequired

Errors

StatusCodeWhen
400invalid_requestUnknown field, a body with none of the three fields, or a colour that is not hex
401invalid_tokenThe key is missing, malformed, or does not exist
403insufficient_scopeThe key does not carry write:tags
404not_foundThe tag does not exist or belongs to another brand
409conflictThe new name derives a slug another tag already uses
429rate_limitedOver 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