# Get a document download URL `GET /api/v1/documents/{id}/download` Returns the URL of a document's attachment. Use the returned URL to fetch the file. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Documents → Read**. ## Headers - `X-Sport-Id` (integer, required) — The sport ID from [List sports](/api/sports/list.md). Use the sport the record belongs to. ## Path parameters - `id` (integer, required) — ID of the document. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request GET \ --url "https://api.asdincloud.com/api/v1/documents/${ID:?Set ID}/download" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" ``` ## Response **200 OK** Returns the record in `item` and the file URL in `url`. A protected file may have a temporary URL. Example with fictional data and selected fields. ```json { "message_key": "entities.document.messages.document_ready", "item": { "id": 31, "sport_id": 3, "belongs_to": "athlete", "belongs_obj_id": 42, "name": "Registration consent", "doc_number": "DOC-DEMO-001", "released_at": 1788220800, "expires_at": 1819756800, "is_medical": false, "got_paper": true, "url": "https://files.example.com/demo-consent.pdf", "notes": "Paper copy received." }, "url": "https://files.example.com/demo-consent.pdf" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The document or its attachment was not found. - `400` — The URL could not be prepared.