POST
/api/public/v1/project-labels

Create a project label

Adds a label to one project’s vocabulary. A name that project already has returns the existing label rather than an error — the caller wanted a label with that name and now has one, so this is safe to call before every tagging write. In the console, adding to a project’s labels needs you to manage that project. Filing against labels that already exist needs nothing.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.

projects:admin

Request Body

PropertyTypeDescription
projectIdstringThe project whose vocabulary this joins.
namestringUp to 50 characters.
colorstringOne of the shared label color tokens.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/project-labels" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "prj_3c1a",
    "name": "customer-request",
    "color": "amber"
  }'
200Example response
json
{
  "message": "Label created successfully!",
  "content": {
    "label": {
      "id": "lbl_77",
      "projectId": "prj_3c1a",
      "name": "customer-request",
      "color": "amber"
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Projects
/projects
  1. Open a project.
  2. Type a new name into the label picker to create it inline.