Pats - Get
Gets a single personal access token (PAT).
GET https://vssps.dev.azure.com/{organization}/_apis/tokens/pats?authorizationId={authorizationId}&api-version=6.1-preview.1
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
api-version
|
query | True |
string |
Version of the API to use. This should be set to '6.1-preview.1' to use this version of the api. |
authorization
|
query | True |
string (uuid) |
The authorizationId identifying a single, unique personal access token (PAT) |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
accessToken
Personal access token. Use any value for the user name and the token as the password.
Type:
basic
Examples
Get a personal access token by authorizationId
Sample request
GET https://vssps.dev.azure.com/{organization}/_apis/tokens/pats?authorizationId=cf42cc9f-f170-4375-92ba-c13d58a6545f&api-version=6.1-preview.1
Sample response
{
"patToken": {
"displayName": "analytics_token",
"validTo": "2020-12-01T23:46:23.32Z",
"scope": "vso.analytics",
"targetAccounts": [
"38aaa865-2c70-4bf7-a308-0c6539c38c1a"
],
"validFrom": "2020-10-29T17:26:46.72Z",
"authorizationId": "3d3aca0c-9ad3-4b07-8334-08ec8b1ddc32",
"token": null
},
"patTokenError": "none"
}
Definitions
Name | Description |
---|---|
Pat |
Represents a personal access token (PAT) used to access Azure DevOps resources |
Pat |
Contains the resulting personal access token (PAT) and the error (if any) that occurred during the operation |
Session |
The error (if any) that occurred |
PatToken
Represents a personal access token (PAT) used to access Azure DevOps resources
Name | Type | Description |
---|---|---|
authorizationId |
string (uuid) |
Unique guid identifier |
displayName |
string |
The token name |
scope |
string |
The token scopes for accessing Azure DevOps resources |
targetAccounts |
string[] (uuid) |
The organizations for which the token is valid; null if the token applies to all of the user's accessible organizations |
token |
string |
The unique token string generated at creation |
validFrom |
string (date-time) |
The token creation date |
validTo |
string (date-time) |
The token expiration date |
PatTokenResult
Contains the resulting personal access token (PAT) and the error (if any) that occurred during the operation
Name | Type | Description |
---|---|---|
patToken |
The resulting personal access token (PAT) |
|
patTokenError |
The error (if any) that occurred |
SessionTokenError
The error (if any) that occurred
Value | Description |
---|---|
accessDenied | |
authorizationNotFound | |
displayNameRequired | |
duplicateHash | |
failedToIssueAccessToken | |
failedToReadTenantPolicy | |
failedToUpdateAccessToken | |
fullScopePatPolicyViolation | |
globalPatPolicyViolation | |
hostAuthorizationNotFound | |
invalidAuthorizationId | |
invalidClient | |
invalidClientId | |
invalidClientType | |
invalidDisplayName | |
invalidScope | |
invalidSource | |
invalidSourceIP | |
invalidTargetAccounts | |
invalidToken | |
invalidUserId | |
invalidUserType | |
invalidValidTo | |
none | |
patLifespanPolicyViolation | |
sourceNotSupported | |
sshPolicyDisabled | |
tokenNotFound | |
userIdRequired |