Rotate a domain API key
rotate_domain_api_keyReplace a compromised or expiring domain API key with a new value while retiring the old key, optionally keeping it active for a grace period.
Instructions
Issues a brand-new key value for an existing domain API key slot and retires the old value — use this for a compromised or routinely-expiring key without having to update every caller's key id. By default the old key is deactivated immediately; pass keepOldKeyActive:true (with an optional gracePeriodMinutes) to let both work for a transition window. The response's new plaintext apiKey is shown EXACTLY ONCE — surface it to the user immediately. Requires confirm=true — first call WITHOUT confirm to preview, then again with confirm:true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"domainId": "<domainId>",
"keyId": "<keyId>"
},
"name": "rotate_domain_api_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyId | Yes | The key's id — from list_domain_api_keys. | |
| confirm | No | Must be true to rotate. Omit/false returns a preview only. | |
| domainId | Yes | The domain's id — from list_domains. | |
| keepOldKeyActive | No | Keep the old key working for a grace period instead of deactivating it immediately. | |
| gracePeriodMinutes | No | How long the old key stays active when keepOldKeyActive is true. |