# List Genie access grants

> Who holds a role on a Genie: the users and groups its sharing dialog lists, as Set a Genie access grant sets them.

Source: https://docs.stacksync.com/api-reference/genies/access-grants/list_genie_access_grants

`GET https://api.stacksync.com/v1/workspaces/{workspace_id}/genies/{genie_id}/access-grants`

- Operation: `list_genie_access_grants`
- Resource: Genie access grants
- Access: read-only

## Authentication

- `Authorization: Bearer <key>`: A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace. List the ones your key can reach with GET /v1/workspaces. |
| `genie_id` | string (uuid) | Yes | The Genie. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `region` | string (besg \| usnv) | Yes | Region of the genie: besg (Europe) or usnv (United States) |

## Returns

### 200 OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | array of object (GenieAccessGrantSummary) | Yes |  |
| `data[].principal` | object (GenieAccessPrincipal) | Yes |  |
| `data[].principal.type` | string (user \| group) | Yes |  |
| `data[].principal.id` | string, 1 to 64 characters | Yes | The user id or the group id |
| `data[].role` | string | Yes | operator, editor or owner, or the custom_role_id of a custom role |

## Example request

```bash
curl -X GET "https://api.stacksync.com/v1/workspaces/{workspace_id}/genies/{genie_id}/access-grants?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

## Example response (200)

```json
{
  "data": [
    {
      "principal": {
        "type": "user",
        "id": "<id>"
      },
      "role": "<role>"
    }
  ]
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | Bad Request | `{ "error": string, "msg": string, "field": string \| null }` |
| 403 | Forbidden | `{ "error": string, "msg": string, "field": string \| null }` |
| 404 | Not Found | `{ "error": string, "msg": string, "field": string \| null }` |

## Related

- [API Reference overview](https://docs.stacksync.com/api-reference): base URLs, regions, pagination, idempotency and errors
- [Authentication](https://docs.stacksync.com/api-reference/authentication): API keys and the 403 answers
- OpenAPI document: https://docs.stacksync.com/openapi.json
- [Set a Genie access grant](https://docs.stacksync.com/api-reference/genies/access-grants/set_genie_access_grant)