Use this API to manage releases for a project, list the releases across a group, and manage the asset links attached to a release.

Asset links support the http, https, and ftp protocols.

List all releases in a group

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

Lists all releases for projects in a specified group.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the group
sort
Query
StringSort results in ascending or descending order
Allowed values: asc, desc
Default: desc
simple
Query
BooleanIf true, only returns limited fields for each release
Default: false
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 APIEntitiesRelease
400Bad request—
403Forbidden—
404Not found—

List all releases in a project

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

Lists all releases for a specified project. Sorted by released_at.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
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
order_by
Query
StringSort results by the specified field
Allowed values: released_at, created_at
Default: released_at
sort
Query
StringSort results in ascending or descending order
Allowed values: asc, desc
Default: desc
include_html_description
Query
BooleanIf true, the response includes HTML-rendered Markdown of the release description
updated_before
Query
String (date-time)Return releases updated on or before the specified time
updated_after
Query
String (date-time)Return releases updated on or after the specified time

Responses

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

Create a release

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

Creates a release. Developer level access to the project is required to create a release. Release creates and updates are rate limited per project (release_writes_limit_per_project application setting) and per user (release_writes_limit_per_user application setting). Requests over a limit are blocked when its feature flag (rate_limit_release_writes_per_project or rate_limit_release_writes_per_user) is enabled, and only logged otherwise. When the release_evidence_size_limit feature flag is enabled, the response includes warnings if the release evidence would exceed the release_evidence_max_size_bytes application setting even without its issues.

Parameters

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

Request body (application/json)

PropertyTypeDescription
assetsObjectObject that contains assets for the release
assets.linksArray of objectsArray of links to include as release assets
assets.links[].direct_asset_pathStringPath for a direct asset link
assets.links[].filepathStringDeprecated: optional path for a direct asset link
assets.links[].link_typeStringThe type of the link
Allowed values: other, runbook, package, image
Default: other
assets.links[].name
Required
StringName of the link. Link names must be unique within the release
assets.links[].url
Required
StringURL of the link. Link URLs must be unique within the release
descriptionStringDescription of the release. You can use Markdown
legacy_catalog_publishBooleanIf true, publishes the release to the CI catalog. This parameter is for internal use only and is planned for removal in a future release. If the ci_release_cli_catalog_publish_option feature flag is disabled, this parameter is ignored and the release publishes to the CI catalog as before
milestone_idsString or integerID of each milestone the release is associated with. GitLab Premium customers can specify group milestones. Cannot be combined with the milestones parameter. Mutually exclusive with milestones
milestonesArray of stringsTitle of each milestone the release is associated with. GitLab Premium customers can specify group milestones. Cannot be combined with the milestone_ids parameter. Mutually exclusive with milestone_ids
nameStringName of the release
refStringIf the tag named in tag_name doesn’t exist, the release is created from this ref and tagged with tag_name. Can be a commit SHA, another tag name, or a branch name
released_atString (date-time)Date and time for the release. Defaults to the current time. Only provide this field when creating an upcoming or historical release
tag_messageStringMessage to use if creating a new annotated tag
tag_name
Required
StringTag the release is created from

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesRelease
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
409Conflict—
422Unprocessable entity—
429Too many requests—

Get the latest project release

GET /api/v4/projects/{id}/releases/permalink/latest

Retrieves the latest release through a permanent API URL. To call any other GET endpoint that requires a release tag, append a suffix to the permalink/latest path, for example permalink/latest/evidence, or permalink/latest/downloads/bin/asset.exe to download an asset of the latest release. The request redirects to the endpoint for the tag of the latest release.

Parameters

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

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

Get the latest project release

GET /api/v4/projects/{id}/releases/permalink/latest/{suffix_path}

Retrieves the latest release through a permanent API URL. To call any other GET endpoint that requires a release tag, append a suffix to the permalink/latest path, for example permalink/latest/evidence, or permalink/latest/downloads/bin/asset.exe to download an asset of the latest release. The request redirects to the endpoint for the tag of the latest release.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
suffix_path
Path, required
StringThe path to be suffixed to the latest release

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

Retrieve a release by tag name

GET /api/v4/projects/{id}/releases/{tag_name}

Retrieves a release with a specified tag name.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringGit tag the release is associated with
include_html_description
Query
BooleanIf true, the response includes HTML-rendered Markdown of the release description

Responses

CodeDescriptionSchema
200OKAPIEntitiesRelease
400Bad Request—
401Unauthorized—
404Not found—

Update a release

PUT /api/v4/projects/{id}/releases/{tag_name}

Updates a release. Developer level access to the project is required to update a release. Release creates and updates are rate limited per project (release_writes_limit_per_project application setting) and per user (release_writes_limit_per_user application setting). Requests over a limit are blocked when its feature flag (rate_limit_release_writes_per_project or rate_limit_release_writes_per_user) is enabled, and only logged otherwise.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringGit tag the release is associated with

Request body (application/json)

PropertyTypeDescription
descriptionStringDescription of the release. You can use Markdown
milestone_idsString or integerID of each milestone the release is associated with. GitLab Premium customers can specify group milestones. Cannot be combined with the milestones parameter. To remove all milestones from the release, specify []. Mutually exclusive with milestones
milestonesArray of stringsTitle of each milestone to associate with the release. GitLab Premium customers can specify group milestones. Cannot be combined with the milestone_ids parameter. To remove all milestones from the release, specify []. Mutually exclusive with milestone_ids
nameStringName of the release
released_atString (date-time)Date when the release is or was ready

Responses

CodeDescriptionSchema
200OKAPIEntitiesRelease
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
429Too many requests—

Delete a release

DELETE /api/v4/projects/{id}/releases/{tag_name}

Delete a release. Deleting a release doesn’t delete the associated tag. Requires at least the Developer role for the project. This feature was introduced in GitLab 11.7.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringGit tag the release is associated with

Responses

CodeDescriptionSchema
200OKAPIEntitiesRelease
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

GET /api/v4/projects/{id}/releases/{tag_name}/assets/links

Lists all assets as links from a release.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringTag associated with the release
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 APIEntitiesReleasesLink
400Bad Request—
401Unauthorized—
404Not found—

POST /api/v4/projects/{id}/releases/{tag_name}/assets/links

Creates an asset link for a specified release.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringTag associated with the release

Request body (application/json)

PropertyTypeDescription
direct_asset_pathStringPath for a direct asset link
filepathStringPath for a direct asset link. Deprecated. Use direct_asset_path instead
link_typeStringType of the link
Allowed values: other, runbook, image, package
Default: other
name
Required
StringName of the link. Link names must be unique in the release
url
Required
StringURL of the link. Link URLs must be unique in the release

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesReleasesLink
400Bad request—
401Unauthorized—
404Not Found—

GET /api/v4/projects/{id}/releases/{tag_name}/assets/links/{link_id}

Retrieves a specified asset as a link from a release.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringTag associated with the release
link_id
Path, required
IntegerID of the link

Responses

CodeDescriptionSchema
200OKAPIEntitiesReleasesLink
400Bad Request—
401Unauthorized—
404Not found—

PUT /api/v4/projects/{id}/releases/{tag_name}/assets/links/{link_id}

Updates a specified asset link for a release.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringTag associated with the release
link_id
Path, required
IntegerID of the link

Request body (application/json)

PropertyTypeDescription
direct_asset_pathStringPath for a direct asset link
filepathStringPath for a direct asset link. Deprecated. Use direct_asset_path instead
link_typeStringType of the link
Allowed values: other, runbook, image, package
Default: other
nameStringName of the link. At least one of name, url must be provided
urlStringURL of the link. At least one of name, url must be provided

Responses

CodeDescriptionSchema
200OKAPIEntitiesReleasesLink
400Bad request—
401Unauthorized—
404Not Found—

DELETE /api/v4/projects/{id}/releases/{tag_name}/assets/links/{link_id}

Deletes a specified asset link from a release.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringTag associated with the release
link_id
Path, required
IntegerID of the link

Responses

CodeDescriptionSchema
200OKAPIEntitiesReleasesLink
400Bad request—
401Unauthorized—
404Not Found—

Download a project release asset file

GET /api/v4/projects/{id}/releases/{tag_name}/downloads/{direct_asset_path}

Downloads a release asset file. The request redirects to the URL of the release link that has the specified direct asset path. This feature was introduced in GitLab 15.4.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
tag_name
Path, required
StringGit tag the release is associated with
direct_asset_path
Path, required
StringThe path to the file to download, as specified when creating the release asset

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

Schemas

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

APIEntitiesCommit

PropertyTypeDescription
author_emailStringEmail address of the commit author
Example: john@example.com
author_nameStringName of the commit author
Example: John Smith
authored_dateString (date-time)Date and time when the commit was authored
Example: 2012-05-28T04:42:42-07:00
committed_dateString (date-time)Date and time when the commit was committed
Example: 2012-05-28T04:42:42-07:00
committer_emailStringEmail address of the committer
Example: jack@example.com
committer_nameStringName of the committer
Example: Jack Smith
created_atString (date-time)Date and time when the commit was created. Identical to committed_date
Example: 2017-07-26T11:08:53.000+02:00
extended_trailersObjectGit trailers parsed from the commit message, with every value for each key
Example: {"Signed-off-by":["John Doe \u003cjohndoe@gitlab.com\u003e","Jane Doe \u003cjanedoe@gitlab.com\u003e"]}
idStringFull SHA of the commit
Example: 2695effb5807a22ff3d138d593fd856244e155e7
messageStringFull commit message
Example: Initial commit
parent_idsArray of stringsSHAs of the parent commits
Example: ["2a4b78934375d7f53875269ffd4f45fd83a84ebe"]
short_idStringShort SHA of the commit
Example: 2695effb
titleStringTitle of the commit message
Example: Initial commit
trailersObjectGit trailers parsed from the commit message. Duplicate keys include the last value only
Example: {"Merged-By":"Jane Doe janedoe@gitlab.com"}
web_urlStringURL to view the commit in the GitLab UI
Example: https://gitlab.example.com/janedoe/gitlab-foss/-/commit/ed899a2f4b50b4370feeea94676502b42383c746

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesMilestoneWithStats

PropertyTypeDescription
created_atString—
descriptionString—
due_dateString—
expiredBoolean—
group_idString—
idInteger (int64)—
iidInteger (int64)—
issue_statsObject—
issue_stats.closedIntegerExample: 5
issue_stats.totalIntegerExample: 10
project_idInteger (int64)—
start_dateString—
stateString—
titleString—
updated_atString—
web_urlString—

APIEntitiesRelease

PropertyTypeDescription
_linksObjectLinks of the release
_links.closed_issues_urlStringHTTP URL of the release’s closed issues
_links.closed_merge_requests_urlStringHTTP URL of the release’s closed merge requests
_links.edit_urlStringHTTP URL of the release’s edit page
_links.merged_merge_requests_urlStringHTTP URL of the release’s merged merge requests
_links.opened_issues_urlStringHTTP URL of the release’s open issues
_links.opened_merge_requests_urlStringHTTP URL of the release’s open merge requests
_links.selfStringHTTP URL of the release
assetsObject—
assets.countIntegerExample: 2
assets.linksArray of APIEntitiesReleasesLink—
assets.sourcesArray of APIEntitiesReleasesSource—
authorAPIEntitiesUserBasic—
commitAPIEntitiesCommit—
commit_pathStringExample: /root/app/commit/588440f66559714280628a4f9799f0c4eb880a4a
created_atString (date-time)Example: 2019-01-03T01:56:19.539Z
descriptionStringExample: Finally released v1.0
description_htmlString—
evidencesArray of APIEntitiesReleasesEvidence—
milestonesArray of APIEntitiesMilestoneWithStats—
nameStringExample: Release v1.0
released_atString (date-time)Example: 2019-01-03T01:56:19.539Z
tag_nameStringExample: v1.0
tag_pathStringExample: /root/app/-/tags/v1.0
upcoming_releaseBoolean—
warningsArray of stringsExample: ["No evidence was collected for this release."]

APIEntitiesReleasesEvidence

PropertyTypeDescription
collected_atString (date-time)Example: 2019-01-03T01:56:19.539Z
filepathStringExample: https://gitlab.example.com/root/app/-/releases/v1.0/evidence.json
shaStringExample: 760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d
PropertyTypeDescription
direct_asset_urlStringExample: https://gitlab.example.com/root/app/-/releases/v1.0/downloads/app-v1.0.dmg
idInteger (int64)Example: 1
link_typeStringExample: other
nameStringExample: app-v1.0.dmg
urlStringExample: https://gitlab.example.com/root/app/-/jobs/688/artifacts/raw/bin/app-v1.0.dmg

APIEntitiesReleasesSource

PropertyTypeDescription
formatStringExample: zip
urlStringExample: https://gitlab.example.com/root/app/-/archive/v1.0/app-v1.0.zip

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