curl --request GET \
--url https://api.opal.dev/v1/role-assignments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/role-assignments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opal.dev/v1/role-assignments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opal.dev/v1/role-assignments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.opal.dev/v1/role-assignments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.opal.dev/v1/role-assignments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/role-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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:00.000Z"
}
]
}List role assignments
Returns 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.
curl --request GET \
--url https://api.opal.dev/v1/role-assignments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/role-assignments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opal.dev/v1/role-assignments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opal.dev/v1/role-assignments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.opal.dev/v1/role-assignments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.opal.dev/v1/role-assignments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/role-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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:00.000Z"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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.
Filter by entity type. Omit to include both RESOURCE and GROUP entities. Entity type for a role assignment. Entities are the resources or groups access is granted on.
GROUP, RESOURCE "RESOURCE"
Filter by principal type. Omit to include USER, GROUP, and RESOURCE principals. The type of an entity.
GROUP, RESOURCE, USER "GROUP"
The pagination cursor value.
Number of results to return per page. Default is 200.
x <= 1000Response
Paginated list of role assignments.
A paginated page of role assignments.
Show child attributes
Show child attributes
The cursor with which to continue pagination if additional result pages exist.
"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw"
The cursor used to obtain the current result page.
"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ"
Was this page helpful?