---
title: "List the grants held by a subject (membership or group)"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List the grants held by a subject (membership or group)

Path: CloudRaker Workspace API › Authorization

`GET /authorization/grants/subject`

Lists every role grant held by one subject — what a membership or group has been shared. Authorization: org admin, EXCEPT a non-admin member may inspect their OWN membership’s grants (when the query’s `organizationMembershipId` equals the caller’s); any other subject requires admin, otherwise 403 `forbidden`. Query names EXACTLY ONE of `organizationMembershipId` or `groupId`. Returns the subject’s grants.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Query parameters

- `organizationMembershipId` (`listSubjectGrants.query.organizationMembershipId`; string, optional)
  - minLength 1
- `groupId` (`listSubjectGrants.query.groupId`; string, optional)
  - minLength 1

## Code samples

### cURL

```bash
curl --request GET \
  --url https://api.cloudraker.com/authorization/grants/subject \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/authorization/grants/subject';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/authorization/grants/subject"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The resources and roles granted to the subject.

#### Example

```json
{
  "assignments": [
    {
      "property1": null,
      "property2": null
    }
  ]
}
```

- `assignments` (`listSubjectGrants.response.200.assignments`; array<map<unknown>>, required) — Every grant the subject holds. Shape mirrors `RoleGrant` plus provider extras.

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`listSubjectGrants.response.400.success`; boolean, required)
  - one of `false`
- `error` (`listSubjectGrants.response.400.error`; array<unknown>, required)
- `data` (`listSubjectGrants.response.400.data`; unknown, required)

### 403

Non-admin caller requested a subject other than their own membership


Source: https://docs.cloudraker.com/workspace/api/authorization/list-subject-grants/index.md
