Skip to main content
POST
Mints a replacement key with the same scope and constraints as the original, then revokes the old key immediately — there is no grace window on this surface. Use your parent key with accounts.write. A sandbox key is re-minted as a sandbox key (trk_test_ prefix).
The old key stops working the moment rotation completes. Deploy the new key before rotating. The new plaintext key is returned once in this response.

Path Parameters

integer
required
The child account’s accountId.
string
required
The id of the key to rotate.

Examples

Error Codes

This rotates the API key. To rotate a webhook endpoint’s signing secret (which keeps a 24-hour grace window), see Webhook Signing.