Delete Role
Delete a custom role from your active account. Deleting a role also removes its permission matrix.
Two safeguards apply:
- Built-in roles cannot be deleted. The account owner is not a role at all (the owner is identified on the membership and holds every permission implicitly), so there is nothing to delete there either.
- A role that is still in use is rejected. If any active member is assigned the role, the request fails — reassign those members to another role first, then delete. The number of members on a role is visible as
member_countin List Roles.
Permission required
Requires roles:delete. The account owner always passes — the owner holds every permission implicitly.
Path parameters
id int64 Req
Numeric ID of the role to delete. Must belong to your active account.
Response (200 OK)
success bool
true when the role was deleted.Errors
400 Bad Request
Invalid role id, the role is in use by one or more members (reassign them first), the role is built-in, or the role does not exist in your active account.
401 Unauthorized
Missing or invalid auth.
403 Forbidden
No active account, or your role lacks
roles:delete.Request
curl -X DELETE "https://api.ngris.com/v1/account/roles/12" \
-H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris
client = Ngris(api_key="<your_api_key>")
client.account.delete_role(role_id=12)
Response — 200 OK
{
"success": true
}
Response — 400 (role in use)
{
"error": "role is in use by 2 member(s); reassign them first"
}