Roll an API key
roll_api_keyReplace a site key with a new secret that has the same name and scopes, for example after a leak. The old key stops at once, or after grace_seconds (at most 86400, 24 hours) so a deploy can switch over. The new secret is NOT returned here, so it never enters the chat: the person copies it once in the dashboard (Settings → API & MCP) within 24 hours. Needs the admin scope and confirm: true; without confirm the tool only describes what it would do.
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": {
"key_id": "<key_id>"
},
"name": "roll_api_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Site domain (example.com), id or public id (tb_…). Optional with a site key, or when the account has one site. | |
| key_id | Yes | The key id from list_api_keys. | |
| confirm | No | Set to true to really do it. Without it, the tool only describes what it would do. | |
| grace_seconds | No | How long the old key keeps working. Default 0 (stops at once). |