POST/v2/projects/{projectId}/labels

Create a project label

Creates a label for a project. Supply name and color; description is optional and can contain up to 2000 characters. The response includes the created label and its generated identifier.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 3 body fields
projectIdintegerrequired
The unique integer identifier of the project to add the label to.

The label to create. Include name and color; description is optional.

colorstringrequired
Hex color in format #RRGGBB.
descriptionstringoptional
An optional description of the label. Maximum 2000 characters.
namestringrequired
The label name. Maximum 100 characters.

5 status codes
200Returns the created label with its `id`, `name`, `color`, and optional `description`.
colorstringrequired
descriptionstringoptional
idintegerrequired
namestringrequired
400Returned when the request body is invalid, including when required fields are missing or field values fail validation.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is unauthenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when you do not have permission to create a label for the project.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the project is not found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the request body is invalid, a 401 when authentication is missing or invalid, a 403 when you lack permission, and a 404 when the project is not found. The projectId path parameter must identify an existing project. The body must include name and color; name can contain at most 100 characters, and color must match the #RRGGBB hex format.