# List a trip's document folders

> Lists a trip's document folders by name, each with how many documents it holds, in one page.

`GET /v1/trips/{tripId}/document-folders`

Lists a trip's document folders by name, each with how many documents it holds, in one page. Documents name their folder in `folderId`.

**Permissions:** `documents:read` · **Kind:** read · **Cost:** 1 unit



## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `tripId` | uuid | yes |  |

## Query parameters

_None._

## Response `200`

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | "list" | yes |  |
| `data` | object[] | yes |  |
| `data[].object` | "document_folder" | yes |  |
| `data[].id` | uuid | yes |  |
| `data[].tripId` | uuid | yes |  |
| `data[].name` | string | yes |  |
| `data[].documentCount` | integer | yes | Ready documents filed in it. ≥ 0 |
| `data[].createdAt` | string | yes |  |
| `nextCursor` | string \| null | yes |  |

## Errors

Errors are [problem details](https://api.bymundi.com/docs/guides/errors.md). Besides the refusals described above, any call like this one can return:

- [`invalid_request`](https://api.bymundi.com/problems/invalid_request.md) — Invalid request
- [`unauthorized`](https://api.bymundi.com/problems/unauthorized.md) — Missing or invalid API key
- [`insufficient_scope`](https://api.bymundi.com/problems/insufficient_scope.md) — Missing permission
- [`rate_limited`](https://api.bymundi.com/problems/rate_limited.md) — Rate limit reached
- [`not_found`](https://api.bymundi.com/problems/not_found.md) — Not found

## Examples

#### curl

```bash
curl https://api.bymundi.com/v1/trips/$TRIP_ID/document-folders \
  -H "Authorization: Bearer $BYMUNDI_KEY"
```

#### JavaScript

```javascript
const res = await fetch(`https://api.bymundi.com/v1/trips/${tripId}/document-folders`, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.BYMUNDI_KEY}`,
  },
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();
```

#### Python

```python
import os, uuid, requests

res = requests.get(
    f"https://api.bymundi.com/v1/trips/{tripId}/document-folders",
    headers={"Authorization": f"Bearer {os.environ['BYMUNDI_KEY']}"},
)
res.raise_for_status()
data = res.json()
```
