Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of the next version, still under development. See the latest release.

Create a new git tag in a repository

POST
/repos/{owner}/{repo}/tags
curl --request POST \
--url https://gitea.com/api/v1/repos/example/example/tags \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "message": "example", "tag_name": "example", "target": "example" }'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

Media typeapplication/json

CreateTagOption options when creating a tag

object
message

The message to associate with the tag

string
tag_name
required

The name of the tag to create

string
target

The target commit SHA or branch name for the tag

string
Examplegenerated
{
"message": "example",
"tag_name": "example",
"target": "example"
}

Tag

Media typeapplication/json

Tag represents a repository tag

object
commit
CommitMeta contains meta information of a commit in terms of API.
object
created

Created is the time when the commit was created

string format: date-time
sha

SHA is the commit SHA hash

string
url

URL is the API URL for the commit

string format: uri
id

The ID (SHA) of the tag

string
message

The message associated with the tag

string
name

The name of the tag

string
tarball_url

The URL to download the tarball archive

string format: uri
zipball_url

The URL to download the zipball archive

string format: uri
Examplegenerated
{
"commit": {
"created": "2026-04-15T12:00:00Z",
"sha": "example",
"url": "https://example.com"
},
"id": "example",
"message": "example",
"name": "example",
"tarball_url": "https://example.com",
"zipball_url": "https://example.com"
}

APINotFound is a not found empty response

APIEmpty is an empty response

APIConflict is a conflict empty response

APIValidationError is error format response related to input validation

message
string
url
string

APIRepoArchivedError is an error that is raised when an archived repo should be modified

message
string
url
string