Skip to content
Barynt v1.0.12

Labels

REST API: list, create, change and delete labels.

Labels belong to a workspace and can be put on any issue in it. Every call needs the scope shown and a key (or token) that belongs to someone who may do this in the app. See Authentication and basics.

GET /api/v1/workspaces/{id}/labels

Scope: labels:read

List every label visible in a workspace — workspace-wide labels plus those of every project you can see.

Path parameters

NameTypeRequiredDescription
idstringyesThe workspace’s id.

Example

Terminal window
curl "$BARYNT_URL/api/v1/workspaces/$WORKSPACE_ID/labels" \
-H "Authorization: Bearer $BARYNT_API_KEY"

Response

{
"data": [
{
"id": "l_9f2a1b",
"name": "frontend",
"slug": "frontend",
"color": "#3b7bd5",
"projectId": null
}
]
}

POST /api/v1/workspaces/{id}/labels

Scope: labels:write

Create a label. Omit projectId for a workspace-wide label that applies everywhere.

Path parameters

NameTypeRequiredDescription
idstringyesThe workspace’s id.

Body

NameTypeRequiredDescription
namestringyes
colorstringyesA hex color.
projectIdstringScope the label to a single project instead of the whole workspace.

Example

Terminal window
curl -X POST "$BARYNT_URL/api/v1/workspaces/$WORKSPACE_ID/labels" \
-H "Authorization: Bearer $BARYNT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "frontend", "color": "#3b7bd5", "projectId": "proj_9f8e7d" }'

Request

{
"name": "frontend",
"color": "#3b7bd5",
"projectId": "proj_9f8e7d"
}

Response

// 201 Created
{
"data": {
"id": "l_9f2a1b",
"name": "frontend",
"slug": "frontend",
"color": "#3b7bd5",
"projectId": null
}
}

PATCH /api/v1/labels/{id}

Scope: labels:write

Update a label’s name and/or color. Every field is optional — send only what changes.

Path parameters

NameTypeRequiredDescription
idstringyesThe label’s id.

Body

NameTypeRequiredDescription
namestring
colorstringA hex color.

Example

Terminal window
curl -X PATCH "$BARYNT_URL/api/v1/labels/$LABEL_ID" \
-H "Authorization: Bearer $BARYNT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "frontend", "color": "#e0992b" }'

Request

{
"name": "frontend",
"color": "#e0992b"
}

Response

{
"data": { "id": "l_9f2a1b" }
}

DELETE /api/v1/labels/{id}

Scope: labels:write

Delete a label and remove it from every issue it’s attached to.

Path parameters

NameTypeRequiredDescription
idstringyesThe label’s id.

Example

Terminal window
curl -X DELETE "$BARYNT_URL/api/v1/labels/$LABEL_ID" \
-H "Authorization: Bearer $BARYNT_API_KEY"

Response

{
"data": { "id": "l_9f2a1b" }
}