Delete a label

.md

Take a label away, everywhere at once.

Scopesmail:write
DELETE/v1/me/mail/labels/{id}

The rows tying the label to messages go with it. The mail does not. The path takes the label's id from the list, and a number there answers 404.

A label is a way of finding messages, never a place they live, so removing one can never lose anything. That is what makes this different from deleting a folder, and why there is no undo and no bin.

It disappears for everyone

Labels belong to the environment. Deleting one takes it off every conversation it was on, for every colleague, immediately.

Anything still filtering on the id afterwards gets a 404 from the message list rather than the whole folder back.

Request

curl -X DELETE https://api.proppertrading.com/v1/me/mail/labels/lbl_p6m3x8b2k9q4w7td \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f"

Response

204, with no body.

Errors

StatusCodeMeaning
403insufficient_scopeThis device does not hold mail:write
404resource_not_foundNo label with that id in this environment