v2
latestOpenAPI 3.0.02026-08-013312111.4 MBRefs
Create a tag
Creates a new annotated tag in the specified repository.
The payload of the POST should consist of a JSON document that contains the name of the tag and the target hash.
curl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \
-s -u jdoe -X POST -H "Content-Type: application/json" \
-d '{
"name" : "new-tag-name",
"target" : {
"hash" : "a1b2c3d4e5f6",
}
}'
This endpoint does support using short hash prefixes for the commit hash, but it may return a 400 response if the provided prefix is ambiguous. Using a full commit hash is the preferred approach.
A message for the tag object may optionally be provided. If it is omitted or the provided message is empty, a default message of "Added tag <tagname> for changeset <shorthash>" will be used.
post/repositories/{workspace}/{repo_slug}/refs/tags
Request body
Response
The newly created tag.