Update API Key

Switch an API key on or off, or archive it.

Change the status of an API key: switch it on or off, or archive it. The response is the updated API key. API key names are fixed once created and can't be changed.

POST /v1/account/api_keys/:api_key_id

Status changes take effect within seconds: a key set to inactive or archived stops working on its next request.

Archiving is permanent

An archived API key can never be updated again, and it disappears from the console. Use inactive if you may need the API key back.

Path parameters

api_key_idstringrequired

The key's ID, starting with key_.

Body

statusstringoptional

New status. expired can't be set; it follows the key's expires_at.

Allowed values:activeinactivearchived

Any other field is rejected with 400.

Response

(object)ApiKeyoptional

The updated API key object.

Errors

StatusReason
400A field is invalid or unknown, or the API key is archived (Archived API keys cannot be updated.).
404No key with this ID exists on your account.