Mail API reference

Mail API · Labels

post/v1/workspaces/{workspace_id}/labelsAuth

Create a label

Needs `mail.label.manage`. Written to the workspace audit log (`mail.label.created`).

Path parameters

workspace_id*string · uuid

Id of the workspace.

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`.

Request body

name*string

Name, unique in the workspace (case-insensitive).

Example: "Needs reply"

colorstring

Colour as `#rrggbb`.

Example: "#e5484d"

Response · 201

id*string · uuid

Label id.

name*string

Name, unique in the workspace (case-insensitive).

Example: "Needs reply"

color*string

Colour as `#rrggbb`, or null.

Example: "#e5484d"

Example

Request

POST https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/labels
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "name": "Needs reply",
  "color": "#e5484d"
}

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "Needs reply",
  "color": "#e5484d"
}