/v1/workspaces/{workspace_id}/labelsAuthCreate a label
Needs `mail.label.manage`. Written to the workspace audit log (`mail.label.created`).
Path parameters
workspace_id*string · uuidId of the workspace.
Headers
Idempotency-KeystringOpaque 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*stringName, unique in the workspace (case-insensitive).
Example: "Needs reply"
colorstringColour as `#rrggbb`.
Example: "#e5484d"
Response · 201
id*string · uuidLabel id.
name*stringName, unique in the workspace (case-insensitive).
Example: "Needs reply"
color*stringColour 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"
}