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). An otherwise unrestricted parent may rotate child keys when its list_numbers constraint is omitted, null, or an empty list. Active list restrictions, malformed or unsupported stored constraints, an IP allowlist, a daily cap, or required send confirmation block delegation. Rotation rechecks parent authority together with the child-key change. Concurrent parent revocation, policy changes, or account ownership changes refuse the rotation with 409 rotate_conflict.
The old key stops working the moment rotation completes. Prepare your integration to install the replacement immediately after this response. The new plaintext key is returned once.

Path Parameters

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

Examples

The replacement key inherits the old key’s resourceConstraints, dailySendCap, requireSendConfirmation, expiresAt, allowedIps, and rateLimitOverride. It shares the original key’s daily send usage. A later dashboard change to its allowed lists, daily cap, or confirmation setting revokes other still-valid credentials from the same rotation chain.

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.