Use this API to manage milestones for both projects and groups.

List all group milestones

GET /api/v4/groups/{id}/milestones

Lists all group milestones for a specified group.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the group
state
Query
StringReturn “active”, “closed”, or “all” milestones
Allowed values: active, closed, all
Default: all
iids
Query
Array of integersReturn only the milestones having the given iid. Ignored if include_ancestors is true
title
Query
StringThe title of the milestones
search
Query
StringThe search criteria for the title or description of the milestone
search_title
Query
StringThe search criteria for the title of the milestone
include_parent_milestones
Query
BooleanIf true, includes milestones from all parent groups. Deprecated. Use include_ancestors instead. Mutually exclusive with include_ancestors
include_ancestors
Query
BooleanInclude milestones from all parent groups. Mutually exclusive with include_parent_milestones
updated_before
Query
String (date-time)Return milestones updated before the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
updated_after
Query
String (date-time)Return milestones updated after the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
containing_date
Query
String (date-time)Return milestones where start_date <= containing_date <= due_date. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
start_date
Query
String (date-time)Return milestones where due_date >= start_date. Requires end_date. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
end_date
Query
String (date-time)Return milestones where start_date <= end_date. Requires start_date. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
sort
Query
StringReturn milestones sorted in the given order
Allowed values: due_date_asc, due_date_desc, start_date_asc, start_date_desc, name_asc, name_desc, created_asc, created_desc, updated_asc, updated_desc
Default: due_date_asc
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
include_descendants
Query
BooleanIf true, includes milestones for the group and its descendants

Responses

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

Create a group milestone

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

Creates a milestone for the specified group.

Parameters

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

Request body (application/json)

PropertyTypeDescription
descriptionStringThe description of the milestone
due_dateStringDue date of the milestone, in ISO 8601 format (YYYY-MM-DD)
start_dateStringStart date of the milestone, in ISO 8601 format (YYYY-MM-DD)
title
Required
StringThe title of the milestone

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesMilestone
400Bad Request—
404Not Found—

Retrieve a group milestone

GET /api/v4/groups/{id}/milestones/{milestone_id}

Retrieves a specified group milestone.

Parameters

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

Responses

CodeDescriptionSchema
200OKAPIEntitiesMilestone
400Bad Request—
404Not Found—

Update a group milestone

PUT /api/v4/groups/{id}/milestones/{milestone_id}

Updates the specified group milestone.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the group
milestone_id
Path, required
IntegerThe milestone ID number

Request body (application/json)

PropertyTypeDescription
descriptionStringThe description of the milestone. At least one of title, description, start_date, due_date, state_event must be provided
due_dateStringDue date of the milestone, in ISO 8601 format (YYYY-MM-DD). At least one of title, description, start_date, due_date, state_event must be provided
start_dateStringStart date of the milestone, in ISO 8601 format (YYYY-MM-DD). At least one of title, description, start_date, due_date, state_event must be provided
state_eventStringState event of the milestone. At least one of title, description, start_date, due_date, state_event must be provided
Allowed values: close, activate
titleStringThe title of the milestone. At least one of title, description, start_date, due_date, state_event must be provided

Responses

CodeDescriptionSchema
200OKAPIEntitiesMilestone
400Bad Request—
404Not Found—

Delete a group milestone

DELETE /api/v4/groups/{id}/milestones/{milestone_id}

Deletes the specified group milestone.

Parameters

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

Responses

CodeDescriptionSchema
204204 No Content—
400Bad Request—
404Not Found—

List all issues assigned to a single milestone

GET /api/v4/groups/{id}/milestones/{milestone_id}/issues

Lists all issues assigned to a specified group milestone.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the group
milestone_id
Path, required
IntegerID of the group milestone
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

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

List all merge requests assigned to a single milestone

GET /api/v4/groups/{id}/milestones/{milestone_id}/merge_requests

Lists all merge requests assigned to a specified group milestone.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the group
milestone_id
Path, required
IntegerID of the group milestone
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

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

List all project milestones

GET /api/v4/projects/{id}/milestones

Lists all milestones for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
state
Query
StringReturn “active”, “closed”, or “all” milestones
Allowed values: active, closed, all
Default: all
iids
Query
Array of integersReturn only the milestones having the given iid. Ignored if include_ancestors is true
title
Query
StringThe title of the milestones
search
Query
StringThe search criteria for the title or description of the milestone
search_title
Query
StringThe search criteria for the title of the milestone
include_parent_milestones
Query
BooleanIf true, includes milestones from all parent groups. Deprecated. Use include_ancestors instead. Mutually exclusive with include_ancestors
include_ancestors
Query
BooleanInclude milestones from all parent groups. Mutually exclusive with include_parent_milestones
updated_before
Query
String (date-time)Return milestones updated before the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
updated_after
Query
String (date-time)Return milestones updated after the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
containing_date
Query
String (date-time)Return milestones where start_date <= containing_date <= due_date. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
start_date
Query
String (date-time)Return milestones where due_date >= start_date. Requires end_date. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
end_date
Query
String (date-time)Return milestones where start_date <= end_date. Requires start_date. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
sort
Query
StringReturn milestones sorted in the given order
Allowed values: due_date_asc, due_date_desc, start_date_asc, start_date_desc, name_asc, name_desc, created_asc, created_desc, updated_asc, updated_desc
Default: due_date_asc
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

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

Create a project milestone

POST /api/v4/projects/{id}/milestones

Creates a project milestone.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
descriptionStringThe description of the milestone
due_dateStringDue date of the milestone, in ISO 8601 format (YYYY-MM-DD)
start_dateStringStart date of the milestone, in ISO 8601 format (YYYY-MM-DD)
title
Required
StringThe title of the milestone

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesMilestone
400Bad Request—
404Not Found—

Retrieve a project milestone

GET /api/v4/projects/{id}/milestones/{milestone_id}

Retrieves a specified project milestone.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
milestone_id
Path, required
IntegerID of the project milestone

Responses

CodeDescriptionSchema
200OKAPIEntitiesMilestone
400Bad Request—
404Not Found—

Update a project milestone

PUT /api/v4/projects/{id}/milestones/{milestone_id}

Updates a specified project milestone.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
milestone_id
Path, required
IntegerThe milestone ID number

Request body (application/json)

PropertyTypeDescription
descriptionStringThe description of the milestone. At least one of title, description, start_date, due_date, state_event must be provided
due_dateStringDue date of the milestone, in ISO 8601 format (YYYY-MM-DD). At least one of title, description, start_date, due_date, state_event must be provided
start_dateStringStart date of the milestone, in ISO 8601 format (YYYY-MM-DD). At least one of title, description, start_date, due_date, state_event must be provided
state_eventStringState event of the milestone. At least one of title, description, start_date, due_date, state_event must be provided
Allowed values: close, activate
titleStringThe title of the milestone. At least one of title, description, start_date, due_date, state_event must be provided

Responses

CodeDescriptionSchema
200OKAPIEntitiesMilestone
400Bad Request—
404Not Found—

Delete a project milestone

DELETE /api/v4/projects/{id}/milestones/{milestone_id}

Deletes a specified project milestone. Only for users with the Planner, Reporter, Developer, Maintainer, or Owner role for the project.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
milestone_id
Path, required
IntegerID of the project milestone

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

List all issues for a project milestone

GET /api/v4/projects/{id}/milestones/{milestone_id}/issues

Lists all issues assigned to a specified project milestone.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
milestone_id
Path, required
IntegerID of the project milestone
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

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

List all merge requests for a project milestone

GET /api/v4/projects/{id}/milestones/{milestone_id}/merge_requests

Lists all merge requests assigned to a specified project milestone.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
milestone_id
Path, required
IntegerID of the project milestone
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

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

Promote a project milestone to a group milestone

POST /api/v4/projects/{id}/milestones/{milestone_id}/promote

Promotes a specified project milestone to a group milestone. Only for users with the Planner, Reporter, Developer, Maintainer, or Owner role for the group.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
milestone_id
Path, required
IntegerID of the project milestone

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Schemas

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

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesIssuableReferences

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

APIEntitiesIssuableTimeStats

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

APIEntitiesIssueBasic

PropertyTypeDescription
assigneeAPIEntitiesUserBasic—
assigneesArray of APIEntitiesUserBasic—
authorAPIEntitiesUserBasic—
closed_atString (date-time)Example: 2022-11-15T08:30:55.232Z
closed_byAPIEntitiesUserBasic—
confidentialBoolean—
created_atString (date-time)Example: 2022-08-17T12:46:35.053Z
descriptionStringExample: Repellendus impedit et vel velit dignissimos.
discussion_lockedBoolean—
downvotesInteger—
due_dateString (date)Example: 2022-11-20
idInteger (int64)Example: 84
iidIntegerExample: 14
issue_typeStringExample: issue
labelsArray of stringsExample: ["bug"]
merge_requests_countInteger—
milestoneAPIEntitiesMilestone—
project_idInteger (int64)Example: 4
start_dateString (date)Example: 2022-11-18
stateStringExample: closed
task_completion_statusAPIEntitiesTaskCompletionStatus—
time_statsAPIEntitiesIssuableTimeStats—
titleStringExample: Impedit et ut et dolores vero provident ullam est
typeStringThe type of the issue
Allowed values: ISSUE, INCIDENT, TEST_CASE, REQUIREMENT, TASK, TICKET
Example: ISSUE
updated_atString (date-time)Example: 2022-11-14T17:22:01.470Z
upvotesInteger—
user_notes_countInteger—
web_urlStringExample: http://example.com/example/example/issues/14

APIEntitiesMergeRequestAuthor

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

APIEntitiesMergeRequestBasic

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

APIEntitiesMilestone

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

APIEntitiesTaskCompletionStatus

PropertyTypeDescription
completed_countIntegerExample: 3
countIntegerExample: 5

APIEntitiesUserBasic

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