Permissions Service

List Authorized Principals For Resource

POST
Admin endpoint to list all users that are authorized to perform the specified action on the specified resource.

Request

This endpoint expects an object.
resource
objectRequired
The resource identifier for which you want to list authorized users.
action
enumRequired
The action you want to perform on the resource.
Allowed values: READ
pageSize
integerOptional
The maximum number of principals to return. Defaults to 10.
pageToken
stringOptional
A token provided by the server to request the next page of users. If not specified, the first page of results will be returned.

Response

This endpoint returns an object
principals
list of unions
nextPageToken
stringOptional
POST
$curl -X POST https://api.credal.ai/api/v0/permissions/listAuthorizedPrincipalsForResource \
> -H "Authorization: Bearer <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "resource": {
> "resourceId": "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
> "resourceType": "GOOGLE_DRIVE"
> },
> "action": "READ"
>}'
Response
1{
2 "principals": [
3 {
4 "type": "user",
5 "email": "john.smith@foo.com",
6 "id": "123456",
7 "name": "John Smith"
8 },
9 {
10 "type": "user",
11 "email": "jane.smith@foo.com",
12 "id": "789012",
13 "name": "Jane Smith"
14 },
15 {
16 "type": "group",
17 "name": "Engineering",
18 "id": "345678"
19 }
20 ]
21}