merge_requests

List all group merge requests

Lists all merge requests for a specified group and any subgroups.

get/api/v4/groups/{id}/merge_requests

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the group owned by the authenticated user.

Query parameters

author_idinteger

Returns merge requests created by the given user id. Mutually exclusive with author_username. Combine with scope=all or scope=assigned_to_me.

author_usernamestring

Returns merge requests created by the given username. Mutually exclusive with author_id.

assignee_idinteger

Returns merge requests assigned to the given user id. None returns unassigned merge requests. Any returns merge requests with an assignee.

assignee_usernamestring[]

Returns merge requests created by the given username. Mutually exclusive with author_id.

reviewer_usernamestring

Returns merge requests which have the user as a reviewer with the given username. None returns merge requests with no reviewers. Any returns merge requests with any reviewer. Mutually exclusive with reviewer_id. Introduced in GitLab 13.8.

labelsstring[]

Returns merge requests matching a comma-separated list of labels. None lists all merge requests with no labels. Any lists all merge requests with at least one label. Predefined names are case-insensitive.

milestonestring

Returns merge requests for a specific milestone. None returns merge requests with no milestone. Any returns merge requests that have an assigned milestone.

my_reaction_emojistring

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_idinteger

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. Mutually exclusive with reviewer_username.

state'opened' | 'closed' | 'locked' | 'merged' | 'all'

Returns all merge requests or just those that are opened, closed, locked, or merged.

order_by'created_at' | 'label_priority' | 'milestone_due' | 'popularity' | 'priority' | 'title' | 'updated_at' | 'merged_at'

Returns merge requests ordered by created_at, label_priority, milestone_due, popularity, priority, title, updated_at or merged_at fields. Introduced in GitLab 14.8.

sort'asc' | 'desc'

Returns merge requests sorted in asc or desc order.

with_labels_detailsboolean

If true, response returns more details for each label in labels field: :name,:color, :description, :description_html, :text_color

with_merge_status_recheckboolean

If true, this projection requests (but does not guarantee) that the merge_status field be recalculated asynchronously. Introduced in GitLab 13.0.

created_afterstring date-time

Returns merge requests created on or after the given time. Expected in ISO 8601 format.

created_beforestring date-time

Returns merge requests created on or before the given time. Expected in ISO 8601 format.

updated_afterstring date-time

Returns merge requests updated on or after the given time. Expected in ISO 8601 format.

updated_beforestring date-time

Returns merge requests updated on or before the given time. Expected in ISO 8601 format.

merged_afterstring date-time

Returns merge requests merged on or after the given time. Expected in ISO 8601 format.

merged_beforestring date-time

Returns merge requests merged on or before the given time. Expected in ISO 8601 format.

view'simple'

If simple, returns the iid, URL, title, description, and basic state of merge request

scope'created-by-me' | 'assigned-to-me' | 'created_by_me' | 'assigned_to_me' | 'reviews_for_me' | 'all'

Returns merge requests for the given scope: created_by_me, assigned_to_me, reviews_for_me or all

source_branchstring

Returns merge requests with the given source branch

source_project_idinteger

Returns merge requests with the given source project id

target_branchstring

Returns merge requests with the given target branch

searchstring

Search merge requests against their title and description.

instring

Modify the scope of the search attribute. title, description, or a string joining them with comma.

wip'yes' | 'no'

Deprecated. Use draft instead. Filter merge requests against their wip status. yes to return only draft merge requests, no to return non-draft merge requests.

draftboolean

Filter merge requests against their draft status. true to return only draft merge requests, false to return non-draft merge requests.

not[author_id]integer

<Negated> Returns merge requests created by the given user id. Mutually exclusive with author_username. Combine with scope=all or scope=assigned_to_me.

not[author_username]string

<Negated> Returns merge requests created by the given username. Mutually exclusive with author_id.

not[assignee_id]integer

<Negated> Returns merge requests assigned to the given user id. None returns unassigned merge requests. Any returns merge requests with an assignee.

not[assignee_username]string[]

<Negated> Returns merge requests created by the given username. Mutually exclusive with author_id.

not[reviewer_username]string

<Negated> Returns merge requests which have the user as a reviewer with the given username. None returns merge requests with no reviewers. Any returns merge requests with any reviewer. Mutually exclusive with reviewer_id. Introduced in GitLab 13.8.

not[labels]string[]

<Negated> Returns merge requests matching a comma-separated list of labels. None lists all merge requests with no labels. Any lists all merge requests with at least one label. Predefined names are case-insensitive.

not[milestone]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_reaction_emoji]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_id]integer

<Negated> 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. Mutually exclusive with reviewer_username.

deployed_beforestring

Returns merge requests deployed before the given date/time. Expected in ISO 8601 format.

deployed_afterstring

Returns merge requests deployed after the given date/time. Expected in ISO 8601 format

environmentstring

Returns merge requests deployed to the given environment

merge_user_idinteger

Returns merge requests which have been merged by the user with the given user id. Mutually exclusive with merge_user_username.

merge_user_usernamestring

Returns merge requests which have been merged by the user with the given username. Mutually exclusive with merge_user_id.

approver_idsstring

Return merge requests which have specified the users with the given IDs as an individual approver

approved_by_idsstring

Return merge requests which have been approved by the specified users with the given IDs

approved_by_usernamesstring

Return merge requests which have been approved by the specified users with the given usernames

pageinteger

Current page number

per_pageinteger

Number of items per page

non_archivedboolean

Returns merge requests from non archived projects only.

Response

List all group merge requests

idinteger required
iidinteger required
project_idinteger required
titlestring required
descriptionstring required
statestring required
created_atstring date-time required
updated_atstring date-time required
merged_atstring date-time required
closed_atstring date-time required
title_htmlstring
description_htmlstring
target_branchstring required
source_branchstring required
user_notes_countinteger required
upvotesinteger required
downvotesinteger required
source_project_idinteger required
target_project_idinteger required
labelsstring[] required
draftboolean required
importedboolean required
imported_fromstring required
work_in_progressboolean required
merge_when_pipeline_succeedsboolean required
merge_statusstring required
detailed_merge_statusstring required
merge_afterstring date-time required
shastring required
merge_commit_shastring required
squash_commit_shastring required
discussion_lockedboolean required
should_remove_source_branchboolean required
force_remove_source_branchboolean required
prepared_atstring date-time required
allow_collaborationboolean
allow_maintainer_to_pushboolean
referencestring required
web_urlstring required
squashboolean required
squash_on_mergeboolean required
has_conflictsboolean required
blocking_discussions_resolvedboolean required
approvals_before_mergeinteger required

Example response

[
  {
    "id": 84,
    "iid": 14,
    "project_id": 4,
    "title": "Impedit et ut et dolores vero provident ullam est",
    "description": "Repellendus impedit et vel velit dignissimos.",
    "state": "closed",
    "created_at": "2022-08-17T12:46:35.053Z",
    "updated_at": "2022-11-14T17:22:01.470Z",
    "merged_by": {
      "id": 1,
      "username": "admin",
      "public_email": "john@example.com",
      "name": "Administrator",
      "state": "active",
      "avatar_url": "https://gravatar.com/avatar/1",
      "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
      "custom_attributes": [
        {
          "key": "foo",
          "value": "bar"
        }
      ],
      "web_url": "https://gitlab.example.com/root"
    },
    "merge_user": {
      "id": 1,
      "username": "admin",
      "public_email": "john@example.com",
      "name": "Administrator",
      "state": "active",
      "avatar_url": "https://gravatar.com/avatar/1",
      "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
      "custom_attributes": [
        {
          "key": "foo",
          "value": "bar"
        }
      ],
      "web_url": "https://gitlab.example.com/root"
    },
    "merged_at": "2022-01-31T15:10:45.080Z",
    "closed_by": {
      "id": 1,
      "username": "admin",
      "public_email": "john@example.com",
      "name": "Administrator",
      "state": "active",
      "avatar_url": "https://gravatar.com/avatar/1",
      "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
      "custom_attributes": [
        {
          "key": "foo",
          "value": "bar"
        }
      ],
      "web_url": "https://gitlab.example.com/root"
    },
    "closed_at": "2022-01-31T15:10:45.080Z",
    "author": {
      "id": 1,
      "username": "admin",
      "public_email": "john@example.com",
      "name": "Administrator",
      "state": "active",
      "avatar_url": "https://gravatar.com/avatar/1",
      "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
      "custom_attributes": [
        {
          "key": "foo",
          "value": "bar"
        }
      ],
      "web_url": "https://gitlab.example.com/root"
    },
    "assignees": {
      "id": 1,
      "username": "admin",
      "public_email": "john@example.com",
      "name": "Administrator",
      "state": "active",
      "avatar_url": "https://gravatar.com/avatar/1",
      "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
      "custom_attributes": [
        {
          "key": "foo",
          "value": "bar"
        }
      ],
      "web_url": "https://gitlab.example.com/root"
    },
    "assignee": {
      "id": 1,
      "username": "admin",
      "public_email": "john@example.com",
      "name": "Administrator",
      "state": "active",
      "avatar_url": "https://gravatar.com/avatar/1",
      "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
      "custom_attributes": [
        {
          "key": "foo",
          "value": "bar"
        }
      ],
      "web_url": "https://gitlab.example.com/root"
    },
    "reviewers": {
      "id": 1,
      "username": "admin",
      "public_email": "john@example.com",
      "name": "Administrator",
      "state": "active",
      "avatar_url": "https://gravatar.com/avatar/1",
      "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
      "custom_attributes": [
        {
          "key": "foo",
          "value": "bar"
        }
      ],
      "web_url": "https://gitlab.example.com/root"
    },
    "imported_from": "bitbucket",
    "merge_status": "unchecked",
    "detailed_merge_status": "mergeable",
    "merge_after": "2022-01-31T15:10:45.080Z",
    "sha": "1234abcd",
    "merge_commit_sha": "1234abcd",
    "squash_commit_sha": "1234abcd",
    "prepared_at": "2022-01-31T15:10:45.080Z",
    "reference": "!1",
    "references": {
      "short": "&6",
      "relative": "&6",
      "full": "test&6"
    },
    "web_url": "https://gitlab.example.com/my-group/my-project/-/merge_requests/1",
    "time_stats": {
      "time_estimate": 12600,
      "total_time_spent": 3600,
      "human_time_estimate": "3h 30m",
      "human_total_time_spent": "1h"
    },
    "task_completion_status": {
      "count": 5,
      "completed_count": 3
    },
    "approvals_before_merge": 2
  }
]

Changes

No recorded changes to this operation across all 5 revisions of this API.