Rotate an API key

Rotate an active API key: mint a successor copying the old key's name, scopes, domain, and environment, and stamp the old key to stop authenticating in 24…

POSThttps://api.mailfully.com/v1/api-keys/{id}/rotate

Rotate an active API key: mint a successor copying the old key's name, scopes, domain, and environment, and stamp the old key to stop authenticating in 24 hours (a zero-downtime grace window). Only a key with no revoked_at can be rotated; a revoked or already-mid-grace key returns 409. The new plaintext key is returned once. Requires the manage:keys scope, which is a dashboard-session scope (owner or admin only) and cannot be granted to API keys today: every mf_ API key receives 403. Call this endpoint with a dashboard session token. Takes no request body.

Loading code example
Loading code example

Authorizations

Authorizationstringheaderrequired

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

Path Parameters

idstringrequired

The API key resource id (`key_…`).

Response

application/json

The key was rotated; the successor's plaintext is shown once.