Create a label ​
POST/api/v1/workspaces/{slug}/projects/{project_id}/labels/
Create a new label in the specified project with name, color, and description.
Path Parameters ​
project_id:requiredstringProject ID
slug:requiredstringWorkspace slug
Body Parameters ​
name:requiredstringName.
color:optionalstringColor.
description:optionalstringDescription.
external_source:optionalstringExternal source.
external_id:optionalstringExternal id.
parent:optionalstringParent.
sort_order:optionalnumberSort order.
Scopes ​
projects.labels:write
Create a label
bash
curl -X POST \
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/550e8400-e29b-41d4-a716-446655440000/labels/" \
-H "X-API-Key: $PLANE_API_KEY" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Example Name",
"color": "#ff0000",
"description": "Example description",
"external_id": "550e8400-e29b-41d4-a716-446655440000",
"external_source": "github"
}'python
import requests
response = requests.post(
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/550e8400-e29b-41d4-a716-446655440000/labels/",
headers={"X-API-Key": "your-api-key"},
json={
"name": "Example Name",
"color": "#ff0000",
"description": "Example description",
"external_id": "550e8400-e29b-41d4-a716-446655440000",
"external_source": "github"
}
)
print(response.json())javascript
const response = await fetch(
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/550e8400-e29b-41d4-a716-446655440000/labels/",
{
method: "POST",
headers: {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Example Name",
color: "#ff0000",
description: "Example description",
external_id: "550e8400-e29b-41d4-a716-446655440000",
external_source: "github",
}),
}
);
const data = await response.json();Response201
json
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Example Name",
"color": "#ff4444",
"description": "Example description",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
