Update Role

PUT /v1/account/roles/{uuid}

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

uuid string (uuid) Req
The uuid of the role to update (from /account/roles). Must belong to your active account.

Deprecated: the legacy integer id is still accepted in the path until the sunset, answered with Deprecation and Sunset headers. Use the uuid.

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 (uuid, account_uuid, …) with its new permissions matrix (each row carries role_uuid).

Deprecated: until the sunset this response also carries the legacy integer id and *_id fields. Don't use them; read uuid and the *_uuid fields.

Errors

400 Bad Request
Missing name, an unknown / duplicate resource key, or an integer id after the sunset (integer_id_unsupported).
401 Unauthorized
Missing or invalid auth.
403 Forbidden
No active account, or your role lacks roles:update.
404 Not Found
No role with that uuid in your active account (another account's role reads the same).
Request
curl -X PUT "https://api.ngris.com/v1/account/roles/019a9e4e-0c47-7ca0-a55a-00a4a0094d0e" \ -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._put_raw("/account/roles/019a9e4e-0c47-7ca0-a55a-00a4a0094d0e", { "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": { "uuid": "019a9e4e-0c47-7ca0-a55a-00a4a0094d0e", "account_uuid": "019a68b9-1a79-7820-a884-41f554aba6bd", "name": "Billing Admin", "description": "Full billing access", "is_builtin": false, "member_count": 2, "permissions": [ { "role_uuid": "019a9e4e-0c47-7ca0-a55a-00a4a0094d0e", "resource": "billing", "can_read": true, "can_write": true, "can_update": true, "can_delete": true } ] } }
Was this helpful?
On this page
Update Role
Was this helpful?