Skip to content
GridRouterhome

Search

Search providers, capabilities and pages

Docs
API referenceKeys and access

Rotate an API key

POST
/v1/keys/{id}/rotate

Mint a replacement key with the same scopes and limits; the old key keeps working for grace_seconds (default 24 h), then expires.

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

id*string
Match^[0-9A-Za-z]{12}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/keys/string/rotate" \  -H "Content-Type: application/json" \  -d '{}'
{  "key": {    "object": "api_key",    "id": "string",    "name": "string",    "prefix": "string",    "scopes": [      "*"    ],    "status": "active",    "label": "string",    "agent_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "allowed_ips": [      "string"    ],    "limit_micro": 0,    "limit_reset": "day",    "usage_micro": 0,    "limit_remaining_micro": 0,    "secret": "string"  },  "previous": {    "object": "api_key",    "id": "string",    "name": "string",    "prefix": "string",    "scopes": [      "*"    ],    "status": "active",    "label": "string",    "agent_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "allowed_ips": [      "string"    ],    "limit_micro": 0,    "limit_reset": "day",    "usage_micro": 0,    "limit_remaining_micro": 0,    "secret": "string"  }}