Request

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
Path
idstringrequired
Bodyapplication/json
labelstring or null

The label of the token.

descriptionstring or null

The description of the token.

managePersistedQueriesboolean or null

Whether the token can manage persisted queries.

expirationstring or null, (date-time)

The expiration date and time of the token.

restrictionsobject(TokenRestriction)

Represents the restrictions associated with a token.

Example:
{ "publishState": [ "Published" ], "branches": [ "main" ], "origins": [ "https://myapp.com" ], "sourceIPs": [ "127.0.0.1" ], "introspection": true }
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
    }
  }'

Responses

Successful operation. The updated token is returned.

Bodyapplication/json
idstring

The unique identifier of the token.

labelstring

The label of the token.

descriptionstring

The description of the token.

managePersistedQueriesboolean

Gets or sets whether the token can manage persisted queries.

expirationstring, (date-time)

The expiration date and time of the token.

restrictionsobject(TokenRestriction)

Represents the restrictions associated with a token.

Example:
{ "publishState": [ "Published" ], "branches": [ "main" ], "origins": [ "https://myapp.com" ], "sourceIPs": [ "127.0.0.1" ], "introspection": true }
lastUsestring or null, (date-time)

The date and time when the token was last used.

systemobject(TokenSystemProperties)

Represents system metadata for a token.

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": { … } } }