Mail API reference

Mail API · Threads

delete/v1/workspaces/{workspace_id}/threads/{id}/labels/{label_id}Auth

Remove a label from a conversation

Takes one label off the thread (a no-op when it does not have it). Needs `mail.thread.triage` on its mailbox.

Path parameters

workspace_id*string · uuid

Id of the workspace.

id*string · uuid

Thread id.

label_id*string · uuid

Label id.

Headers

Idempotency-Keystring

Opaque client-generated string (1–256 chars, `[A-Za-z0-9._:-]`) used to deduplicate retries within a 24h window. A retry with the same key and body returns the original response with `Idempotent-Replay: true`.

Response · 200

id*string · uuid

Thread id (`GET /threads/{id}`).

mailbox*object

The mailbox the conversation belongs to.

subject*string

Subject of the first message.

snippet*string

Start of the newest received message's text. Null without `mail.message.body.read`, or for a thread with sent mail only.

participants*array

Everyone who wrote or was written to, the mailbox itself excluded.

message_count*number

Received messages plus sent emails.

Example: 3

unread_count*number

Received messages not read yet.

Example: 1

has_attachments*boolean

Any message in it has files.

assignee_account_id*string · uuid

The workspace member it is assigned to.

labels*array

Its labels, by name.

status*object

New mail on an `archived` thread moves it back to `open`.

last_message_at*string · date-time

Newest message, received or sent.

trashed_at*string · date-time

When it was moved to the trash; it is erased 30 days later. Null outside the trash.

has_pending_draft*boolean

A draft in this conversation is waiting for approval (`GET /drafts?thread_id=…&status=pending_approval`).

Example: false

Example

Request

DELETE https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/threads/{id}/labels/{label_id}
Authorization: Bearer YOUR_TOKEN

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "mailbox": {},
  "subject": "string",
  "snippet": "string",
  "participants": [
    "string"
  ],
  "message_count": 3,
  "unread_count": 1,
  "has_attachments": false,
  "assignee_account_id": "00000000-0000-0000-0000-000000000000",
  "labels": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "Needs reply",
      "color": "#e5484d"
    }
  ],
  "status": {},
  "last_message_at": "2026-01-01T00:00:00.000Z",
  "trashed_at": "2026-01-01T00:00:00.000Z",
  "has_pending_draft": false
}