Use this API to subscribe to and unsubscribe from issues, merge requests, and labels in projects and groups.

All API calls to non-public information require authentication.

Subscribe to a group label

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

Subscribes the currently authenticated user to a specified group label. They will receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the group
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Unsubscribe to a group label

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

Unsubscribes the currently authenticated user from a specified group label. They will no longer receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the group
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesGroupLabel
400Bad Request—
404Not Found—

Subscribe to an issue

POST /api/v4/projects/{id}/issues/{subscribable_id}/subscribe

Subscribes the currently authenticated user to a specified issue. They will receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesIssue
400Bad Request—
404Not Found—

Unsubscribe to an issue

POST /api/v4/projects/{id}/issues/{subscribable_id}/unsubscribe

Unsubscribes the currently authenticated user from a specified issue. They will no longer receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesIssue
400Bad Request—
404Not Found—

Subscribe to a project label

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

Subscribes the currently authenticated user to a specified project label. They will receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Unsubscribe to a project label

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

Unsubscribes the currently authenticated user from a specified project label. They will no longer receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectLabel
400Bad Request—
404Not Found—

Subscribe to a merge request

POST /api/v4/projects/{id}/merge_requests/{subscribable_id}/subscribe

Subscribes the currently authenticated user to a specified merge request. They will receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesMergeRequest
400Bad Request—
404Not Found—

Unsubscribe to a merge request

POST /api/v4/projects/{id}/merge_requests/{subscribable_id}/unsubscribe

Unsubscribes the currently authenticated user from a specified merge request. They will no longer receive notifications on changes to this item.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
subscribable_id
Path, required
StringInternal ID of the issue or merge request, or ID or title of the label

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesMergeRequest
400Bad Request—
404Not Found—

Schemas

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

APIEntitiesCiPipeline

PropertyTypeDescription
archivedBooleanExample: false
before_shaStringExample: a91957a858320c0e17f3a0eca7cfacbff50ea29a
committed_atString (date-time)Example: 2015-12-24T15:51:21.880Z
coverageNumber (float)Example: 98.29
created_atString (date-time)Example: 2015-12-24T15:51:21.880Z
detailed_statusDetailedStatusEntity—
durationIntegerTime spent running in seconds
Example: 127
finished_atString (date-time)Example: 2015-12-24T17:54:31.198Z
idInteger (int64)ID of the pipeline
Example: 1
iidIntegerInternal ID of the pipeline
Example: 2
project_idInteger (int64)ID of the project of the pipeline
Example: 3
queued_durationIntegerTime spent enqueued in seconds
Example: 63
refStringGit reference of the pipeline
Example: feature-branch
shaStringSHA of the commit the pipeline runs for
Example: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringSource that triggered the pipeline
Example: push
started_atString (date-time)Example: 2015-12-24T17:54:30.733Z
statusStringStatus of the pipeline
Example: success
tagBooleanExample: false
updated_atString (date-time)Example: 2015-12-24T17:54:31.198Z
userAPIEntitiesUserBasic—
web_urlStringURL of the pipeline in the GitLab UI
Example: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61
yaml_errorsStringExample: widgets:build: needs 'widgets:test'

APIEntitiesCiPipelineBasic

PropertyTypeDescription
created_atString (date-time)Timestamp when the pipeline was created
Example: 2022-10-21T16:49:48.000+02:00
idInteger (int64)ID of the pipeline
Example: 1
iidIntegerInternal ID of the pipeline
Example: 2
project_idInteger (int64)ID of the project of the pipeline
Example: 3
refStringGit reference of the pipeline
Example: feature-branch
shaStringSHA of the commit the pipeline runs for
Example: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringSource that triggered the pipeline
Example: push
statusStringStatus of the pipeline
Example: success
updated_atString (date-time)Timestamp when the pipeline was last updated
Example: 2022-10-21T16:49:48.000+02:00
web_urlStringURL of the pipeline in the GitLab UI
Example: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesDiffRefs

PropertyTypeDescription
base_shaStringSHA of the merge base commit where the source and target branches diverged
Example: b83d6e391c22777fca1ed3012fce84f633d7fed0
head_shaStringSHA of the head commit of the source branch
Example: b83d6e391c22777fca1ed3012fce84f633d7fed0
start_shaStringSHA of the target branch commit the diff starts from. Usually the same as base_sha
Example: b83d6e391c22777fca1ed3012fce84f633d7fed0

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

APIEntitiesIssuableReferences

PropertyTypeDescription
fullStringExample: test&6
relativeStringExample: &6
shortStringExample: &6

APIEntitiesIssuableTimeStats

PropertyTypeDescription
human_time_estimateStringExample: 3h 30m
human_total_time_spentStringExample: 1h
time_estimateIntegerExample: 12600
total_time_spentIntegerExample: 3600

APIEntitiesIssue

PropertyTypeDescription
_linksObject—
_links.award_emojiStringExample: http://example.com/api/v4/projects/1/issues/2/award_emoji
_links.closed_as_duplicate_ofStringExample: http://example.com/api/v4/projects/1/issues/75
_links.notesStringExample: http://example.com/api/v4/projects/1/issues/2/notes
_links.projectStringExample: http://example.com/api/v4/projects/1
_links.selfStringExample: http://example.com/api/v4/projects/1/issues/2
assigneeAPIEntitiesUserBasic—
assigneesArray of APIEntitiesUserBasic—
authorAPIEntitiesUserBasic—
closed_atString (date-time)Example: 2022-11-15T08:30:55.232Z
closed_byAPIEntitiesUserBasic—
confidentialBoolean—
created_atString (date-time)Example: 2022-08-17T12:46:35.053Z
descriptionStringExample: Repellendus impedit et vel velit dignissimos.
discussion_lockedBoolean—
downvotesInteger—
due_dateString (date)Example: 2022-11-20
has_tasksBooleanExample: true
idInteger (int64)Example: 84
iidIntegerExample: 14
importedBooleanExample: false
imported_fromStringExample: github
issue_typeStringExample: issue
labelsArray of stringsExample: ["bug"]
merge_requests_countInteger—
milestoneAPIEntitiesMilestone—
moved_to_idInteger (int64)Example: 1
project_idInteger (int64)Example: 4
referencesAPIEntitiesIssuableReferences—
service_desk_reply_toStringExample: user@example.com
severityStringThe severity of the issue
Allowed values: UNKNOWN, LOW, MEDIUM, HIGH, CRITICAL
start_dateString (date)Example: 2022-11-18
stateStringExample: closed
subscribedBooleanExample: false
task_completion_statusAPIEntitiesTaskCompletionStatus—
task_statusStringExample: 2 of 4 tasks completed
time_statsAPIEntitiesIssuableTimeStats—
titleStringExample: Impedit et ut et dolores vero provident ullam est
typeStringThe type of the issue
Allowed values: ISSUE, INCIDENT, TEST_CASE, REQUIREMENT, TASK, TICKET
Example: ISSUE
updated_atString (date-time)Example: 2022-11-14T17:22:01.470Z
upvotesInteger—
user_notes_countInteger—
web_urlStringExample: http://example.com/example/example/issues/14

APIEntitiesMergeRequest

PropertyTypeDescription
allow_collaborationBooleanIf true, the fork allows commits from members who can merge to the target branch. Returned only for merge requests from forks
allow_maintainer_to_pushBooleanReturned only for merge requests from forks. Deprecated. Use allow_collaboration instead
assigneeAPIEntitiesUserBasicFirst user assigned to the merge request. Deprecated. Use assignees instead
assigneesArray of APIEntitiesUserBasicUsers assigned to the merge request
authorAPIEntitiesMergeRequestAuthorUser who created the merge request
blocking_discussions_resolvedBooleanIf true, no unresolved threads block the merge. Always true if the project does not require all threads to be resolved before merge
changes_countStringNumber of changed files in the merge request, as a string. Empty when the merge request is created, and populates asynchronously. When the diff exceeds the file limit, the value is the limit followed by +, like "1000+"
Example: 1
closed_atString (date-time)Timestamp of when the merge request was closed
Example: 2022-01-31T15:10:45.080Z
closed_byAPIEntitiesUserBasicUser who closed the merge request. null if the merge request is not closed
created_atString (date-time)Example: 2022-08-17T12:46:35.053Z
descriptionStringExample: Repellendus impedit et vel velit dignissimos.
description_htmlStringDescription of the merge request rendered as HTML. Returned only if render_html is true
detailed_merge_statusStringDetailed merge status of the merge request. Accounts for every check that can block a merge. Can be approvals_syncing (approvals are syncing), checking (Git is testing whether a valid merge is possible), ci_must_pass (a CI/CD pipeline must succeed before merge), ci_still_running (a CI/CD pipeline is still running), commits_status (the source branch must exist and contain commits), conflict (conflicts exist between the source and target branches), discussions_not_resolved (all discussions must be resolved before merge), draft_status (the merge request is a draft), jira_association_missing (the title or description must reference a Jira issue), locked_lfs_files (LFS files locked by other users must be unlocked before merge), locked_paths (paths locked by other users must be unlocked before merging to the default branch), merge_request_blocked (blocked by another merge request), merge_time (cannot be merged until after the specified time), mergeable (the branch can merge cleanly into the target branch), need_rebase (the merge request must be rebased), not_approved (approval is required before merge), not_open (the merge request must be open before merge), preparing (the merge request diff is being created), requested_changes (reviewers have requested changes), security_policy_pipeline_check (when security policies are enforced, all pipelines for the latest commit must succeed before merge), security_policy_violations (all security policies must be satisfied), status_checks_must_pass (all status checks must pass before merge), title_regex (the title must match the regular expression set in the project settings), or unchecked (Git has not yet tested whether a valid merge is possible)
Example: mergeable
diff_refsAPIEntitiesDiffRefsBase, head, and start SHAs of the latest diff version of the merge request. Empty when the merge request is created, and populates asynchronously
discussion_lockedBooleanIf true, discussions are locked. Only project members can add, edit or resolve comments in locked discussions
diverged_commits_countIntegerNumber of commits the source branch is behind the target branch. Returned only if include_diverged_commits_count is true
Example: 0
downvotesIntegerNumber of downvotes for the merge request
draftBooleanIf true, the merge request is a draft
first_contributionBooleanIf true, the merge request is the author’s first contribution to the project
first_deployed_to_production_atString (date-time)Timestamp of when the first deployment to production finished
Example: 2022-01-31T15:10:45.080Z
force_remove_source_branchBooleanIf true, the source branch is forced to be deleted after merge
has_conflictsBooleanIf true, the merge request has conflicts and cannot merge. false unless merge_status is cannot_be_merged
head_pipelineAPIEntitiesCiPipelinePipeline that runs on the HEAD commit of the source branch. Use instead of pipeline, because it contains more information. Returned only if the current user can view pipelines for the project
idInteger (int64)Example: 84
iidIntegerExample: 14
importedBooleanIf true, the merge request was imported
imported_fromStringSource of the import, such as bitbucket
Example: bitbucket
labelsArray of stringsNames of the labels assigned to the merge request, sorted by name. If with_labels_details is true, an array of label objects with id, name, color, text_color, description, description_html and archived instead
latest_build_finished_atString (date-time)Timestamp of when the latest build for the merge request finished
Example: 2022-01-31T15:10:45.080Z
latest_build_started_atString (date-time)Timestamp of when the latest build for the merge request started
Example: 2022-01-31T15:10:45.080Z
merge_afterString (date-time)If set, timestamp after which the merge request can be merged. Introduced in GitLab 17.8
Example: 2022-01-31T15:10:45.080Z
merge_commit_shaStringSHA of the merge commit. null until the merge request is merged
Example: 1234abcd
merge_errorStringError message shown when a merge fails. To check mergeability, use detailed_merge_status instead
Example: Merge error
merge_statusStringStatus of the merge request. Can be unchecked, checking, can_be_merged, cannot_be_merged or cannot_be_merged_recheck. Affects has_conflicts. Deprecated. Use detailed_merge_status instead
Example: unchecked
merge_userAPIEntitiesUserBasicUser who merged the merge request or set it to auto-merge, or null
merge_when_pipeline_succeedsBooleanIf true, the merge request is set to auto-merge
merged_atString (date-time)Timestamp of when the merge request was merged
Example: 2022-01-31T15:10:45.080Z
merged_byAPIEntitiesUserBasicUser who merged the merge request or set it to auto-merge. Deprecated. Use merge_user instead
milestoneAPIEntitiesMilestoneMilestone assigned to the merge request
pipelineAPIEntitiesCiPipelineBasicPipeline running on the branch HEAD of the merge request. Use head_pipeline instead, because it contains more information
prepared_atString (date-time)Timestamp of when the merge request was prepared. Set one time, after the diff is created, pipeline creation and the mergeability check are started, Git LFS objects are linked, and notifications are sent. Not updated when more changes are added
Example: 2022-01-31T15:10:45.080Z
project_idInteger (int64)Example: 4
rebase_in_progressBooleanIf true, a rebase operation is in progress on the source branch. Returned only if include_rebase_in_progress is true
referenceStringInternal reference of the merge request, in short format. Deprecated. Use references instead
Example: !1
referencesAPIEntitiesIssuableReferencesInternal references of the merge request: short, relative and full. When fetched from the project of the merge request, relative matches short. When fetched from a project or group in another namespace, relative matches full
reviewersArray of APIEntitiesUserBasicReviewers of the merge request
shaStringSHA of the head commit of the source branch
Example: 1234abcd
should_remove_source_branchBooleanIf true, the source branch is deleted after merge
source_branchStringName of the source branch
source_project_idInteger (int64)ID of the source project. Equal to target_project_id, unless the merge request comes from a fork
squashBooleanIf true, squash commits when merging. Project squash settings can override this value. Use squash_on_merge to take them into account
squash_commit_shaStringSHA of the squash commit. Empty until the merge request is merged
Example: 1234abcd
squash_on_mergeBooleanIf true, commits are squashed on merge
stateStringExample: closed
subscribedBooleanIf true, the current user is subscribed to the merge request
target_branchStringName of the target branch
target_project_idInteger (int64)ID of the target project
task_completion_statusAPIEntitiesTaskCompletionStatusCompletion status of the task list: count and completed_count
time_statsAPIEntitiesIssuableTimeStatsTime tracking statistics of the merge request: time_estimate, total_time_spent, human_time_estimate and human_total_time_spent
titleStringExample: Impedit et ut et dolores vero provident ullam est
title_htmlStringTitle of the merge request rendered as HTML. Returned only if render_html is true
updated_atString (date-time)Example: 2022-11-14T17:22:01.470Z
upvotesIntegerNumber of upvotes for the merge request
userObjectPermissions of the current user for the merge request
user.can_mergeBooleanIf true, the current user can merge the merge request
user_notes_countIntegerNumber of user comments on the merge request
web_urlStringWeb URL of the merge request
Example: https://gitlab.example.com/my-group/my-project/-/merge_requests/1
work_in_progressBooleanIf true, the merge request is a draft. Deprecated. Use draft instead

APIEntitiesMergeRequestAuthor

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
botBooleanIf true, the author is a bot
Example: false
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root

APIEntitiesMilestone

PropertyTypeDescription
created_atString—
descriptionString—
due_dateString—
expiredBoolean—
group_idString—
idInteger (int64)—
iidInteger (int64)—
project_idInteger (int64)—
start_dateString—
stateString—
titleString—
updated_atString—
web_urlString—

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

APIEntitiesTaskCompletionStatus

PropertyTypeDescription
completed_countIntegerExample: 3
countIntegerExample: 5

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root

DetailedStatusEntity

PropertyTypeDescription
actionObject—
action.button_titleStringExample: Cancel this job
action.confirmation_messageStringExample: Are you sure?
action.iconStringExample: cancel
action.methodStringExample: post
action.pathStringExample: /namespace1/project1/-/jobs/2/cancel
action.titleStringExample: Cancel
details_pathStringExample: /test-group/test-project/-/pipelines/287
faviconStringExample: /assets/ci_favicons/favicon_status_success.png
groupStringExample: success
has_detailsBooleanExample: true
iconStringExample: status_success
illustrationObjectExample: {"content":"This job depends on upstream jobs that need to succeed in order for this job to be triggered","image":"illustrations/empty-state/empty-job-not-triggered-md.svg","size":"","title":"This job has not been triggered yet"}
labelStringExample: passed
textStringExample: passed
tooltipStringExample: passed