Use this API to manage merge requests in a project, and to list the merge requests across a group or an entire instance. You can:
- Automate any part of the code review process.
- Connect code changes to external tools.
- Send merge request information to non-GitLab systems in your preferred format.
- Update, approve, merge, or block merge requests based on data from external systems.
- Add commits from previous merge requests to a merge request for more context.
All API calls to non-public information require authentication.
List all group merge requests
GET /api/v4/groups/{id}/merge_requests
Lists all merge requests for a specified group and any subgroups.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- |
author_Query | Integer | Returns merge requests created by the given user id.scope=all or scope=assigned_.author_ |
author_Query | String | Returns merge requests created by the given username.author_ |
assignee_Query | Integer or string | Returns merge requests assigned to the given user id.None returns unassigned merge requests.Any returns merge requests with an assignee.assignee_ |
assignee_Query | Array of strings | Returns merge requests assigned to the given usernames.assignee_ |
reviewer_Query | String | Returns merge requests which have the user as a reviewer with the given username.reviewer_ |
labelsQuery | Array of strings | Returns merge requests matching a comma-None lists all merge requests with no labels.Any lists all merge requests with at least one label. |
milestoneQuery | String | Returns merge requests for a specific milestone.None returns merge requests with no milestone.Any returns merge requests that have an assigned milestone |
my_Query | String | Returns merge requests reacted by the authenticated user by the given emoji.None returns issues not given a reaction.Any returns issues given at least one reaction |
reviewer_Query | Integer or string | Returns merge requests which have the user as a reviewer with the given user id.None returns merge requests with no reviewers.Any returns merge requests with any reviewer.reviewer_ |
stateQuery | String | Filter merge requests by state.locked usually returns no results,locked state is short-Allowed values: opened,closed,locked,merged,allDefault: all |
order_Query | String | Returns merge requests ordered by created_,label_,milestone_,popularity,priority,title,updated_ or merged_ fields.merged_ introduced in GitAllowed values: created_,label_,milestone_,popularity,priority,title,updated_,merged_Default: created_ |
sortQuery | String | Sort results in ascending or descending order Allowed values: asc,descDefault: desc |
with_Query | Boolean | If true,name,color,description,description_,text_Default: false |
with_Query | Boolean | If true,merge_ field.Default: false |
created_Query | String (date- | Return merge requests created on or after the specified time Example: 2019- |
created_Query | String (date- | Return merge requests created on or before the specified time Example: 2019- |
updated_Query | String (date- | Return merge requests updated on or after the specified time Example: 2019- |
updated_Query | String (date- | Return merge requests updated on or before the specified time Example: 2019- |
merged_Query | String (date- | Return merge requests merged on or after the specified time Example: 2019- |
merged_Query | String (date- | Return merge requests merged on or before the specified time Example: 2019- |
viewQuery | String | If simple,iid,Allowed values: simple |
scopeQuery | String | Return merge requests for the given scope.reviews_ returns merge requests where the current user is assigned as a reviewer.allAllowed values: created-,assigned-,created_,assigned_,reviews_,all |
source_Query | String | Return merge requests with the given source branch |
source_Query | Integer | Return merge requests with the given source project ID |
target_Query | String | Return merge requests with the given target branch |
searchQuery | String | Search merge requests against their title and description.in attribute |
inQuery | String | Modify the scope of the search attribute to title,description,title,.title,Example: title, |
wipQuery | String | Filter merge requests by their wip status.yes returns only draft merge requests,no returns non-draft instead.draftAllowed values: yes,no |
draftQuery | Boolean | If true,false,wip |
notQuery | Object | Return merge requests that do not match the parameters supplied.labels,milestone,author_,author_,assignee_,assignee_,reviewer_,reviewer_,my_ |
not[author_Query | Integer | <Negated> Returns merge requests created by the given user id.scope=all or scope=assigned_.not[author_ |
not[author_Query | String | <Negated> Returns merge requests created by the given username.not[author_ |
not[assignee_Query | Integer or string | <Negated> Returns merge requests assigned to the given user id.None returns unassigned merge requests.Any returns merge requests with an assignee.not[assignee_ |
not[assignee_Query | Array of strings | <Negated> Returns merge requests assigned to the given usernames.not[assignee_ |
not[reviewer_Query | String | <Negated> Returns merge requests which have the user as a reviewer with the given username.not[reviewer_ |
not[labels]Query | Array of strings | <Negated> Returns merge requests matching a comma-None lists all merge requests with no labels.Any lists all merge requests with at least one label. |
not[milestone]Query | String | <Negated> Returns merge requests for a specific milestone.None returns merge requests with no milestone.Any returns merge requests that have an assigned milestone |
not[my_Query | String | <Negated> Returns merge requests reacted by the authenticated user by the given emoji.None returns issues not given a reaction.Any returns issues given at least one reaction |
not[reviewer_Query | Integer | <Negated> Returns merge requests which have the user as a reviewer with the given user id.not[reviewer_ |
deployed_Query | String (date- | Return merge requests deployed before the specified time Example: 2019- |
deployed_Query | String (date- | Return merge requests deployed after the specified time Example: 2019- |
environmentQuery | String | Return merge requests deployed to the given environment Example: production |
merge_Query | Integer | Returns merge requests which have been merged by the user with the given user id.merge_ |
merge_Query | String | Returns merge requests which have been merged by the user with the given username.merge_ |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
non_Query | Boolean | If true,Default: true |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
422 | Unprocessable entity | — |
List all merge requests
GET /api/v4/merge_requests
Lists all merge requests accessible to the authenticated user. By default, returns only merge requests created by the current user. Use scope=all to get all merge requests.
Parameters
| Name | Type | Description |
|---|---|---|
author_Query | Integer | Returns merge requests created by the given user id.scope=all or scope=assigned_.author_ |
author_Query | String | Returns merge requests created by the given username.author_ |
assignee_Query | Integer or string | Returns merge requests assigned to the given user id.None returns unassigned merge requests.Any returns merge requests with an assignee.assignee_ |
assignee_Query | Array of strings | Returns merge requests assigned to the given usernames.assignee_ |
reviewer_Query | String | Returns merge requests which have the user as a reviewer with the given username.reviewer_ |
labelsQuery | Array of strings | Returns merge requests matching a comma-None lists all merge requests with no labels.Any lists all merge requests with at least one label. |
milestoneQuery | String | Returns merge requests for a specific milestone.None returns merge requests with no milestone.Any returns merge requests that have an assigned milestone |
my_Query | String | Returns merge requests reacted by the authenticated user by the given emoji.None returns issues not given a reaction.Any returns issues given at least one reaction |
reviewer_Query | Integer or string | Returns merge requests which have the user as a reviewer with the given user id.None returns merge requests with no reviewers.Any returns merge requests with any reviewer.reviewer_ |
stateQuery | String | Filter merge requests by state.locked usually returns no results,locked state is short-Allowed values: opened,closed,locked,merged,allDefault: all |
order_Query | String | Returns merge requests ordered by created_,label_,milestone_,popularity,priority,title,updated_ or merged_ fields.merged_ introduced in GitAllowed values: created_,label_,milestone_,popularity,priority,title,updated_,merged_Default: created_ |
sortQuery | String | Sort results in ascending or descending order Allowed values: asc,descDefault: desc |
with_Query | Boolean | If true,name,color,description,description_,text_Default: false |
with_Query | Boolean | If true,merge_ field.Default: false |
created_Query | String (date- | Return merge requests created on or after the specified time Example: 2019- |
created_Query | String (date- | Return merge requests created on or before the specified time Example: 2019- |
updated_Query | String (date- | Return merge requests updated on or after the specified time Example: 2019- |
updated_Query | String (date- | Return merge requests updated on or before the specified time Example: 2019- |
merged_Query | String (date- | Return merge requests merged on or after the specified time Example: 2019- |
merged_Query | String (date- | Return merge requests merged on or before the specified time Example: 2019- |
viewQuery | String | If simple,iid,Allowed values: simple |
scopeQuery | String | Return merge requests for the given scope.reviews_ returns merge requests where the current user is assigned as a reviewerAllowed values: created-,assigned-,created_,assigned_,reviews_,allDefault: created_ |
source_Query | String | Return merge requests with the given source branch |
source_Query | Integer | Return merge requests with the given source project ID |
target_Query | String | Return merge requests with the given target branch |
searchQuery | String | Search merge requests against their title and description.in attribute |
inQuery | String | Modify the scope of the search attribute to title,description,title,.title,Example: title, |
wipQuery | String | Filter merge requests by their wip status.yes returns only draft merge requests,no returns non-draft instead.draftAllowed values: yes,no |
draftQuery | Boolean | If true,false,wip |
notQuery | Object | Return merge requests that do not match the parameters supplied.labels,milestone,author_,author_,assignee_,assignee_,reviewer_,reviewer_,my_ |
not[author_Query | Integer | <Negated> Returns merge requests created by the given user id.scope=all or scope=assigned_.not[author_ |
not[author_Query | String | <Negated> Returns merge requests created by the given username.not[author_ |
not[assignee_Query | Integer or string | <Negated> Returns merge requests assigned to the given user id.None returns unassigned merge requests.Any returns merge requests with an assignee.not[assignee_ |
not[assignee_Query | Array of strings | <Negated> Returns merge requests assigned to the given usernames.not[assignee_ |
not[reviewer_Query | String | <Negated> Returns merge requests which have the user as a reviewer with the given username.not[reviewer_ |
not[labels]Query | Array of strings | <Negated> Returns merge requests matching a comma-None lists all merge requests with no labels.Any lists all merge requests with at least one label. |
not[milestone]Query | String | <Negated> Returns merge requests for a specific milestone.None returns merge requests with no milestone.Any returns merge requests that have an assigned milestone |
not[my_Query | String | <Negated> Returns merge requests reacted by the authenticated user by the given emoji.None returns issues not given a reaction.Any returns issues given at least one reaction |
not[reviewer_Query | Integer | <Negated> Returns merge requests which have the user as a reviewer with the given user id.not[reviewer_ |
deployed_Query | String (date- | Return merge requests deployed before the specified time Example: 2019- |
deployed_Query | String (date- | Return merge requests deployed after the specified time Example: 2019- |
environmentQuery | String | Return merge requests deployed to the given environment Example: production |
merge_Query | Integer | Returns merge requests which have been merged by the user with the given user id.merge_ |
merge_Query | String | Returns merge requests which have been merged by the user with the given username.merge_ |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
non_Query | Boolean | If true,Default: false |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
422 | Unprocessable entity | — |
List all project merge requests
GET /api/v4/projects/{id}/merge_requests
Lists all project merge requests.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
author_Query | Integer | Returns merge requests created by the given user id.scope=all or scope=assigned_.author_ |
author_Query | String | Returns merge requests created by the given username.author_ |
assignee_Query | Integer or string | Returns merge requests assigned to the given user id.None returns unassigned merge requests.Any returns merge requests with an assignee.assignee_ |
assignee_Query | Array of strings | Returns merge requests assigned to the given usernames.assignee_ |
reviewer_Query | String | Returns merge requests which have the user as a reviewer with the given username.reviewer_ |
labelsQuery | Array of strings | Returns merge requests matching a comma-None lists all merge requests with no labels.Any lists all merge requests with at least one label. |
milestoneQuery | String | Returns merge requests for a specific milestone.None returns merge requests with no milestone.Any returns merge requests that have an assigned milestone |
my_Query | String | Returns merge requests reacted by the authenticated user by the given emoji.None returns issues not given a reaction.Any returns issues given at least one reaction |
reviewer_Query | Integer or string | Returns merge requests which have the user as a reviewer with the given user id.None returns merge requests with no reviewers.Any returns merge requests with any reviewer.reviewer_ |
stateQuery | String | Filter merge requests by state.locked usually returns no results,locked state is short-Allowed values: opened,closed,locked,merged,allDefault: all |
order_Query | String | Returns merge requests ordered by created_,label_,milestone_,popularity,priority,title,updated_ or merged_ fields.merged_ introduced in GitAllowed values: created_,label_,milestone_,popularity,priority,title,updated_,merged_Default: created_ |
sortQuery | String | Sort results in ascending or descending order Allowed values: asc,descDefault: desc |
with_Query | Boolean | If true,name,color,description,description_,text_Default: false |
with_Query | Boolean | If true,merge_ field.Default: false |
created_Query | String (date- | Return merge requests created on or after the specified time Example: 2019- |
created_Query | String (date- | Return merge requests created on or before the specified time Example: 2019- |
updated_Query | String (date- | Return merge requests updated on or after the specified time Example: 2019- |
updated_Query | String (date- | Return merge requests updated on or before the specified time Example: 2019- |
merged_Query | String (date- | Return merge requests merged on or after the specified time Example: 2019- |
merged_Query | String (date- | Return merge requests merged on or before the specified time Example: 2019- |
viewQuery | String | If simple,iid,Allowed values: simple |
scopeQuery | String | Return merge requests for the given scope.reviews_ returns merge requests where the current user is assigned as a reviewer.allAllowed values: created-,assigned-,created_,assigned_,reviews_,all |
source_Query | String | Return merge requests with the given source branch |
source_Query | Integer | Return merge requests with the given source project ID |
target_Query | String | Return merge requests with the given target branch |
searchQuery | String | Search merge requests against their title and description.in attribute |
inQuery | String | Modify the scope of the search attribute to title,description,title,.title,Example: title, |
wipQuery | String | Filter merge requests by their wip status.yes returns only draft merge requests,no returns non-draft instead.draftAllowed values: yes,no |
draftQuery | Boolean | If true,false,wip |
notQuery | Object | Return merge requests that do not match the parameters supplied.labels,milestone,author_,author_,assignee_,assignee_,reviewer_,reviewer_,my_ |
not[author_Query | Integer | <Negated> Returns merge requests created by the given user id.scope=all or scope=assigned_.not[author_ |
not[author_Query | String | <Negated> Returns merge requests created by the given username.not[author_ |
not[assignee_Query | Integer or string | <Negated> Returns merge requests assigned to the given user id.None returns unassigned merge requests.Any returns merge requests with an assignee.not[assignee_ |
not[assignee_Query | Array of strings | <Negated> Returns merge requests assigned to the given usernames.not[assignee_ |
not[reviewer_Query | String | <Negated> Returns merge requests which have the user as a reviewer with the given username.not[reviewer_ |
not[labels]Query | Array of strings | <Negated> Returns merge requests matching a comma-None lists all merge requests with no labels.Any lists all merge requests with at least one label. |
not[milestone]Query | String | <Negated> Returns merge requests for a specific milestone.None returns merge requests with no milestone.Any returns merge requests that have an assigned milestone |
not[my_Query | String | <Negated> Returns merge requests reacted by the authenticated user by the given emoji.None returns issues not given a reaction.Any returns issues given at least one reaction |
not[reviewer_Query | Integer | <Negated> Returns merge requests which have the user as a reviewer with the given user id.not[reviewer_ |
deployed_Query | String (date- | Return merge requests deployed before the specified time Example: 2019- |
deployed_Query | String (date- | Return merge requests deployed after the specified time Example: 2019- |
environmentQuery | String | Return merge requests deployed to the given environment Example: production |
merge_Query | Integer | Returns merge requests which have been merged by the user with the given user id.merge_ |
merge_Query | String | Returns merge requests which have been merged by the user with the given username.merge_ |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
iidsQuery | Array of integers | Return merge requests matching the provided internal IDs |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
422 | Unprocessable entity | — |
Create a merge request
POST /api/v4/projects/{id}/merge_requests
Creates a merge request for a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
add_ | Array of strings | Comma- |
allow_ | Boolean | If true, |
allow_ | Boolean | If true,allow_ instead |
assignee_ | Integer | ID of the user to assign to the merge request.0 or leave empty to unassign all assignees |
assignee_ | Array of integers | IDs of the users to assign to the merge request,0 or leave empty to unassign all assignees |
description | String | Description of the merge request. |
labels | Array of strings | Comma- |
merge_ | String (date- | Date after which the merge request can be merged. |
milestone | String | The title of a project or ancestor-milestone_Maximum length: 255 |
milestone_ | Integer | Global ID of a milestone to assign to the merge request.0 or leave empty to unassign the milestone.milestone |
remove_ | Array of strings | Comma- |
remove_ | Boolean | If true, |
reviewer_ | Array of integers | IDs of the users to set as reviewers of the merge request,0 or left empty, |
source_Required | String | Source branch |
squash | Boolean | If true, |
target_Required | String | Target branch |
target_ | Integer | ID of the target project for the merge request. |
titleRequired | String | Title of the merge request |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
409 | Conflict | — |
422 | Unprocessable entity | — |
Retrieve a merge request
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}
Retrieves a merge request for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
render_Query | Boolean | If true, |
include_Query | Boolean | If true, |
include_Query | Boolean | If true, |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not found | — |
Update a merge request
PUT /api/v4/projects/{id}/merge_requests/{merge_request_iid}
Updates a merge request for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
add_ | Array of strings | Comma-assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
allow_ | Boolean | If true,assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
allow_ | Boolean | If true,allow_ instead.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
assignee_ | Integer | ID of the user to assign to the merge request.0 or leave empty to unassign all assignees.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
assignee_ | Array of integers | IDs of the users to assign to the merge request,0 or leave empty to unassign all assignees.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
description | String | Description of the merge request.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
discussion_ | Boolean | If true,assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
labels | Array of strings | Comma-assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
merge_ | String (date- | Date after which the merge request can be merged.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
milestone | String | The title of a project or ancestor-milestone_.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be providedMaximum length: 255 |
milestone_ | Integer | Global ID of a milestone to assign to the merge request.0 or leave empty to unassign the milestone.milestone.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
remove_ | Array of strings | Comma-assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
remove_ | Boolean | If true,assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
reviewer_ | Array of integers | IDs of the users to set as reviewers of the merge request,0 or left empty,assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
squash | Boolean | If true,assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
state_ | String | Event to change the state of the merge request.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be providedAllowed values: close,reopen |
target_ | String | Target branch.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
title | String | Title of the merge request.assignee_,assignee_,reviewer_,description,labels,add_,remove_,milestone_,milestone,remove_,allow_,allow_,squash,target_,title,state_,discussion_,merge_ must be provided |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
404 | Not found | — |
409 | Conflict | — |
422 | Unprocessable entity | — |
Delete a merge request
DELETE /api/v4/projects/{id}/merge_requests/{merge_request_iid}
Deletes a specified merge request for a project. Administrators and project Owners only.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
412 | Precondition failed | — |
Add spent time for a merge request
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/add_spent_time
Adds spent time for a specified merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | The internal ID of the merge_ |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
durationRequired | String | Duration in human-3h30m |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Cancel auto merge
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/cancel_auto_merge
Cancels an automatic merge for a merge request that has been set to merge automatically. If the merge request is on a merge train, it is also removed from the train. Use this endpoint instead of cancel_merge_when_pipeline_succeeds, which returns a status hash rather than the merge request. This feature was introduced in GitLab 19.5.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
409 | Conflict | — |
Cancel merge when pipeline succeeds (deprecated)
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/cancel_merge_when_pipeline_succeeds
Cancels an automatic merge for a merge request that has been set to merge when the pipeline succeeds. If the merge request is on a merge train, it is also removed from the train. This endpoint does not return the merge request. When the merge request is not set to auto-merge, the response has status error and an http_status field that is not the status code of the response. Deprecated in GitLab 19.5. Use POST /projects/:id/merge_requests/:merge_request_iid/cancel_auto_merge instead.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
201 | The status field of the response body is success when an auto- | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
405 | Method not allowed | — |
Retrieve merge request changes (deprecated)
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/changes
Retrieves changes for a specified merge request. The diffs have the same size limits as other diffs returned by the API or shown in the UI. When the limits affect the results, the overflow field is true. Deprecated in GitLab 15.7 and scheduled for removal in API v5. Use GET /projects/:id/merge_requests/:merge_request_iid/diffs instead.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
unidiffQuery | Boolean | If true,Default: false |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not found | — |
List all issues that close on merge
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/closes_issues
Lists all issues that close on merge.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Retrieve merge request commits
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/commits
Retrieves commits for a specified merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not found | — |
List all context commits for a merge request
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/context_commits
Lists all context commits for a specified merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not found | — |
Create context commits for a merge request
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/context_commits
Creates context commits for a specified merge request. This endpoint has a rate limit of 10 requests per minute for each user. Requests to delete context commits count toward the same limit. Exceeding the limit returns 429 Too Many Requests. The rate limit is behind a feature flag named rate_limit_context_commits_write, disabled by default.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
commitsRequired | Array of strings | Context commits’ SHAs |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | Array of APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
Delete context commits from a merge request
DELETE /api/v4/projects/{id}/merge_requests/{merge_request_iid}/context_commits
Deletes specified context commits from a merge request. This endpoint has a rate limit of 10 requests per minute for each user. Requests to create context commits count toward the same limit. Exceeding the limit returns 429 Too Many Requests. The rate limit is behind a feature flag named rate_limit_context_commits_write, disabled by default.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
commitsQuery, | Array of strings | Context commits’ SHAs |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
List all merge request diffs
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/diffs
Lists all merge request diffs. This endpoint is subject to merge request diff limits. Merge requests that exceed the diff limits return limited results.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
unidiffQuery | Boolean | If true,Default: false |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Merge a merge request
PUT /api/v4/projects/{id}/merge_requests/{merge_request_iid}/merge
Merges a merge request. Accepts and merges changes submitted with the merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auto_ | Boolean | If true, |
merge_ | String | Custom merge commit message |
merge_ | Boolean | If true,auto_ instead |
sha | String | SHA that must match the HEAD of the source branch, |
should_ | Boolean | If true, |
skip_ | Boolean | If true, |
squash | Boolean | If true, |
squash_ | String | Custom squash commit message |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
405 | Method not allowed | — |
409 | Conflict | — |
422 | Unprocessable entity | — |
Merge to default merge ref path
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/merge_ref
Merges the changes between the merge request source and target branches into the refs/merge-requests/:iid/merge ref, of the target project repository, if possible. This ref has the state the target branch would have if a regular merge action was taken. The ref is not always overwritten, but it is kept at the latest possible state.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad request | — |
404 | Not Found | — |
Retrieve merge request participants
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/participants
Retrieves participants for a specified merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not found | — |
List all merge request pipelines
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/pipelines
Lists all merge request pipelines.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not found | — |
Create a merge request pipeline
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/pipelines
Creates a merge request pipeline. Pipelines created with this operation must configure .gitlab-ci.yml with only: [merge_requests] to create jobs. The pipeline does not run a regular branch or tag pipeline. The new pipeline is a detached merge request pipeline, or a merged results pipeline if merged results pipelines are enabled for the project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
async | Boolean | If true,202 status code.202 responseDefault: false |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
404 | Not found | — |
405 | Method not allowed | — |
Retrieve merge request raw diffs
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/raw_diffs
Retrieves the raw diffs of the files changed in a merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Rebase a merge request
PUT /api/v4/projects/{id}/merge_requests/{merge_request_iid}/rebase
Rebases a merge request. Automatically rebases the source_branch of the merge request against its target_branch. The rebase runs asynchronously. To check its status, poll the retrieve merge request endpoint with include_rebase_in_progress set to true. While the rebase runs, rebase_in_progress is true. When it ends, rebase_in_progress is false, and merge_error holds the error if the rebase failed.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
skip_ | Boolean | If true, |
Responses
| Code | Description | Schema |
|---|---|---|
202 | Accepted | — |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
409 | Conflict | — |
429 | Too many requests | — |
List all issues related to the merge request
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/related_issues
Lists all issues related to the merge request. Related issues are the issues referenced in the title, description, commit messages, comments, and discussions of the merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Reset spent time for a merge request
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/reset_spent_time
Resets the total spent time for a specified merge request to 0 seconds.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | The internal ID of the merge_ |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Reset the estimated time for a merge request
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/reset_time_estimate
Resets the estimated time for a specified merge request to 0 seconds.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | The internal ID of the merge_ |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Retrieve merge request reviewers
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/reviewers
Retrieves reviewers for a specified merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | IID of a merge request Example: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not found | — |
Set the estimated time for a merge request
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/time_estimate
Sets an estimated time of work for a specified merge request.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | The internal ID of the merge_ |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
durationRequired | String | Duration in human-3h30mExample: 3h30m |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
Retrieve time tracking stats for a merge request
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/time_stats
Retrieves time tracking stats for a specified merge request, including time estimate and time spent in seconds and human-readable format (for example, 1h 30m).
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | The internal ID of the merge_ |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Retrieve merge request diff versions
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/versions
Retrieves merge request diff versions.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Retrieve a merge request diff version
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/versions/{version_id}
Retrieves a merge request diff version.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
merge_Path, | Integer | Internal ID of the merge request |
version_Path, | Integer | ID of the merge request diff version |
unidiffQuery | Boolean | If true,Default: false |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCiPipeline
| Property | Type | Description |
|---|---|---|
archived | Boolean | Example:false |
before_ | String | Example:a91957a858320c0e17f3 |
committed_ | String (date- | Example:2015- |
coverage | Number (float) | Example:98. |
created_ | String (date- | Example:2015- |
detailed_ | Detailed | — |
duration | Integer | Time spent running in seconds Example: 127 |
finished_ | String (date- | Example:2015- |
id | Integer (int64) | ID of the pipeline Example: 1 |
iid | Integer | Internal ID of the pipeline Example: 2 |
project_ | Integer (int64) | ID of the project of the pipeline Example: 3 |
queued_ | Integer | Time spent enqueued in seconds Example: 63 |
ref | String | Git reference of the pipeline Example: feature- |
sha | String | SHA of the commit the pipeline runs for Example: 0ec9e58fdfca6cdd6652 |
source | String | Source that triggered the pipeline Example: push |
started_ | String (date- | Example:2015- |
status | String | Status of the pipeline Example: success |
tag | Boolean | Example:false |
updated_ | String (date- | Example:2015- |
user | APIEntities | — |
web_ | String | URL of the pipeline in the Git Example: https: |
yaml_ | String | Example:widgets: |
APIEntitiesCiPipelineBasic
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Timestamp when the pipeline was created Example: 2022- |
id | Integer (int64) | ID of the pipeline Example: 1 |
iid | Integer | Internal ID of the pipeline Example: 2 |
project_ | Integer (int64) | ID of the project of the pipeline Example: 3 |
ref | String | Git reference of the pipeline Example: feature- |
sha | String | SHA of the commit the pipeline runs for Example: 0ec9e58fdfca6cdd6652 |
source | String | Source that triggered the pipeline Example: push |
status | String | Status of the pipeline Example: success |
updated_ | String (date- | Timestamp when the pipeline was last updated Example: 2022- |
web_ | String | URL of the pipeline in the Git Example: https: |
APIEntitiesCommit
| Property | Type | Description |
|---|---|---|
author_ | String | Email address of the commit author Example: john@example. |
author_ | String | Name of the commit author Example: John Smith |
authored_ | String (date- | Date and time when the commit was authored Example: 2012- |
committed_ | String (date- | Date and time when the commit was committed Example: 2012- |
committer_ | String | Email address of the committer Example: jack@example. |
committer_ | String | Name of the committer Example: Jack Smith |
created_ | String (date- | Date and time when the commit was created.committed_Example: 2017- |
extended_ | Object | Git trailers parsed from the commit message, Example: {"Signed- |
id | String | Full SHA of the commit Example: 2695effb5807a22ff3d1 |
message | String | Full commit message Example: Initial commit |
parent_ | Array of strings | SHAs of the parent commits Example: ["2a4b78934375d7f53875 |
short_ | String | Short SHA of the commit Example: 2695effb |
title | String | Title of the commit message Example: Initial commit |
trailers | Object | Git trailers parsed from the commit message. Example: {"Merged- |
web_ | String | URL to view the commit in the Git Example: https: |
APIEntitiesCommitWithLink
| Property | Type | Description |
|---|---|---|
author | APIEntities | — |
author_ | String | Email address of the commit author Example: john@example. |
author_ | String | Example:https: |
author_ | String | Name of the commit author Example: John Smith |
authored_ | String (date- | Date and time when the commit was authored Example: 2012- |
commit_ | String | Example:/ |
commit_ | String | Example:https: |
committed_ | String (date- | Date and time when the commit was committed Example: 2012- |
committer_ | String | Email address of the committer Example: jack@example. |
committer_ | String | Name of the committer Example: Jack Smith |
created_ | String (date- | Date and time when the commit was created.committed_Example: 2017- |
description_ | String | Example:<p>description</ |
extended_ | Object | Git trailers parsed from the commit message, Example: {"Signed- |
id | String | Full SHA of the commit Example: 2695effb5807a22ff3d1 |
message | String | Full commit message Example: Initial commit |
next_ | String | Example:2695effb5807a22ff3d1 |
parent_ | Array of strings | SHAs of the parent commits Example: ["2a4b78934375d7f53875 |
pipeline_ | String | Example:/ |
prev_ | String | Example:2695effb5807a22ff3d1 |
short_ | String | Short SHA of the commit Example: 2695effb |
signature_ | String | Example:<p>signature</ |
title | String | Title of the commit message Example: Initial commit |
title_ | String | Example:<p>title</ |
trailers | Object | Git trailers parsed from the commit message. Example: {"Merged- |
web_ | String | URL to view the commit in the Git Example: https: |
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesDiff
| Property | Type | Description |
|---|---|---|
a_ | String | Old file mode of the file Example: 100755 |
b_ | String | New file mode of the file Example: 100644 |
collapsed | Boolean | If true, |
deleted_ | Boolean | If true, |
diff | String | Diff of the changes made to the file Example: @@ - |
generated_ | Boolean | If true, |
new_ | Boolean | If true, |
new_ | String | New path of the file Example: doc/ |
old_ | String | Old path of the file Example: doc/ |
renamed_ | Boolean | If true, |
too_ | Boolean | If true, |
APIEntitiesDiffRefs
| Property | Type | Description |
|---|---|---|
base_ | String | SHA of the merge base commit where the source and target branches diverged Example: b83d6e391c22777fca1e |
head_ | String | SHA of the head commit of the source branch Example: b83d6e391c22777fca1e |
start_ | String | SHA of the target branch commit the diff starts from.base_Example: b83d6e391c22777fca1e |
APIEntitiesIssuableReferences
| Property | Type | Description |
|---|---|---|
full | String | Example:test&6 |
relative | String | Example:&6 |
short | String | Example:&6 |
APIEntitiesIssuableTimeStats
| Property | Type | Description |
|---|---|---|
human_ | String | Example:3h 30m |
human_ | String | Example:1h |
time_ | Integer | Example:12600 |
total_ | Integer | Example:3600 |
APIEntitiesIssueBasic
| Property | Type | Description |
|---|---|---|
assignee | APIEntities | — |
assignees | Array of APIEntities | — |
author | APIEntities | — |
closed_ | String (date- | Example:2022- |
closed_ | APIEntities | — |
confidential | Boolean | — |
created_ | String (date- | Example:2022- |
description | String | Example:Repellendus impedit et vel velit dignissimos. |
discussion_ | Boolean | — |
downvotes | Integer | — |
due_ | String (date) | Example:2022- |
id | Integer (int64) | Example:84 |
iid | Integer | Example:14 |
issue_ | String | Example:issue |
labels | Array of strings | Example:["bug"] |
merge_ | Integer | — |
milestone | APIEntities | — |
project_ | Integer (int64) | Example:4 |
start_ | String (date) | Example:2022- |
state | String | Example:closed |
task_ | APIEntities | — |
time_ | APIEntities | — |
title | String | Example:Impedit et ut et dolores vero provident ullam est |
type | String | The type of the issue Allowed values: ISSUE,INCIDENT,TEST_,REQUIREMENT,TASK,TICKETExample: ISSUE |
updated_ | String (date- | Example:2022- |
upvotes | Integer | — |
user_ | Integer | — |
web_ | String | Example:http: |
APIEntitiesMergeRequest
| Property | Type | Description |
|---|---|---|
allow_ | Boolean | If true, |
allow_ | Boolean | Returned only for merge requests from forks.allow_ instead |
assignee | APIEntities | First user assigned to the merge request.assignees instead |
assignees | Array of APIEntities | Users assigned to the merge request |
author | APIEntities | User who created the merge request |
blocking_ | Boolean | If true,true if the project does not require all threads to be resolved before merge |
changes_ | String | Number of changed files in the merge request,+,"1000+"Example: 1 |
closed_ | String (date- | Timestamp of when the merge request was closed Example: 2022- |
closed_ | APIEntities | User who closed the merge request.null if the merge request is not closed |
created_ | String (date- | Example:2022- |
description | String | Example:Repellendus impedit et vel velit dignissimos. |
description_ | String | Description of the merge request rendered as HTML.render_ is true |
detailed_ | String | Detailed merge status of the merge request.approvals_ (approvals are syncing),checking (Git is testing whether a valid merge is possible),ci_ (a CI/ci_ (a CI/commits_ (the source branch must exist and contain commits),conflict (conflicts exist between the source and target branches),discussions_ (all discussions must be resolved before merge),draft_ (the merge request is a draft),jira_ (the title or description must reference a Jira issue),locked_ (LFS files locked by other users must be unlocked before merge),locked_ (paths locked by other users must be unlocked before merging to the default branch),merge_ (blocked by another merge request),merge_ (cannot be merged until after the specified time),mergeable (the branch can merge cleanly into the target branch),need_ (the merge request must be rebased),not_ (approval is required before merge),not_ (the merge request must be open before merge),preparing (the merge request diff is being created),requested_ (reviewers have requested changes),security_ (when security policies are enforced,security_ (all security policies must be satisfied),status_ (all status checks must pass before merge),title_ (the title must match the regular expression set in the project settings),unchecked (Git has not yet tested whether a valid merge is possible)Example: mergeable |
diff_ | APIEntities | Base, |
discussion_ | Boolean | If true, |
diverged_ | Integer | Number of commits the source branch is behind the target branch.include_ is trueExample: 0 |
downvotes | Integer | Number of downvotes for the merge request |
draft | Boolean | If true, |
first_ | Boolean | If true, |
first_ | String (date- | Timestamp of when the first deployment to production finished Example: 2022- |
force_ | Boolean | If true, |
has_ | Boolean | If true,false unless merge_ is cannot_ |
head_ | APIEntities | Pipeline that runs on the HEAD commit of the source branch.pipeline, |
id | Integer (int64) | Example:84 |
iid | Integer | Example:14 |
imported | Boolean | If true, |
imported_ | String | Source of the import,bitbucketExample: bitbucket |
labels | Array of strings | Names of the labels assigned to the merge request,with_ is true,id,name,color,text_,description,description_ and archived instead |
latest_ | String (date- | Timestamp of when the latest build for the merge request finished Example: 2022- |
latest_ | String (date- | Timestamp of when the latest build for the merge request started Example: 2022- |
merge_ | String (date- | If set, Example: 2022- |
merge_ | String | SHA of the merge commit.null until the merge request is mergedExample: 1234abcd |
merge_ | String | Error message shown when a merge fails.detailed_ insteadExample: Merge error |
merge_ | String | Status of the merge request.unchecked,checking,can_,cannot_ or cannot_.has_.detailed_ insteadExample: unchecked |
merge_ | APIEntities | User who merged the merge request or set it to auto-null |
merge_ | Boolean | If true, |
merged_ | String (date- | Timestamp of when the merge request was merged Example: 2022- |
merged_ | APIEntities | User who merged the merge request or set it to auto-merge_ instead |
milestone | APIEntities | Milestone assigned to the merge request |
pipeline | APIEntities | Pipeline running on the branch HEAD of the merge request.head_ instead, |
prepared_ | String (date- | Timestamp of when the merge request was prepared. Example: 2022- |
project_ | Integer (int64) | Example:4 |
rebase_ | Boolean | If true,include_ is true |
reference | String | Internal reference of the merge request,references insteadExample: !1 |
references | APIEntities | Internal references of the merge request:short,relative and full.relative matches short.relative matches full |
reviewers | Array of APIEntities | Reviewers of the merge request |
sha | String | SHA of the head commit of the source branch Example: 1234abcd |
should_ | Boolean | If true, |
source_ | String | Name of the source branch |
source_ | Integer (int64) | ID of the source project.target_, |
squash | Boolean | If true,squash_ to take them into account |
squash_ | String | SHA of the squash commit. Example: 1234abcd |
squash_ | Boolean | If true, |
state | String | Example:closed |
subscribed | Boolean | If true, |
target_ | String | Name of the target branch |
target_ | Integer (int64) | ID of the target project |
task_ | APIEntities | Completion status of the task list:count and completed_ |
time_ | APIEntities | Time tracking statistics of the merge request:time_,total_,human_ and human_ |
title | String | Example:Impedit et ut et dolores vero provident ullam est |
title_ | String | Title of the merge request rendered as HTML.render_ is true |
updated_ | String (date- | Example:2022- |
upvotes | Integer | Number of upvotes for the merge request |
user | Object | Permissions of the current user for the merge request |
user. | Boolean | If true, |
user_ | Integer | Number of user comments on the merge request |
web_ | String | Web URL of the merge request Example: https: |
work_ | Boolean | If true,draft instead |
APIEntitiesMergeRequestAuthor
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | URL of the user’s avatar Example: https: |
bot | Boolean | If true,Example: false |
custom_ | Array of APIEntities | — |
id | Integer (int64) | ID of the user Example: 1 |
locked | Boolean | If true, |
name | String | Name of the user.**** if the current user cannot read the bot’s project or groupExample: Administrator |
public_ | String | Public email address of the user Example: john@example. |
state | String | State of the user account.active,blocked,ldap_,blocked_,banned,deactivatedExample: active |
username | String | Username of the user Example: admin |
web_ | String | URL of the user’s profile Example: https: |
APIEntitiesMergeRequestBasic
| Property | Type | Description |
|---|---|---|
allow_ | Boolean | If true, |
allow_ | Boolean | Returned only for merge requests from forks.allow_ instead |
assignee | APIEntities | First user assigned to the merge request.assignees instead |
assignees | Array of APIEntities | Users assigned to the merge request |
author | APIEntities | User who created the merge request |
blocking_ | Boolean | If true,true if the project does not require all threads to be resolved before merge |
closed_ | String (date- | Timestamp of when the merge request was closed Example: 2022- |
closed_ | APIEntities | User who closed the merge request.null if the merge request is not closed |
created_ | String (date- | Example:2022- |
description | String | Example:Repellendus impedit et vel velit dignissimos. |
description_ | String | Description of the merge request rendered as HTML.render_ is true |
detailed_ | String | Detailed merge status of the merge request.approvals_ (approvals are syncing),checking (Git is testing whether a valid merge is possible),ci_ (a CI/ci_ (a CI/commits_ (the source branch must exist and contain commits),conflict (conflicts exist between the source and target branches),discussions_ (all discussions must be resolved before merge),draft_ (the merge request is a draft),jira_ (the title or description must reference a Jira issue),locked_ (LFS files locked by other users must be unlocked before merge),locked_ (paths locked by other users must be unlocked before merging to the default branch),merge_ (blocked by another merge request),merge_ (cannot be merged until after the specified time),mergeable (the branch can merge cleanly into the target branch),need_ (the merge request must be rebased),not_ (approval is required before merge),not_ (the merge request must be open before merge),preparing (the merge request diff is being created),requested_ (reviewers have requested changes),security_ (when security policies are enforced,security_ (all security policies must be satisfied),status_ (all status checks must pass before merge),title_ (the title must match the regular expression set in the project settings),unchecked (Git has not yet tested whether a valid merge is possible)Example: mergeable |
discussion_ | Boolean | If true, |
downvotes | Integer | Number of downvotes for the merge request |
draft | Boolean | If true, |
force_ | Boolean | If true, |
has_ | Boolean | If true,false unless merge_ is cannot_ |
id | Integer (int64) | Example:84 |
iid | Integer | Example:14 |
imported | Boolean | If true, |
imported_ | String | Source of the import,bitbucketExample: bitbucket |
labels | Array of strings | Names of the labels assigned to the merge request,with_ is true,id,name,color,text_,description,description_ and archived instead |
merge_ | String (date- | If set, Example: 2022- |
merge_ | String | SHA of the merge commit.null until the merge request is mergedExample: 1234abcd |
merge_ | String | Status of the merge request.unchecked,checking,can_,cannot_ or cannot_.has_.detailed_ insteadExample: unchecked |
merge_ | APIEntities | User who merged the merge request or set it to auto-null |
merge_ | Boolean | If true, |
merged_ | String (date- | Timestamp of when the merge request was merged Example: 2022- |
merged_ | APIEntities | User who merged the merge request or set it to auto-merge_ instead |
milestone | APIEntities | Milestone assigned to the merge request |
prepared_ | String (date- | Timestamp of when the merge request was prepared. Example: 2022- |
project_ | Integer (int64) | Example:4 |
reference | String | Internal reference of the merge request,references insteadExample: !1 |
references | APIEntities | Internal references of the merge request:short,relative and full.relative matches short.relative matches full |
reviewers | Array of APIEntities | Reviewers of the merge request |
sha | String | SHA of the head commit of the source branch Example: 1234abcd |
should_ | Boolean | If true, |
source_ | String | Name of the source branch |
source_ | Integer (int64) | ID of the source project.target_, |
squash | Boolean | If true,squash_ to take them into account |
squash_ | String | SHA of the squash commit. Example: 1234abcd |
squash_ | Boolean | If true, |
state | String | Example:closed |
target_ | String | Name of the target branch |
target_ | Integer (int64) | ID of the target project |
task_ | APIEntities | Completion status of the task list:count and completed_ |
time_ | APIEntities | Time tracking statistics of the merge request:time_,total_,human_ and human_ |
title | String | Example:Impedit et ut et dolores vero provident ullam est |
title_ | String | Title of the merge request rendered as HTML.render_ is true |
updated_ | String (date- | Example:2022- |
upvotes | Integer | Number of upvotes for the merge request |
user_ | Integer | Number of user comments on the merge request |
web_ | String | Web URL of the merge request Example: https: |
work_ | Boolean | If true,draft instead |
APIEntitiesMergeRequestChanges
| Property | Type | Description |
|---|---|---|
allow_ | Boolean | If true, |
allow_ | Boolean | Returned only for merge requests from forks.allow_ instead |
assignee | APIEntities | First user assigned to the merge request.assignees instead |
assignees | Array of APIEntities | Users assigned to the merge request |
author | APIEntities | User who created the merge request |
blocking_ | Boolean | If true,true if the project does not require all threads to be resolved before merge |
changes | Array of APIEntities | — |
changes_ | String | Number of changed files in the merge request,+,"1000+"Example: 1 |
closed_ | String (date- | Timestamp of when the merge request was closed Example: 2022- |
closed_ | APIEntities | User who closed the merge request.null if the merge request is not closed |
created_ | String (date- | Example:2022- |
description | String | Example:Repellendus impedit et vel velit dignissimos. |
description_ | String | Description of the merge request rendered as HTML.render_ is true |
detailed_ | String | Detailed merge status of the merge request.approvals_ (approvals are syncing),checking (Git is testing whether a valid merge is possible),ci_ (a CI/ci_ (a CI/commits_ (the source branch must exist and contain commits),conflict (conflicts exist between the source and target branches),discussions_ (all discussions must be resolved before merge),draft_ (the merge request is a draft),jira_ (the title or description must reference a Jira issue),locked_ (LFS files locked by other users must be unlocked before merge),locked_ (paths locked by other users must be unlocked before merging to the default branch),merge_ (blocked by another merge request),merge_ (cannot be merged until after the specified time),mergeable (the branch can merge cleanly into the target branch),need_ (the merge request must be rebased),not_ (approval is required before merge),not_ (the merge request must be open before merge),preparing (the merge request diff is being created),requested_ (reviewers have requested changes),security_ (when security policies are enforced,security_ (all security policies must be satisfied),status_ (all status checks must pass before merge),title_ (the title must match the regular expression set in the project settings),unchecked (Git has not yet tested whether a valid merge is possible)Example: mergeable |
diff_ | APIEntities | Base, |
discussion_ | Boolean | If true, |
diverged_ | Integer | Number of commits the source branch is behind the target branch.include_ is trueExample: 0 |
downvotes | Integer | Number of downvotes for the merge request |
draft | Boolean | If true, |
first_ | Boolean | If true, |
first_ | String (date- | Timestamp of when the first deployment to production finished Example: 2022- |
force_ | Boolean | If true, |
has_ | Boolean | If true,false unless merge_ is cannot_ |
head_ | APIEntities | Pipeline that runs on the HEAD commit of the source branch.pipeline, |
id | Integer (int64) | Example:84 |
iid | Integer | Example:14 |
imported | Boolean | If true, |
imported_ | String | Source of the import,bitbucketExample: bitbucket |
labels | Array of strings | Names of the labels assigned to the merge request,with_ is true,id,name,color,text_,description,description_ and archived instead |
latest_ | String (date- | Timestamp of when the latest build for the merge request finished Example: 2022- |
latest_ | String (date- | Timestamp of when the latest build for the merge request started Example: 2022- |
merge_ | String (date- | If set, Example: 2022- |
merge_ | String | SHA of the merge commit.null until the merge request is mergedExample: 1234abcd |
merge_ | String | Error message shown when a merge fails.detailed_ insteadExample: Merge error |
merge_ | String | Status of the merge request.unchecked,checking,can_,cannot_ or cannot_.has_.detailed_ insteadExample: unchecked |
merge_ | APIEntities | User who merged the merge request or set it to auto-null |
merge_ | Boolean | If true, |
merged_ | String (date- | Timestamp of when the merge request was merged Example: 2022- |
merged_ | APIEntities | User who merged the merge request or set it to auto-merge_ instead |
milestone | APIEntities | Milestone assigned to the merge request |
overflow | Boolean | — |
pipeline | APIEntities | Pipeline running on the branch HEAD of the merge request.head_ instead, |
prepared_ | String (date- | Timestamp of when the merge request was prepared. Example: 2022- |
project_ | Integer (int64) | Example:4 |
rebase_ | Boolean | If true,include_ is true |
reference | String | Internal reference of the merge request,references insteadExample: !1 |
references | APIEntities | Internal references of the merge request:short,relative and full.relative matches short.relative matches full |
reviewers | Array of APIEntities | Reviewers of the merge request |
sha | String | SHA of the head commit of the source branch Example: 1234abcd |
should_ | Boolean | If true, |
source_ | String | Name of the source branch |
source_ | Integer (int64) | ID of the source project.target_, |
squash | Boolean | If true,squash_ to take them into account |
squash_ | String | SHA of the squash commit. Example: 1234abcd |
squash_ | Boolean | If true, |
state | String | Example:closed |
subscribed | Boolean | If true, |
target_ | String | Name of the target branch |
target_ | Integer (int64) | ID of the target project |
task_ | APIEntities | Completion status of the task list:count and completed_ |
time_ | APIEntities | Time tracking statistics of the merge request:time_,total_,human_ and human_ |
title | String | Example:Impedit et ut et dolores vero provident ullam est |
title_ | String | Title of the merge request rendered as HTML.render_ is true |
updated_ | String (date- | Example:2022- |
upvotes | Integer | Number of upvotes for the merge request |
user | Object | Permissions of the current user for the merge request |
user. | Boolean | If true, |
user_ | Integer | Number of user comments on the merge request |
web_ | String | Web URL of the merge request Example: https: |
work_ | Boolean | If true,draft instead |
APIEntitiesMergeRequestDiff
| Property | Type | Description |
|---|---|---|
base_ | String | SHA of the merge- Example: 1234abcd |
created_ | String (date- | Timestamp of when the diff version was created Example: 2022- |
head_ | String | SHA of the head commit of the source branch Example: 1234abcd |
id | Integer (int64) | ID of the merge request diff version Example: 1 |
merge_ | Integer (int64) | ID of the merge request Example: 1 |
patch_ | String | Patch ID of the diff version,git patch-Example: 1234abcd |
real_ | String | Number of changes in the diff version Example: 1 |
start_ | String | SHA of the head commit of the target branch when this diff version was created Example: 1234abcd |
state | String | State of the merge request diff.empty,collected,overflow or without_.timeout,overflow_,overflow_ and overflow_Example: collected |
APIEntitiesMergeRequestDiffFull
| Property | Type | Description |
|---|---|---|
base_ | String | SHA of the merge- Example: 1234abcd |
commits | Array of APIEntities | Commits in the diff version |
created_ | String (date- | Timestamp of when the diff version was created Example: 2022- |
diffs | Array of APIEntities | Diffs in the diff version |
head_ | String | SHA of the head commit of the source branch Example: 1234abcd |
id | Integer (int64) | ID of the merge request diff version Example: 1 |
merge_ | Integer (int64) | ID of the merge request Example: 1 |
patch_ | String | Patch ID of the diff version,git patch-Example: 1234abcd |
real_ | String | Number of changes in the diff version Example: 1 |
start_ | String | SHA of the head commit of the target branch when this diff version was created Example: 1234abcd |
state | String | State of the merge request diff.empty,collected,overflow or without_.timeout,overflow_,overflow_ and overflow_Example: collected |
APIEntitiesMergeRequestReviewer
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2022- |
state | String | Example:unreviewed |
user | APIEntities | — |
APIEntitiesMilestone
| Property | Type | Description |
|---|---|---|
created_ | String | — |
description | String | — |
due_ | String | — |
expired | Boolean | — |
group_ | String | — |
id | Integer (int64) | — |
iid | Integer (int64) | — |
project_ | Integer (int64) | — |
start_ | String | — |
state | String | — |
title | String | — |
updated_ | String | — |
web_ | String | — |
APIEntitiesTaskCompletionStatus
| Property | Type | Description |
|---|---|---|
completed_ | Integer | Example:3 |
count | Integer | Example:5 |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | URL of the user’s avatar Example: https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | ID of the user Example: 1 |
locked | Boolean | If true, |
name | String | Name of the user.**** if the current user cannot read the bot’s project or groupExample: Administrator |
public_ | String | Public email address of the user Example: john@example. |
state | String | State of the user account.active,blocked,ldap_,blocked_,banned,deactivatedExample: active |
username | String | Username of the user Example: admin |
web_ | String | URL of the user’s profile Example: https: |
APIEntitiesUserPath
| Property | Type | Description |
|---|---|---|
availability | String | — |
avatar_ | String | Example:/ |
avatar_ | String | URL of the user’s avatar Example: https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | ID of the user Example: 1 |
locked | Boolean | If true, |
name | String | Name of the user.**** if the current user cannot read the bot’s project or groupExample: Administrator |
path | String | Example:/ |
public_ | String | Public email address of the user Example: john@example. |
show_ | String | — |
state | String | State of the user account.active,blocked,ldap_,blocked_,banned,deactivatedExample: active |
status_ | String | — |
username | String | Username of the user Example: admin |
web_ | String | URL of the user’s profile Example: https: |
DetailedStatusEntity
| Property | Type | Description |
|---|---|---|
action | Object | — |
action. | String | Example:Cancel this job |
action. | String | Example:Are you sure? |
action. | String | Example:cancel |
action. | String | Example:post |
action. | String | Example:/ |
action. | String | Example:Cancel |
details_ | String | Example:/ |
favicon | String | Example:/ |
group | String | Example:success |
has_ | Boolean | Example:true |
icon | String | Example:status_ |
illustration | Object | Example:{"content": |
label | String | Example:passed |
text | String | Example:passed |
tooltip | String | Example:passed |