List Roles

GET /v1/account/roles

List every role defined in your active account, each with its full permission matrix. Roles are how you grant teammates scoped access — a role bundles a yes/no decision for each action on each resource, and you assign one role to each member.

The response also echoes the canonical list of resource keys (resources) so a UI can render one matrix row per resource without hard-coding the list.

Permission required

Requires roles:read. The account owner always passes — the owner holds every permission implicitly (an "all access" identity that is not represented as a role), so the owner can read, create, update and delete roles regardless of any matrix.

Query parameters

page int optional
1-based page number. Omit it to get every role in one response.
page_size int optional
Roles per page when page is sent. Default 15, capped at 200.

The permission matrix

Each role carries one permissions entry per resource. Every entry exposes four independent booleans — the verbs:

can_read read
View / list the resource.
can_write write (create)
Create new instances of the resource. write means create.
can_update update
Modify existing instances.
can_delete delete
Remove instances.

The resource keys are: endpoints, domains, certs, ips, firewall, rate_limits, traffic_inspector, members, roles, settings, billing.

Response (200 OK)

roles array
All roles in the active account, ordered by name. Each element is a role object (below).
resources string[]
The canonical, ordered list of resource keys the matrix can address. Use it to render the role editor.
page, page_size int
The page returned and the effective page size. Both 0 when page was not sent (the whole list).
total int
Number of roles across all pages.

Role object

uuid string (uuid)
The role's public id. Pass it as role_uuid when assigning the role to a member or inviting someone.
account_uuid string (uuid)
The uuid of the account the role belongs to.
name string
Display name (e.g. "Billing Admin").
description string?
Optional free-text description. Omitted when not set.
is_builtin bool
true for a built-in role shipped with the account. Built-in roles cannot be deleted. The account owner is separate from roles entirely — the owner is identified on the membership, not by a role.
member_count int
Number of active members currently assigned this role. A role with member_count > 0 cannot be deleted until those members are reassigned.
permissions array
The matrix — one entry per resource with role_uuid, resource, can_read, can_write, can_update, can_delete.
created_at, updated_at datetime
When the role was created and last edited, RFC 3339 UTC.

Deprecated: until the sunset each role also carries the legacy integer id and account_id, and each permission row its integer id and role_id. Don't use them; read uuid and the *_uuid fields.

Errors

401 Unauthorized
Missing or invalid auth.
403 Forbidden
No active account, or your role lacks roles:read.
500
Failed to load roles.
Request
curl "https://api.ngris.com/v1/account/roles?page=1&page_size=15" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") roles = client._get_raw("/account/roles") for role in roles["roles"]: print(role["name"], role["member_count"])
Response — 200 OK
{ "roles": [ { "uuid": "019a9e4e-0c47-7ca0-a55a-00a4a0094d0e", "account_uuid": "019a68b9-1a79-7820-a884-41f554aba6bd", "name": "Billing Admin", "description": "Manage billing only", "is_builtin": false, "created_at": "2026-03-02T10:15:00Z", "updated_at": "2026-03-02T10:15:00Z", "member_count": 2, "permissions": [ { "role_uuid": "019a9e4e-0c47-7ca0-a55a-00a4a0094d0e", "resource": "billing", "can_read": true, "can_write": true, "can_update": true, "can_delete": false }, { "role_uuid": "019a9e4e-0c47-7ca0-a55a-00a4a0094d0e", "resource": "endpoints", "can_read": true, "can_write": false, "can_update": false, "can_delete": false } ] } ], "resources": [ "endpoints", "domains", "certs", "ips", "firewall", "rate_limits", "traffic_inspector", "members", "roles", "settings", "billing", "databases", "database_data" ], "page": 1, "page_size": 15, "total": 1 }
Was this helpful?
On this page
List Roles
Was this helpful?