Skip to main content
DELETE
Delete lead tag
Remove one tag from the workspace. Required scope: lead_tags:manage — the scope is spelled with an underscore even though the path is spelled with a hyphen. Deleting a tag takes it off every lead that carries it. Those leads are not otherwise touched, but they stop matching GET /leads?tag=… and stop being enrolled by any campaign built on that segment. There is no undo and no soft delete: create the tag again and you get a new id, with no lead attached to it. So a tag that leads still carry is refused, and the refusal says how many.

Refused while leads carry it

leads_tagged is the count right now, so it is also the answer to “how much would this break” — read it, then either retag those leads with Update lead or say you meant it.

Deleting it anyway

The count is taken before anything is deleted, and it has to succeed: if it cannot be taken the call answers 503 LEAD_TAG_COUNT_UNAVAILABLE and the tag is still there. A count that failed is not a count of zero, and this delete never guesses it — retry, or send ?force=true to delete without the count. A tag no lead carries deletes on the first call, with or without force. Ask GET /leads?tag_id=<id>&limit=1 first if you want the count before you commit to the call; pagination.total is the same number the refusal reports. The dashboard’s own delete, under Settings → Lead tags, asks the same question: it names the tag, shows how many leads carry it, and does nothing until that is confirmed.

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Path Parameters

id
string<uuid>
required

Query Parameters

force
boolean
default:false

true deletes a tag that leads still carry. Omitted or false, such a tag is refused with 409 LEAD_TAG_IN_USE. Any other value is 400 LEAD_TAG_DELETE_INVALID, as is any other query parameter.

Response

Deleted

success
boolean