Rotate an API token (issue new secret, revoke old)
const url = 'https://example.com/v1/tokens/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rotate';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/tokens/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rotate \ --header 'Authorization: Bearer <token>'Issues a new token with the same specification and revokes the old one in the same step. The new secret is returned once.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Resource identifier (UUIDv7).
Responses
Section titled “ Responses ”OK
object
The new opaque API key (olvk_…). Shown only once.
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "token": "example"}Bad request
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Unauthenticated
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Forbidden
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Not found
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Conflict / setup required
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Rate limited
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}