Skip to Content
veriom

Rotate workspace API token

Issue a new secret for an API token and return it once. The token keeps its id, name, scopes, expiry, and creator, and `last_used_at` is cleared. The previous secret stops authenticating immediately. Revoked or expired tokens, and tokens whose creator has left the workspace, answer 409. Requires an Admin browser session with a recent step-up. Because the new secret acts as the token's creator, only an Owner can rotate a token created by another Owner or Admin.

POST
/v1/workspaces/{workspace_id}/api-tokens/{token_id}/rotate

Issue a new secret for an API token and return it once.

The token keeps its id, name, scopes, expiry, and creator, and last_used_at is cleared. The previous secret stops authenticating immediately. Revoked or expired tokens, and tokens whose creator has left the workspace, answer 409. Requires an Admin browser session with a recent step-up. Because the new secret acts as the token's creator, only an Owner can rotate a token created by another Owner or Admin.

Authorization

workspaceToken
headerAuthorizationBearer <vat_<opaque-token>>

Expiring, hashed workspace token with explicit scopes.

Path Parameters

workspace_id*Workspace Id
Formatuuid
token_id*Token Id
Formatuuid

Response Body

Successful Response

application/json
  1. response
expires_at*Expires At
Formatdate-time
id*Id
Formatuuid
name*Name
prefix*Prefix
scopes*array<string>
token*Token
Example Request
curl -X POST 'https://api.veriom.ai/v1/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/api-tokens/497f6eca-6276-4993-bfeb-53cbbbba6f08/rotate'
Example Response
{  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "prefix": "string",  "scopes": [    "string"  ],  "token": "string"}