Skip to main content

Rotate API Key

Initiates the API key rotation for a client specified by the client_guid. This endpoint generates and returns a new secondary API key while scheduling the existing key for deletion in 30 days. Both keys remain active during the rotation period, ensuring zero downtime. After 30 days, the original key is permanently deleted. To permanently delete the original API key before the 30 day window expires, use the Retire API Key endpoint.

warning

Once initiated, the process cannot be undone. The original API key will be permanently deleted in 30 days and can no longer be used to access MX's servers.

info

If another rotation is started during an ongoing process, the original key's deletion is extended by another 30 days, and the previous secondary key is replaced by a new one.

POST
/clients/{client_guid}/api_keys/rotate

Path Parameters

FieldRequiredType

client_guid

The unique id for a client.

Required
String

Request sample

Language:shell

_10
curl -L -X POST 'https://int-api.mx.com/clients/{client_guid}/api_keys/rotate' \
_10
-H 'Accept: application/vnd.mx.api.v1+json' \
_10
-H 'Authorization: Basic BASE_64_ENCODING_OF{client_id:api_key}'

Response sample

200
Language:json

_10
{
_10
"api_key": {
_10
"api_key": "abcd1234",
_10
"client_guid": "CLT-123",
_10
"client_id": "external-id",
_10
"guid": "APK-123"
_10
}
_10
}