Updates a specific token using its ID. When you update a token, you can omit properties that do not need to be updated. To remove a restriction, you can use null or an empty array.
Note
Changing the expiration date generates a new query token.
Security
Bearer
- https://cs-tokenapi.sitecorecloud.iohttps://cs-tokenapi.sitecorecloud.io/api/token/v2/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
'https://cs-tokenapi.sitecorecloud.io/api/token/v2/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"label": "string",
"description": "string",
"managePersistedQueries": true,
"expiration": "2019-08-24T14:15:22Z",
"restrictions": {
"publishState": [
"Published"
],
"branches": [
"main"
],
"origins": [
"https://myapp.com"
],
"sourceIPs": [
"127.0.0.1"
],
"introspection": true
}
}'Successful operation. The updated token is returned.
Represents the restrictions associated with a token.
Example:
{ "publishState": [ "Published" ], "branches": [ "main" ], "origins": [ "https://myapp.com" ], "sourceIPs": [ "127.0.0.1" ], "introspection": true }
Response
{ "id": "string", "label": "string", "description": "string", "managePersistedQueries": true, "expiration": "2019-08-24T14:15:22Z", "restrictions": { "publishState": [ … ], "branches": [ … ], "origins": [ … ], "sourceIPs": [ … ], "introspection": true }, "lastUse": "2019-08-24T14:15:22Z", "system": { "createdAt": "2019-08-24T14:15:22Z", "createdBy": { … }, "updatedAt": "2019-08-24T14:15:22Z", "updatedBy": { … } } }