Skip to main content

List Project Merge Requests

List project merge requests.

External Documentation

To learn more, visit the GitLab documentation.

Basic Parameters

ParameterDescription
IIDsA comma-separated list of the merge requests IIDs to return.An IID is a unique ID only in scope of a single project. When you browse issues or merge requests with the web UI, you see the IID.For more information about the differences between IID and ID, visit the GitLab API Documentation page.
Project IDThe ID or path of the project owned by the authenticated user. If the path is being used, it should be url encoded - for example: user%2my-project .
StateReturn all merge requests or just those that are opened, closed, locked, or merged.

Advanced Parameters

ParameterDescription
Assignee IDReturns merge requests assigned to the given user ID. None returns unassigned merge requests.Any returns merge requests with an assignee.
Created AfterReturn merge requests created on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z).
Created BeforeReturn merge requests created on, or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z).
Order ByReturn requests ordered by created_at or updated_at fields. Default is created_at.
SearchSearch merge requests against their title and description.
SortReturn requests sorted in asc or desc order. Default is desc.
Source BranchReturn merge requests with the given source branch.
Target BranchReturn merge requests with the given target branch.
Updated AfterReturn merge requests updated on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z).
Updated BeforeReturn merge requests updated on or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z).

Example Output

[
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "fixed login page css paddings",
"state": "merged",
"merged_by": { // Deprecated and will be removed in API v5, use `merge_user` instead
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "master",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"id": 2,
"name": "Sam Bauch",
"username": "kenyatta_oconnell",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/956c92487c6f6f7616b536927e22c9a0?s=80&d=identicon",
"web_url": "http://gitlab.example.com//kenyatta_oconnell"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"Community contribution",
"Manage"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"task_completion_status":{
"count":0,
"completed_count":0
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
]

Workflow Library Example

List Project Merge Requests with Gitlab and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop