---
title: "listGrants"
---

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

# listGrants

Path: agenthold API › sharing

`GET /agents/{agentId}/grants`

URL: `/api/v1/agents/{agentId}/grants`

Who has access to the agent, including implicit access (owner, workspace owners and admins).

## Authentication

Requires one of the following:

- `session`, apiKey, in cookie
- `token`, http bearer, header `Authorization`

## Path parameters

- `agentId` (`listGrants.path.agentId`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/api/v1/agents/<agentId>/grants' \
  --cookie 'agenthold_session=<agenthold_session>'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/agents/<agentId>/grants';
const options = {
  method: 'GET',
  headers: {cookie: 'agenthold_session=<agenthold_session>'}
};

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

### Python

```python
import requests

url = "<base-url>/api/v1/agents/<agentId>/grants"

headers = {"cookie": "agenthold_session=<agenthold_session>"}

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

print(response.text)
```

## Responses

### 200

Access list.

#### Example

```json
{
  "grants": [
    {
      "id": "string",
      "subjectType": "user",
      "user": {
        "id": "string",
        "email": "string",
        "name": "string",
        "avatarUrl": "string"
      },
      "role": "viewer",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ],
  "effective": [
    {
      "user": {
        "id": "string",
        "email": "string",
        "name": "string",
        "avatarUrl": "string"
      },
      "role": "viewer",
      "via": "owner"
    }
  ]
}
```

- `grants` (`listGrants.response.200.grants`; array of object, required)
  - `id` (`listGrants.response.200.grants.id`; string, required)
  - `subjectType` (`listGrants.response.200.grants.subjectType`; string, required)
    - one of `"user"`, `"workspace"`
  - `role` (`listGrants.response.200.grants.role`; string, required)
    - one of `"viewer"`, `"operator"`, `"admin"`
  - `createdAt` (`listGrants.response.200.grants.createdAt`; string, required)
    - format: `date-time`
  - `user` (`listGrants.response.200.grants.user`; object, optional)
    - `id` (`listGrants.response.200.grants.user.id`; string, required)
    - `email` (`listGrants.response.200.grants.user.email`; string, required)
    - `name` (`listGrants.response.200.grants.user.name`; string, required)
    - `avatarUrl` (`listGrants.response.200.grants.user.avatarUrl`; string, required)
- `effective` (`listGrants.response.200.effective`; array of object, required) — Every workspace member with access and their effective role.
  - `user` (`listGrants.response.200.effective.user`; object, required)
    - `id` (`listGrants.response.200.effective.user.id`; string, required)
    - `email` (`listGrants.response.200.effective.user.email`; string, required)
    - `name` (`listGrants.response.200.effective.user.name`; string, required)
    - `avatarUrl` (`listGrants.response.200.effective.user.avatarUrl`; string, required)
  - `role` (`listGrants.response.200.effective.role`; string, required)
    - one of `"viewer"`, `"operator"`, `"admin"`
  - `via` (`listGrants.response.200.effective.via`; string, required)
    - one of `"owner"`, `"workspace_admin"`, `"grant"`, `"workspace_grant"`

### 404

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`listGrants.response.404.error`; string, required)


Source: https://agenthold.dev/api/list-grants/index.md
