Skip to main content
POST
Rotate API key

Authorizations

Authorization
string
header
required

Wallet session: the access_token from POST /v1/auth/wallet-sessions, for a user who brings their own wallet to a partner's web page. It acts for that wallet's account with no scope limit, and is bound to the Origin it signed in from: send exactly one Origin header with that value, or the request is ORIGIN_REQUIRED or UNAUTHENTICATED. It lasts at most 30 days and ends after 7 idle days or at DELETE /v1/auth/wallet-sessions/current.

Headers

Idempotency-Key
string<uuid>
required

Lowercase UUIDv7 naming this command, unique per caller and route. A retry with the same key and body returns the original result; the same key with a different body returns 409 IDEMPOTENCY_KEY_REUSED.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Path Parameters

key_id
string<uuid>
required

ID of a key on this account, from the key list or the create response.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Body

application/json

Every rotation needs a fresh owner proof over exactly this request without proof. The replacement inherits the predecessor's account, label and scopes.

proof
object
required

The account owner's signature over the challenge for exactly this request without proof.

overlap_seconds
integer
default:3600

How long the old key keeps working after the rotation, 0 to 86400 seconds; 3600 when omitted.

Required range: 0 <= x <= 86400
expires_in_days
integer
default:30

The replacement's lifetime in days, 1 to 90, or 0 for no expiry; 30 when omitted.

Required range: 0 <= x <= 90

Response

The replacement key and its secret, shown only in this response.

key
object
required

The new key's metadata.

secret
string
required

The ttk_ secret, shown only in this response; a retry of the same request answers SECRET_UNAVAILABLE, so store it now.

Pattern: ^ttk_v1_(dev|stg|prd)_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.[A-Za-z0-9_-]{43}$