Create a new git tag in a repository
const url = 'https://gitea.example.com/api/v1/repos/example/example/tags';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"message":"example","tag_name":"example","target":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Owner of the repo
Name of the repo
Request Body
Section titled “Request Body”CreateTagOption options when creating a tag
object
The message to associate with the tag
The target commit SHA or branch name for the tag
Examplegenerated
{ "message": "example", "tag_name": "example", "target": "example"}CreateTagOption options when creating a tag
object
The message to associate with the tag
The target commit SHA or branch name for the tag
Responses
Section titled “Responses”Tag
Tag represents a repository tag
object
object
SHA is the commit SHA hash
URL is the API URL for the commit
The ID (SHA) of the tag
The message associated with the tag
The name of the tag
The URL to download the tarball archive
The URL to download the zipball archive
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
APIEmpty is an empty response
APIConflict is a conflict empty response
APIValidationError is error format response related to input validation
Headers
Section titled “Headers”APIRepoArchivedError is an error that is raised when an archived repo should be modified