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
StringID or URL-encoded path of the group
with_counts
Query
BooleanIf true, includes issue and merge request counts
Default: false
include_ancestor_groups
Query
BooleanIf true, includes ancestor groups
Default: true
include_descendant_groups
Query
BooleanIf true, includes descendant groups
Default: false
only_group_labels
Query
BooleanIf true, returns only group labels. If false, also returns project labels
Default: true
search
Query
StringKeyword to filter labels by
archived
Query
BooleanIf true, returns only archived labels. If false, returns only non-archived labels. If omitted, returns all labels. Introduced in GitLab 18.10
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesGroupLabel
400Bad Request—
404Not Found—

Create a group label

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

Creates a group label.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the group

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
color
Required
StringColor of the label in 6-digit hex notation with a leading # sign, for example #FFAABB, or one of the CSS color names
descriptionStringDescription of the label
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
StringID or URL-encoded path of the group

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived. At least one of new_name, color, description, archived must be provided
colorStringNew color of the label, given in 6-digit hex notation with a leading # sign (for example, #FFAABB), or one of the CSS color names. At least one of new_name, color, description, archived must be provided
descriptionStringNew description of label. At least one of new_name, color, description, archived must be provided
label_idIntegerID of the label to update. Exactly one of label_id, name must be provided
nameStringName of the label to update. Exactly one of label_id, name must be provided
new_nameStringThe new name of the label. At least one of new_name, color, description, archived must be provided

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
StringID or URL-encoded path of the group
name
Query, required
StringName of the label to delete

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
StringID or URL-encoded path of the group
name
Path, required
String or integerID or name of the label
include_ancestor_groups
Query
BooleanIf true, includes ancestor groups
Default: true
include_descendant_groups
Query
BooleanIf true, includes descendant groups
Default: false
only_group_labels
Query
BooleanIf true, returns only group labels. If false, also returns project labels
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
StringID or URL-encoded path of the group
name
Path, required
StringName or ID of the label to update

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived. At least one of new_name, color, description, archived must be provided
colorStringNew color of the label, given in 6-digit hex notation with a leading # sign (for example, #FFAABB), or one of the CSS color names. At least one of new_name, color, description, archived must be provided
descriptionStringNew description of label. At least one of new_name, color, description, archived must be provided
new_nameStringThe new name of the label. At least one of new_name, color, description, archived must be provided

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
StringID or URL-encoded path of the group
name
Path, required
StringName or ID of the label to delete

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 integerID or URL-encoded path of the project
with_counts
Query
BooleanIf true, includes issue and merge request counts
Default: false
include_ancestor_groups
Query
BooleanIf true, includes ancestor groups
Default: true
search
Query
StringKeyword to filter labels by
archived
Query
BooleanIf true, returns only archived labels. If false, returns only non-archived labels. If omitted, returns all labels. Introduced in GitLab 18.10
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesProjectLabel
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 integerID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived
color
Required
StringColor of the label in 6-digit hex notation with a leading # sign, for example #FFAABB, or one of the CSS color names
descriptionStringDescription of the label
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 integerID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived. At least one of new_name, color, description, priority, archived must be provided
colorStringNew color of the label, given in 6-digit hex notation with a leading # sign (for example, #FFAABB), or one of the CSS color names. At least one of new_name, color, description, priority, archived must be provided
descriptionStringNew description of label. At least one of new_name, color, description, priority, archived must be provided
label_idIntegerID of the label to update. Exactly one of label_id, name must be provided
nameStringName of the label to update. Exactly one of label_id, name must be provided
new_nameStringThe new name of the label. At least one of new_name, color, description, priority, archived must be provided
priorityIntegerThe priority of the label. At least one of new_name, color, description, priority, archived must be provided

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 integerID or URL-encoded path of the project
label_id
Query
IntegerID of the label to delete. Exactly one of label_id, name must be provided
name
Query
StringName of the label to delete. Exactly one of label_id, name must be provided

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 integerID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
name
Required
StringName of the label to promote

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 integerID or URL-encoded path of the project
name
Path, required
String or integerID or name of the label
include_ancestor_groups
Query
BooleanIf true, includes 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 integerID or URL-encoded path of the project
name
Path, required
StringName or ID of the label to update

Request body (application/json)

PropertyTypeDescription
archivedBooleanWhether the label is archived. At least one of new_name, color, description, priority, archived must be provided
colorStringNew color of the label, given in 6-digit hex notation with a leading # sign (for example, #FFAABB), or one of the CSS color names. At least one of new_name, color, description, priority, archived must be provided
descriptionStringNew description of label. At least one of new_name, color, description, priority, archived must be provided
new_nameStringThe new name of the label. At least one of new_name, color, description, priority, archived must be provided
priorityIntegerThe priority of the label. At least one of new_name, color, description, priority, archived must be provided

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 integerID or URL-encoded path of the project
name
Path, required
StringName or ID of the label to delete

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 integerID or URL-encoded path of the project
name
Path, required
StringName or ID of the label to promote

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