Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A merchant standard (sk_…) or restricted (rk_…) secret key sent as Authorization: Bearer <key>.

Path Parameters

id
string
required

The API key identifier (sk_… for secret keys, pk_… for publishable keys).

Body

application/json

All fields are optional.

grace_period_hours
integer
default:24

How long the old key stays active after rotation, in hours. Must be between 1 and 168 (7 days). Defaults to 24. Cannot extend past the old key's existing expiry time.

Required range: 1 <= x <= 168

Response

The rotation result, including the new key's full value and the old key's expiry.

new_key
object
required

Returned when a key is created or rotated. Includes the full authenticatable value (key), which is shown exactly once and is not stored by Ionic. Store it immediately.

old_key_id
string
required

Identifier of the key that was rotated out.

old_key_expires_at
integer
required

Unix epoch seconds when the old key stops authenticating requests (end of the grace period).