Use this API to manage labels for both projects and groups. For the difference between the two, see types of labels.

List all group labels

GET /api/v4/groups/{id}/labels

Lists all group labels for a specified group.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a group
with_counts
Query
BooleanInclude issue and merge request counts
Default: false
include_ancestor_groups
Query
BooleanInclude ancestor groups
Default: true
include_descendant_groups
Query
BooleanInclude descendant groups. This feature was added in GitLab 13.6
Default: false
only_group_labels
Query
BooleanToggle to include only group labels or also project labels. This feature was added in GitLab 13.6
Default: true
search
Query
StringKeyword to filter labels by. This feature was added in GitLab 13.6
archived
Query
BooleanFilter by archived status. This feature was added in GitLab 18.10
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Create a group label

POST /api/v4/groups/{id}/labels

Creates a group label.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a group

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
color
Required
StringThe color of the label given in 6-digit hex notation with leading ‘#’ sign (e.g. #FFAABB) or one of the allowed CSS color names
descriptionStringThe description of label to be created
name
Required
StringThe name of the label to be created

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Update a group label

PUT /api/v4/groups/{id}/labels

Updates an existing group label. At least one parameter is required to update the group label.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a group

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
colorStringThe new color of the label given in 6-digit hex notation with leading ‘#’ sign (e.g. #FFAABB) or one of the allowed CSS color names
descriptionStringThe new description of label
label_idIntegerThe ID of the label to be updated
nameStringThe name of the label to be updated
new_nameStringThe new name of the label

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Delete a group label

DELETE /api/v4/groups/{id}/labels

Deletes a specified group label.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a group
name
Query, required
StringThe name of the label to be deleted

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Retrieve a group label

GET /api/v4/groups/{id}/labels/{name}

Retrieves a specified group label.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a group
name
Path, required
String or integerThe ID or name of a label
include_ancestor_groups
Query
BooleanInclude ancestor groups
Default: true
include_descendant_groups
Query
BooleanInclude descendant groups. This feature was added in GitLab 13.6
Default: false
only_group_labels
Query
BooleanToggle to include only group labels or also project labels. This feature was added in GitLab 13.6
Default: true

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Update a group label

PUT /api/v4/groups/{id}/labels/{name}

Updates a specified group label. At least one parameter is required to update the group label.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a group
name
Path, required
StringThe name or id of the label to be updated

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
colorStringThe new color of the label given in 6-digit hex notation with leading ‘#’ sign (e.g. #FFAABB) or one of the allowed CSS color names
descriptionStringThe new description of label
new_nameStringThe new name of the label

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Delete a group label

DELETE /api/v4/groups/{id}/labels/{name}

Deletes a specified group label.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a group
name
Path, required
StringThe name or id of the label to be deleted

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

List all project labels

GET /api/v4/projects/{id}/labels

Lists all labels for a specified project. By default, this request returns 20 results at a time because the API results are paginated.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
with_counts
Query
BooleanInclude issue and merge request counts
Default: false
include_ancestor_groups
Query
BooleanInclude ancestor groups
Default: true
search
Query
StringKeyword to filter labels by. This feature was added in GitLab 13.6
archived
Query
BooleanFilter by archived status. This feature was added in GitLab 18.10
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Create a project label

POST /api/v4/projects/{id}/labels

Creates a label for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
color
Required
StringThe color of the label given in 6-digit hex notation with leading ‘#’ sign (e.g. #FFAABB) or one of the allowed CSS color names
descriptionStringThe description of label to be created
name
Required
StringThe name of the label to be created
priorityIntegerThe priority of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Update an existing label (deprecated)

PUT /api/v4/projects/{id}/labels

At least one optional parameter is required.

Deprecated in GitLab 12.4. Use PUT /projects/:id/labels/:name instead.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
colorStringThe new color of the label given in 6-digit hex notation with leading ‘#’ sign (e.g. #FFAABB) or one of the allowed CSS color names
descriptionStringThe new description of label
label_idIntegerThe ID of the label to be updated
nameStringThe name of the label to be updated
new_nameStringThe new name of the label
priorityIntegerThe priority of the label

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Delete an existing label (deprecated)

DELETE /api/v4/projects/{id}/labels

Deprecated in GitLab 12.4. Use DELETE /projects/:id/labels/:name instead.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
label_id
Query
IntegerThe ID of the label to be deleted
name
Query
StringThe name of the label to be deleted

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Promote a label to a group label (deprecated)

PUT /api/v4/projects/{id}/labels/promote

Added in GitLab 12.3 and deprecated in GitLab 12.4. Use PUT /projects/:id/labels/:name/promote instead.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
name
Required
StringThe name of the label to be promoted

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Retrieve a project label

GET /api/v4/projects/{id}/labels/{name}

Retrieves a specified label for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
name
Path, required
String or integerThe ID or name of a label
include_ancestor_groups
Query
BooleanInclude ancestor groups
Default: true

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Update a project label

PUT /api/v4/projects/{id}/labels/{name}

Updates a specified label for a project with a different name or color. At least one parameter is required to update the label.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
name
Path, required
StringThe name or id of the label to be updated

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
colorStringThe new color of the label given in 6-digit hex notation with leading ‘#’ sign (e.g. #FFAABB) or one of the allowed CSS color names
descriptionStringThe new description of label
new_nameStringThe new name of the label
priorityIntegerThe priority of the label

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Delete a project label

DELETE /api/v4/projects/{id}/labels/{name}

Deletes a specified label from a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
name
Path, required
StringThe name or id of the label to be deleted

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Promote a project label to a group label

PUT /api/v4/projects/{id}/labels/{name}/promote

Promotes a specified project label to a group label. The label keeps its ID.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
name
Path, required
StringThe name or id of the label to be promoted

Responses

CodeDescriptionSchema
200OKAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesGroupLabel

PropertyTypeDescription
archivedBooleanExample: false
closed_issues_countIntegerExample: 0
colorStringExample: #FF0000
descriptionStringExample: Bug reported by user
description_htmlStringExample: <p>Bug reported by user</p>
idInteger (int64)Example: 1
nameStringExample: bug
open_issues_countIntegerExample: 1
open_merge_requests_countIntegerExample: 1
subscribedBooleanExample: false
text_colorStringExample: #FFFFFF

APIEntitiesProjectLabel

PropertyTypeDescription
archivedBooleanExample: false
closed_issues_countIntegerExample: 0
colorStringExample: #FF0000
descriptionStringExample: Bug reported by user
description_htmlStringExample: <p>Bug reported by user</p>
idInteger (int64)Example: 1
is_project_labelBoolean—
nameStringExample: bug
open_issues_countIntegerExample: 1
open_merge_requests_countIntegerExample: 1
priorityIntegerExample: 10
subscribedBooleanExample: false
text_colorStringExample: #FFFFFF