跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 22.6.1, which is no longer the latest release. See the latest release.

Create a new git tag in a repository

POST
/repos/{owner}/{repo}/tags
curl --request POST \
--url https://gitea.example.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

CreateTagOption options when creating a tag

object
message
string
tag_name
required
string
target
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
string format: date-time
sha
string
url
string
id
string
message
string
name
string
tarball_url
string
zipball_url
string
Examplegenerated
{
"commit": {
"created": "2026-04-15T12:00:00Z",
"sha": "example",
"url": "example"
},
"id": "example",
"message": "example",
"name": "example",
"tarball_url": "example",
"zipball_url": "example"
}

APINotFound is a not found empty response

Media typeapplication/json

APIEmpty is an empty response

Media typeapplication/json

APIConflict is a conflict empty response

Media typeapplication/json

APIValidationError is error format response related to input validation

Media typeapplication/json
message
string
url
string

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

Media typeapplication/json
message
string
url
string