List role assignments
Changed onReturns a paginated list of role assignments. This endpoint is admin-only: the caller's bearer token must belong to a user with the admin or read-only admin role. Non-admin callers receive 403.
Mirrors the GraphQL directRoleAssignments query and shares the same underlying code path, so pagination order, sort default (first_granted_at DESC), and the set of grants returned are identical across the two surfaces.
The REST filter surface is intentionally narrower on first ship — sort, risk-factor filters, text search, access-scope filters, the agents/humans toggle, and access-level filtering are deferred to a future revision. For a single entity/principal pair, the per-pair endpoints — /resources/{resource_id}/users, /resources/{resource_id}/groups, /resources/{resource_id}/non-human-identities, /groups/{group_id}/users, /groups/{group_id}/containing-groups — are often simpler.
Request
- Base URLhttps://api.opal.dev/v1
- AuthHTTP bearer
Query parameters
Filter to grants on these entity (resource or group) IDs. Any-match.
Filter to grants with these principal (user, group, or resource) IDs. Any-match.
Entity type for a role assignment. Entities are the resources or groups access is granted on.
Filter by entity type. Omit to include both RESOURCE and GROUP entities.
The type of an entity.
Filter by principal type. Omit to include USER, GROUP, and RESOURCE principals.
The pagination cursor value.
Number of results to return per page. Default is 200.
Response
Paginated list of role assignments.
Example response
{
"next": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
"previous": "cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ",
"results": [
{
"id": "29827fb8-f2dd-4e80-9576-28e31e9934ac",
"entity_id": "1b978423-db0a-4037-a4cf-f79c60cb67b3",
"entity_type": "RESOURCE",
"principal_id": "e8581682-04f7-473a-a419-472f0fb26d46",
"principal_type": "USER",
"granted_at": "2024-07-10T19:21:00Z"
}
]
}Changes
- info
endpoint added
- info