Base URL
https://app.dmu.email/api/v1
Authentication
Bearer dmk_… API key
Rate limit
120 requests a minute per key

Label a thread

POST/threads/{id}/labels

Puts labels on a conversation and takes them off in one request, and returns the labels it has afterwards.

Needs the permissionthreads:label

If a label in add can’t be used in the conversation’s mailbox, the whole request is refused with 409 not_usable and nothing changes. Taking a label off is always allowed.

Find label ids with List labels. Each change goes in the conversation’s history under the key’s name.

Path parameters

idstringrequired
The thread.

Body

addlist of stringsoptional
Ids of labels to put on it.
removelist of stringsoptional
Ids of labels to take off. Send at least one of the two.

Returns

The conversation’s labels after the change, each with:

idstring
The label.
namestring
Its name.
colourstring
A preset such as blue-700.

Errors

400nothing_to_change
Neither add nor remove was sent.
400invalid_request
A label is in both lists, or a list isn’t a list.
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 threads:label. The X-Required-Scope header names what’s missing.
404not_found
There’s no such thread, or the key’s owner can’t see it.
409not_usable
A label in add can’t be used in this conversation’s mailbox.
429rate_limited
More than 120 requests a minute from this key. Wait for Retry-After seconds.
curl https://app.dmu.email/api/v1/threads/a41c93f0/labels \
  -X POST \
  -H "Authorization: Bearer dmk_7f3a9c2e1b4d_Xq8v…" \
  -H "Content-Type: application/json" \
  -d '{ "add": ["5b0e2c71"], "remove": ["e2a4f809"] }'

Response

200 OK

{
  "data": [
    {
      "id": "5b0e2c71",
      "name": "Invoices",
      "colour": "blue-700"
    }
  ]
}

Every response wraps its result in data. A page of threads adds nextCursor, which is null on the last page.