Annotated Tags - Create
Create an annotated tag.
Repositories have both a name and an identifier. Identifiers are globally unique, but several projects may contain a repository of the same name. You don't need to include the project if you specify a repository by ID. However, if you specify a repository by name, you must also specify the project (by name or ID).
POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/annotatedtags?api-version=7.1-preview.1
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
project
|
path | True |
string |
Project ID or project name |
repository
|
path | True |
string |
ID or name of the repository. |
api-version
|
query | True |
string |
Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api. |
Request Body
Name | Type | Description |
---|---|---|
message |
string |
The tagging Message |
name |
string |
The name of the annotated tag. |
objectId |
string |
The objectId (Sha1Id) of the tag. |
taggedBy |
User info and date of tagging. |
|
taggedObject |
Tagged git object. |
|
url |
string |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
Name | Description |
---|---|
vso.code_manage | Grants the ability to read, update, and delete source code, access metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to create and manage code repositories, create and manage pull requests and code reviews, and to receive notifications about version control events via service hooks. |
Examples
Sample request
POST https://dev.azure.com/fabrikam/c34d5807-1734-4541-ad1c-d16e9ac1faca/_apis/git/repositories/{repositoryId}/annotatedtags?api-version=7.1-preview.1
{
"name": "v0.1-beta",
"taggedObject": {
"objectId": "c60be62ebf0e86b5aa01dbb98657b4b7e5905234"
},
"message": "First beta release"
}
Sample response
{
"name": "refs/tags/v0.1-beta",
"objectId": "bc57849b33949a15fa3cb889bb82d9ce21d5b6ee",
"taggedObject": {
"objectId": "c60be62ebf0e86b5aa01dbb98657b4b7e5905234",
"objectType": "commit"
},
"taggedBy": {
"name": "Norman Paulk",
"email": "Fabrikamfiber16@hotmail.com",
"date": "2017-06-22T05:09:23"
},
"message": "First beta release",
"url": "https://dev.azure.com/fabrikam/c34d5807-1734-4541-ad1c-d16e9ac1faca/_apis/git/repositories/ca93c3a5-87bb-4b5b-a62f-1f971d677c79/annotatedTags/bc57849b33949a15fa3cb889bb82d9ce21d5b6ee"
}
Definitions
Name | Description |
---|---|
Git |
A Git annotated tag. |
Git |
Git object identifier and type information. |
Git |
Type of object (Commit, Tree, Blob, Tag) |
Git |
User info and date for Git operations. |
GitAnnotatedTag
A Git annotated tag.
Name | Type | Description |
---|---|---|
message |
string |
The tagging Message |
name |
string |
The name of the annotated tag. |
objectId |
string |
The objectId (Sha1Id) of the tag. |
taggedBy |
User info and date of tagging. |
|
taggedObject |
Tagged git object. |
|
url |
string |
GitObject
Git object identifier and type information.
Name | Type | Description |
---|---|---|
objectId |
string |
Object Id (Sha1Id). |
objectType |
Type of object (Commit, Tree, Blob, Tag) |
GitObjectType
Type of object (Commit, Tree, Blob, Tag)
Name | Type | Description |
---|---|---|
bad |
string |
|
blob |
string |
|
commit |
string |
|
ext2 |
string |
|
ofsDelta |
string |
|
refDelta |
string |
|
tag |
string |
|
tree |
string |
GitUserDate
User info and date for Git operations.
Name | Type | Description |
---|---|---|
date |
string |
Date of the Git operation. |
string |
Email address of the user performing the Git operation. |
|
imageUrl |
string |
Url for the user's avatar. |
name |
string |
Name of the user performing the Git operation. |