Skip to main content
POST
/
v1
/
api-keys
/
{key_id}
/
rotate
Rotate Api Key
curl --request POST \
  --url https://api.oneinbox.ai/v1/api-keys/{key_id}/rotate \
  --header 'Authorization: Bearer <token>'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "key_prefix": "<string>",
  "is_active": true,
  "scopes": [
    "<string>"
  ],
  "last_used_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "api_key": "<string>",
  "rotate_grace_seconds": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

key_id
string<uuid>
required

Response

Successful Response

Returned by POST /v1/api-keys/{id}/rotate. The old key continues to work for rotate_grace_seconds so a rolling deploy doesn't 401 itself.

id
string<uuid>
required
name
string
required
key_prefix
string
required
is_active
boolean
required
scopes
string[]
required
last_used_at
string<date-time> | null
required
created_at
string<date-time>
required
api_key
string
required
rotate_grace_seconds
integer
required