Delete a label
DELETE
/labels/{id}Takes a label off every conversation that carries it, then deletes it.
Needs the permissionlabels:delete
The labels inside it move up a level by default, to the deleted label’s own parent, and keep their conversations. With ?inside=delete they’re deleted too.
Members who may manage labels can delete only labels no conversation carries, and with inside=delete that goes for every label deleted: if one is in use, nothing is deleted. Administrators can delete any.
Path parameters
idstringrequired- The label.
Query parameters
insidestringoptional- What happens to the labels inside it:
keep(the default) ordelete.
Returns
Nothing: a successful delete is 204 No Content.
Errors
400invalid_requestinsideisn’tkeepordelete.401invalid_key- The key is wrong, expired or revoked. With no Authorization header at all, the code is
missing_credentials. 403missing_scope- The key doesn’t have
labels:delete. TheX-Required-Scopeheader names what’s missing. 403in_use- The key’s owner is a member and conversations carry a label that would be deleted.
403not_allowed- The key’s owner isn’t allowed to manage labels in this organisation.
404not_found- There’s no such label, or the key’s owner can’t see it.
409move_clash- A label inside it would move up beside another with the same name. Rename one first, or send
inside=delete. 429rate_limited- More than 120 requests a minute from this key. Wait for
Retry-Afterseconds.