# Get a document

> Returns one document — also a `pending` one, so you can check an upload you started.

`GET /v1/documents/{documentId}`

Returns one document — also a `pending` one, so you can check an upload you started. Its bytes are at GET /documents/{documentId}/download.

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



## Path parameters

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

## Query parameters

_None._

## Response `200`

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | "document" | yes |  |
| `id` | uuid | yes |  |
| `tripId` | uuid | yes |  |
| `folderId` | uuid \| null | yes | The folder it is filed in; null = loose (in no folder). |
| `name` | string | yes |  |
| `mimeType` | string | yes |  |
| `byteSize` | integer | yes | ≥ 0 |
| `status` | "pending" \| "ready" | yes | `pending`: reserved, the upload is not complete — never listed. `ready`: a document. |
| `visibility` | "staff" \| "traveler" | yes | `staff`: internal, only the agency sees it. `traveler`: released to the trip's travelers. |
| `visibleToTravelersNow` | boolean | yes | Released AND the trip is published: the traveler's app shows it right now. |
| `visibleAt` | string \| null | yes | When it was last released to travelers; null while internal. |
| `visibleBy` | object \| null | yes |  |
| `visibleBy.id` | string | yes |  |
| `visibleBy.name` | string \| null | yes |  |
| `uploadedBy` | object \| null | yes |  |
| `uploadedBy.id` | string | yes |  |
| `uploadedBy.name` | string \| null | yes |  |
| `createdAt` | string | yes |  |
| `updatedAt` | string | yes |  |
| `appUrl` | string \| null | yes | The trip's Documents tab in bymundi. |

## 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/documents/$DOCUMENT_ID \
  -H "Authorization: Bearer $BYMUNDI_KEY"
```

#### JavaScript

```javascript
const res = await fetch(`https://api.bymundi.com/v1/documents/${documentId}`, {
  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/documents/{documentId}",
    headers={"Authorization": f"Bearer {os.environ['BYMUNDI_KEY']}"},
)
res.raise_for_status()
data = res.json()
```
