Skip to content

Create a tag

POST
/api/v4/projects/{id}/repository/tags

Creates a tag in the repository that points to a specified reference.

id
required
One of:
string

The ID or URL-encoded path of the project

Media type application/json
object
tag_name
required

The name of the tag

string
nullable
Example
v.1.0.0
ref
required

The commit sha or branch name

string
nullable
Example
2695effb5807a22ff3d138d593fd856244e155e7
message

Specifying a message creates an annotated tag

string
nullable
Example
Release 1.0.0

Created

Media type application/json
object
name
string
message
string
target
string
commit
object
id
string
short_id
string
created_at
string format: date-time
parent_ids
Array<string>
title
string
message
string
author_name
string
author_email
string
authored_date
string format: date-time
committer_name
string
committer_email
string
committed_date
string format: date-time
trailers
object
extended_trailers
object
web_url
string
release
object
tag_name
string
description
string
protected
boolean
created_at
string format: date-time
Example
{
"name": "v1.0.0",
"message": "Release v1.0.0",
"target": "2695effb5807a22ff3d138d593fd856244e155e7",
"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"
},
"release": {
"tag_name": "1.0.0",
"description": "Amazing release. Wow"
},
"protected": true,
"created_at": "2023-10-12T02:16:52.000Z"
}

Bad request

Unauthenticated

Not found