keys
Remove key roles
Remove roles from a key without affecting direct permissions or other roles.
Use this for privilege downgrades, removing temporary access, or subscription changes that revoke specific role-based capabilities. Direct permissions remain unchanged.
Important: Changes take effect immediately with up to 30-second edge propagation.
Required Permissions
Your root key must have one of the following permissions:
- api.*.update_key (to update keys in any API)
- api.<api_id>.update_key (to update keys in a specific API)
Side Effects
Invalidates the key cache for immediate effect, and makes role changes available for verification within 30 seconds across all regions.
post/v2/keys.removeRoles
Request body
Example request
{
"keyId": "key_2cGKbMxRyIzhCxo1Idjz8q"
}Response
Roles removed successfully. Returns all roles currently assigned to the key.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": [
{
"id": "role_1234567890abcdef",
"name": "support.readonly",
"description": "Provides read-only access for customer support representatives to view user accounts and support tickets",
"permissions": [
{
"id": "perm_1234567890abcdef",
"name": "users.read",
"slug": "users-read",
"description": "Allows reading user profile information and account details"
}
]
}
]
}