Labels API
Labels organize tasks with a workspace-managed name and color. Create labels once, then attach their names when creating or updating tasks.
Task writes reject unknown label names by default. To create a label as part of a task write instead, send "createMissing": true with labels — see creating labels on the fly. Labels born that way get color gray; everything else on this page applies to them unchanged.
Label Object
{
"id": "label_abc123",
"name": "Release",
"color": "blue",
"createdAt": "2025-01-10T12:00:00.000Z",
"updatedAt": "2025-01-10T12:00:00.000Z"
}Field Reference
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
name | string | Label name, 1–40 characters after trimming; unique within a workspace without regard to case |
color | string | One of: gray, blue, teal, green, yellow, orange, red, pink, purple, brown |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last-updated timestamp |
List Labels
GET /api/v1/labelsReturns labels in the current workspace, sorted by name.
Response
{
"data": [
{
"id": "label_abc123",
"name": "Release",
"color": "blue",
"createdAt": "2025-01-10T12:00:00.000Z",
"updatedAt": "2025-01-10T12:00:00.000Z"
}
]
}Create Label
POST /api/v1/labelsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | 1–40 characters after trimming; unique within the workspace without regard to case |
color | string | Yes | One of the supported label colors |
Example
curl -X POST https://api.cohort.bot/api/v1/labels \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Release",
"color": "blue"
}'Returns the created label with a 201 status.
Name Conflict
Label names are case-insensitively unique within a workspace. Creating release when Release already exists returns 409 with the LABEL_NAME_EXISTS conflict error.
Update Label
PATCH /api/v1/labels/:idUpdates the supplied fields and returns the updated label.
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Replacement name; 1–40 characters after trimming and case-insensitively unique within the workspace |
color | string | Replacement color from the supported label colors |
Example
curl -X PATCH https://api.cohort.bot/api/v1/labels/label_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Urgent",
"color": "red"
}'As with creation, a duplicate name returns 409 with the LABEL_NAME_EXISTS conflict error.
Delete Label
DELETE /api/v1/labels/:idPermanently deletes the label and removes it from every task in the workspace. The response is 204 with no body.
Example
curl -X DELETE https://api.cohort.bot/api/v1/labels/label_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"