releases

Create a release

Creates a release. Developer level access to the project is required to create a release.

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

Request

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

Path parameters

idstring required

The ID or URL-encoded path of the project

Request body

tag_namestring required

The tag where the release is created from

tag_messagestring

Message to use if creating a new annotated tag

namestring

The release name

descriptionstring

The description of the release. You can use Markdown

refstring

If a tag specified in tag_name doesn't exist, the release is created from ref and tagged with tag_name. It can be a commit SHA, another tag name, or a branch name.

milestonesstring[]

The title of each milestone the release is associated with. GitLab Premium customers can specify group milestones. Cannot be combined with milestone_ids parameter.

milestone_idsstring

The ID of each milestone the release is associated with. GitLab Premium customers can specify group milestones. Cannot be combined with milestones parameter.

released_atstring date-time

Date and time for the release. Defaults to the current time. Expected in ISO 8601 format (2019-03-15T08:00:00Z). Only provide this field if creating an upcoming or historical release.

legacy_catalog_publishboolean

If true, the release will be published to the CI catalog. This parameter is for internal use only and will be removed in a future release. If the feature flag ci_release_cli_catalog_publish_option is disabled, this parameter will be ignored and the release will published to the CI catalog as it was before this parameter was introduced.

Response

Create a release

namestring required
tag_namestring required
descriptionstring required
created_atstring date-time required
released_atstring date-time required
upcoming_releaseboolean required
description_htmlstring
commit_pathstring
tag_pathstring

Example response

{
  "name": "Release v1.0",
  "tag_name": "v1.0",
  "description": "Finally released v1.0",
  "created_at": "2019-01-03T01:56:19.539Z",
  "released_at": "2019-01-03T01:56:19.539Z",
  "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"
  },
  "commit": {
    "id": "2695effb5807a22ff3d138d593fd856244e155e7",
    "short_id": "2695effb",
    "created_at": "2017-07-26T11:08:53.000+02:00",
    "parent_ids": [
      "2a4b78934375d7f53875269ffd4f45fd83a84ebe"
    ],
    "title": "Initial commit",
    "message": "Initial commit",
    "author_name": "John Smith",
    "author_email": "john@example.com",
    "authored_date": "2012-05-28T04:42:42-07:00",
    "committer_name": "Jack Smith",
    "committer_email": "jack@example.com",
    "committed_date": "2012-05-28T04:42:42-07:00",
    "trailers": {
      "Merged-By": "Jane Doe janedoe@gitlab.com"
    },
    "extended_trailers": {
      "Signed-off-by": [
        "John Doe <johndoe@gitlab.com>",
        "Jane Doe <janedoe@gitlab.com>"
      ]
    },
    "web_url": "https://gitlab.example.com/janedoe/gitlab-foss/-/commit/ed899a2f4b50b4370feeea94676502b42383c746"
  },
  "milestones": {
    "issue_stats": {
      "total": 10,
      "closed": 5
    }
  },
  "commit_path": "/root/app/commit/588440f66559714280628a4f9799f0c4eb880a4a",
  "tag_path": "/root/app/-/tags/v1.0",
  "assets": {
    "count": 2,
    "sources": {
      "format": "zip",
      "url": "https://gitlab.example.com/root/app/-/archive/v1.0/app-v1.0.zip"
    },
    "links": {
      "id": 1,
      "name": "app-v1.0.dmg",
      "url": "https://gitlab.example.com/root/app/-/jobs/688/artifacts/raw/bin/app-v1.0.dmg",
      "direct_asset_url": "https://gitlab.example.com/root/app/-/releases/v1.0/downloads/app-v1.0.dmg",
      "link_type": "other"
    }
  },
  "evidences": {
    "sha": "760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d",
    "filepath": "https://gitlab.example.com/root/app/-/releases/v1.0/evidence.json",
    "collected_at": "2019-01-03T01:56:19.539Z"
  }
}

Changes

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