Rotate API key
Rotate your API key.
Creates a new API key and deprecates the current active key. The old key remains valid for 7 days (grace period) to allow migration.
This is the recommended way to rotate keys without service disruption.
Authorizations
API Key authentication. Format: dk_test_ or dk_live_
Body
Request schema for creating a new API key (POST /v1/keys).
Attributes: name: Human-readable name for the API key (e.g., "Production API Key") environment: Key environment - "live" for production, "test" for testing (default: "live")
Response
New API key created and old key deprecated
Response for API key rotation (POST /v1/keys/rotate).
Returns the new key and information about the deprecated old key. The old key remains active for 7 days (grace period) to allow migration.
WARNING: The api_key field in new_key is shown only in this response. Store it securely immediately - it cannot be retrieved again.