Set prompt tags
Replaces a prompt’s tags with exactly the ids you send. Tags not in the list are removed; an empty array clears them all.
Set-exact rather than add-and-remove, because that is what a sync integration needs: one call
expresses “these and only these”, and repeating it is harmless. Reading the current set first is
not required, but List prompts returns each prompt’s tags.
Requires the write:tags scope, and the workspace must be enabled for API writes.
PATCH /v1/brands/{brand_id}/prompts/{prompt_id}/tagsAuthorization
| 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 |
prompt_id | uuid | required | From List prompts |
Query parameters
None.
Body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
tag_ids | uuid[], max 50 | required | The complete set. [] removes every tag. Duplicates are collapsed |
Every id must name a tag on this brand. If any does not, the whole call is refused and nothing changes — the message names the offending ids.
Request
cURL
curl --request PATCH \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/prompts/9f2c1d84-6b31-4a2e-9c77-1e5b0a3f8d42/tags' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: <unique-per-attempt>' \
--header 'Content-Type: application/json' \
--data '{"tag_ids":["5524d66a-df1e-47e4-9dbc-802af39235ad"]}'Response
200
{
"data": {
"prompt_id": "9f2c1d84-6b31-4a2e-9c77-1e5b0a3f8d42",
"tags": [
{
"id": "5524d66a-df1e-47e4-9dbc-802af39235ad",
"name": "Bottom funnel",
"slug": "bottom-funnel",
"color": "#4F46E5",
"description": null
}
]
},
"request_id": "req_7d21b0af59c34e18b6ac"
}Response fields
The resulting set, so you can confirm the outcome without a follow-up read.
| Field | Type | Description |
|---|---|---|
data.prompt_id | uuid | required |
data.tags[].id | uuid | required |
data.tags[].name | string | required |
data.tags[].slug | string | required |
data.tags[].color | string | null | required |
data.tags[].description | string | null | required |
request_id | string | required |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | tag_ids missing, not an array of uuids, or over 50 entries |
| 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 prompt or one of the tags does not exist, or belongs to another brand |
| 429 | rate_limited | Over 60 requests per minute |
Notes
Applying one tag to many at once? Use Bulk add tag to prompts — it adds without replacing the rest.
Tags are shared. The pool is brand-level: the same tag can label prompts and competitors. See Create tag.
The call is idempotent by construction. Sending the same set twice leaves the same result, so a
retry after a lost response is safe even without the Idempotency-Key replay.
All-or-nothing on unknown ids. One bad id refuses the whole call rather than applying the others, so a partially-synced state is never reachable.