Pats - Update
Updates an existing personal access token (PAT) with the new parameters. To update a token, it must be valid (has not been revoked).
PUT https://vssps.dev.azure.com/{organization}/_apis/tokens/pats?api-version=7.1-preview.1
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 '7.1-preview.1' to use this version of the api. |
Name | Type | Description |
---|---|---|
allOrgs |
boolean |
(Optional) True if this personal access token (PAT) is for all of the user's accessible organizations. False if otherwise (e.g. if the token is for a specific organization) |
authorizationId |
string |
The authorizationId identifying a single, unique personal access token (PAT) |
displayName |
string |
(Optional) The token name |
scope |
string |
(Optional) The token scopes for accessing Azure DevOps resources |
validTo |
string |
(Optional) The token expiration date |
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Personal access token. Use any value for the user name and the token as the password.
Type:
basic
Sample request
PUT https://vssps.dev.azure.com/{organization}/_apis/tokens/pats?api-version=7.1-preview.1
{
"authorizationId": "3d3aca0c-9ad3-4b07-8334-08ec8b1ddc32",
"displayName": "updated_token",
"scope": "vso.analytics",
"validTo": "2020-12-25T23:46:23.319Z",
"allOrgs": true
}
Sample response
{
"patToken": {
"displayName": "updated_token",
"validTo": "2020-12-25T23:46:23.32Z",
"scope": "vso.analytics",
"targetAccounts": null,
"validFrom": "2020-10-29T17:26:46.72Z",
"authorizationId": "3d3aca0c-9ad3-4b07-8334-08ec8b1ddc32",
"token": null
},
"patTokenError": "none"
}
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 |
Pat |
Encapsulates the request parameters for updating a personal access token (PAT) |
Session |
The error (if any) that occurred |
Represents a personal access token (PAT) used to access Azure DevOps resources
Name | Type | Description |
---|---|---|
authorizationId |
string |
Unique guid identifier |
displayName |
string |
The token name |
scope |
string |
The token scopes for accessing Azure DevOps resources |
targetAccounts |
string[] |
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 |
The token creation date |
validTo |
string |
The token expiration date |
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 |
Encapsulates the request parameters for updating a personal access token (PAT)
Name | Type | Description |
---|---|---|
allOrgs |
boolean |
(Optional) True if this personal access token (PAT) is for all of the user's accessible organizations. False if otherwise (e.g. if the token is for a specific organization) |
authorizationId |
string |
The authorizationId identifying a single, unique personal access token (PAT) |
displayName |
string |
(Optional) The token name |
scope |
string |
(Optional) The token scopes for accessing Azure DevOps resources |
validTo |
string |
(Optional) The token expiration date |
The error (if any) that occurred
Value | Description |
---|---|
accessDenied | |
authorizationNotFound | |
deploymentHostNotSupported | |
displayNameRequired | |
duplicateHash | |
failedToIssueAccessToken | |
failedToReadTenantPolicy | |
failedToUpdateAccessToken | |
fullScopePatPolicyViolation | |
globalPatPolicyViolation | |
hostAuthorizationNotFound | |
invalidAudience | |
invalidAuthorizationId | |
invalidClient | |
invalidClientId | |
invalidClientType | |
invalidDisplayName | |
invalidScope | |
invalidSource | |
invalidSourceIP | |
invalidSubject | |
invalidTargetAccounts | |
invalidToken | |
invalidTokenType | |
invalidUserId | |
invalidUserType | |
invalidValidTo | |
none | |
patLifespanPolicyViolation | |
sourceNotSupported | |
sshPolicyDisabled | |
tokenNotFound | |
userIdRequired |