Use this API to manage Git tags. This API also returns X.509 signature information from signed tags.
List all project repository tags
GET /api/v4/projects/{id}/repository/tags
Lists all repository tags from a project, sorted by update date and time in descending order.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
sortQuery | String | Return tags sorted in updated by asc or desc orderAllowed values: asc,descDefault: desc |
order_Query | String | Return tags ordered by name,updated,version fieldsAllowed values: name,updated,versionDefault: updated |
searchQuery | String | Return list of tags matching the search criteria |
page_Query | String | Name of tag to start the pagination from |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Unauthenticated | — |
404 | Not found | — |
422 | Unprocessable entity | — |
503 | Service unavailable | — |
Create a tag
POST /api/v4/projects/{id}/repository/tags
Creates a tag in the repository that points to a specified reference.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
message | String | Specifying a message creates an annotated tag Example: Release 1. |
refRequired | String | The commit sha or branch name Example: 2695effb5807a22ff3d1 |
tag_Required | String | The name of the tag Example: v. |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
403 | Unauthenticated | — |
404 | Not found | — |
429 | Too many requests | — |
Retrieve a single repository tag
GET /api/v4/projects/{id}/repository/tags/{tag_name}
Retrieves a repository tag with a specified name. This endpoint can be accessed without authentication if the repository is publicly accessible.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
tag_Path, | String | The name of the tag |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Unauthenticated | — |
404 | Not found | — |
Delete a tag
DELETE /api/v4/projects/{id}/repository/tags/{tag_name}
Deletes a specified repository tag.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
tag_Path, | String | The name of the tag |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad request | — |
403 | Unauthenticated | — |
404 | Not found | — |
412 | Precondition failed | — |
Retrieve X.509 signature of a tag
GET /api/v4/projects/{id}/repository/tags/{tag_name}/signature
Retrieves the X.509 signature from a signed tag. Unsigned tags return a 404 Not Found response.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
tag_Path, | String | The name of the tag |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCommit
| Property | Type | Description |
|---|---|---|
author_ | String | Example:john@example. |
author_ | String | Example:John Smith |
authored_ | String (date- | Example:2012- |
committed_ | String (date- | Example:2012- |
committer_ | String | Example:jack@example. |
committer_ | String | Example:Jack Smith |
created_ | String (date- | Example:2017- |
extended_ | Object | Example:{"Signed- |
id | String | Example:2695effb5807a22ff3d1 |
message | String | Example:Initial commit |
parent_ | Array of strings | Example:["2a4b78934375d7f53875 |
short_ | String | Example:2695effb |
title | String | Example:Initial commit |
trailers | Object | Example:{"Merged- |
web_ | String | Example:https: |
APIEntitiesTag
| Property | Type | Description |
|---|---|---|
commit | APIEntities | — |
created_ | String (date- | Example:2023- |
message | String | Example:Release v1. |
name | String | Example:v1. |
protected | Boolean | Example:true |
release | APIEntities | — |
target | String | Example:2695effb5807a22ff3d1 |
APIEntitiesTagRelease
| Property | Type | Description |
|---|---|---|
description | String | Example:Amazing release. |
tag_ | String | Example:1. |
APIEntitiesTagSignature
| Property | Type | Description |
|---|---|---|
signature | Object | — |
signature_ | String | Example:PGP |