Skip to Content
APIEndpointsDelete tag

Delete tag

Deletes a tag and removes it from every prompt and competitor carrying it. The prompts and competitors themselves are untouched — only the label goes.

That reach is invisible from the request, so the response reports it, and dry_run lets you see it first. A tag on 400 prompts and a tag on none look identical until you ask.

Requires the write:tags scope, and the workspace must be enabled for API writes.

DELETE /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

ParameterTypeRequiredDescription
dry_runbooleanoptionalReport what would be unassigned and delete nothing

Unlike Delete topic there is no outcome parameter: a tag owns nothing, so there is no second decision to make.

Request

# preview first curl --request DELETE \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/tags/9f2c1d84-6b31-4a2e-9c77-1e5b0a3f8d42?dry_run=true' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: <unique-per-attempt>'

Response

{ "data": { "deleted_tag_id": "9f2c1d84-6b31-4a2e-9c77-1e5b0a3f8d42", "name": "Bottom funnel", "prompts_untagged": 42, "competitors_untagged": 3, "dry_run": false }, "request_id": "req_7d21b0af59c34e18b6ac" }

Response fields

FieldTypeDescription
data.deleted_tag_iduuidrequired. The tag that was removed, or would be
data.namestringrequired. Its name, so a log line reads without a second lookup
data.prompts_untaggedintegerrequired. Prompts that lost the label
data.competitors_untaggedintegerrequired. Competitors that lost the label
data.dry_runbooleanrequired. true means nothing was changed
request_idstringrequired

Errors

StatusCodeWhen
400invalid_requestdry_run is not true or false
401invalid_tokenThe key is missing, malformed, or does not exist
403insufficient_scopeThe key does not carry write:tags
404not_foundThe tag does not exist, was already deleted, or belongs to another brand
429rate_limitedOver 60 requests per minute

Notes

Deleting twice returns 404, not a second success.

The counts are the same in both modes. A dry run reports exactly what the real call will do, and the real call reports what it did.

Nothing is soft-deleted. Removing a tag from prompts and competitors is not recoverable through the API — recreate the tag and reapply it with Set prompt tags.

Last updated on