# Retrieve a document's download link

Operation ID: `downloadDocument`

Group: People Management › Documents

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/endpoints/downloadDocument)

`GET /people/documents/{id}/download`

Read-only: Reads and returns; changes nothing.

Retrieves a download link for a document. The response contains a short-lived link, not the file itself. Request a new link each time you start a download instead of saving the link.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |
| `id` | path | string | yes | The unique identifier of the document you want to download. |

## Response

`200` Success

Under `data` (downloadDocumentOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the document the link points at. |
| `fileName` | string | yes | The stored file name of the document. Save the downloaded bytes under it. |
| `mimeType` | string | no | The MIME type of the stored file. Absent when storage does not report one. |
| `fileSizeBytes` | number | no | The size of the stored file in bytes. Absent when storage does not report one. |
| `downloadUrl` | string | yes | A short-lived pre-signed URL the file's bytes are fetched from. It expires and is not a stable link. |

```json
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "fileName": "<fileName>",
    "mimeType": "<mimeType>",
    "fileSizeBytes": 0,
    "downloadUrl": "<downloadUrl>"
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Errors

| Code | Status |
| --- | --- |
| `NOT_FOUND` | 400 |
| `FILE_UNAVAILABLE` | 400 |

## Statuses

- `400` — Invalid request or business failure. Codes: NOT_FOUND, FILE_UNAVAILABLE
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
