Update Role

PUT /v1/account/roles/{id}

Update a role's name, description and permission matrix. This is a full replacement of the matrix: the permissions you send become the role's complete set, and any resource you omit is reset to no access. To make a single change, send the role's current matrix with the one edit applied.

Changes take effect for every member assigned this role.

Permission required

Requires roles:update. The account owner always passes — the owner holds every permission implicitly.

Path parameters

id int64 Req
Numeric ID of the role to update. Must belong to your active account.

Request body

name string Req
Role display name.
description string
Optional free-text description.
permissions array
The new complete matrix. Each element is { "resource", "can_read", "can_write", "can_update", "can_delete" }. The verbs are read, write (= create), update and delete. Valid resource keys: endpoints, domains, certs, ips, firewall, rate_limits, traffic_inspector, members, roles, settings, billing. Unknown or duplicate keys are rejected; omitted resources are reset to no access.

Response (200 OK)

Returns the updated role under role with its new permissions matrix.

Errors

400 Bad Request
Invalid role id, missing name, or an unknown / duplicate resource key.
401 Unauthorized
Missing or invalid auth.
403 Forbidden
No active account, or your role lacks roles:update.
404 Not Found
No role with that id in your active account.
Request
curl -X PUT "https://api.ngris.com/v1/account/roles/12" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{ "name": "Billing Admin", "description": "Full billing access", "permissions": [ {"resource": "billing", "can_read": true, "can_write": true, "can_update": true, "can_delete": true} ] }'
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") role = client.account.update_role( role_id=12, name="Billing Admin", description="Full billing access", permissions=[ {"resource": "billing", "can_read": True, "can_write": True, "can_update": True, "can_delete": True}, ], ) print(role["role"]["permissions"])
Response — 200 OK
{ "role": { "id": 12, "name": "Billing Admin", "description": "Full billing access", "is_builtin": false, "member_count": 2, "permissions": [ { "resource": "billing", "can_read": true, "can_write": true, "can_update": true, "can_delete": true } ] } }
On this page
Update Role
Iris