Documents
Download Document
Download a lab report document by file ID
GET
/
api
/
v1
/
documents
/
{id}
curl --request GET \
--url https://anivahealth.com/api/v1/documents/f8a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c \
--header 'x-api-key: YOUR_API_KEY' \
--output lab-report.pdf
(Binary file content — save the response to a file)
{
"error": "Document not found"
}
Download a lab report document by its file ID. Returns the raw file bytes with the appropriate
Content-Type header. Document IDs are obtained from the documents array in the Get Lab Results response.
Requires the results_view scope.
Access is validated against the profile that owns the document.
Request
Path parameters
string
required
File ID (UUID) from the
documents array in the appointment results response.Response
On success, the API returns200 OK with the file bytes and four headers. Each header carries a field of the documents array:
| Header | Field | Example |
|---|---|---|
Content-Type | content_type | application/pdf |
Content-Disposition | file_name | attachment; filename="20260405 - Quade Befund - 7642001234.pdf" |
ETag | etag (quoted) | "56104b36f860cfd5b41efc716fdf7b6f" |
Original-File-Name | original_file_name | 7642001234_B0012_FA_E.pdf |
Original-File-Name is percent-encoded UTF-8, because a header cannot carry every character an uploaded name can contain. Decode it with decodeURIComponent or an equivalent.
ETag and If-None-Match are the standard HTTP caching headers (RFC 9110). Send the etag you hold in If-None-Match to skip an unchanged file. The API then answers 304 Not Modified with no body.
Error responses
| Status | Description |
|---|---|
304 | Not modified — the If-None-Match etag still matches the file. No body. |
400 | Invalid ID format — the provided value is not a valid UUID. |
403 | Forbidden — your API key does not have access to this operation or the document is outside your access context. |
404 | Document not found. |
500 | Internal server error. |
curl --request GET \
--url https://anivahealth.com/api/v1/documents/f8a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c \
--header 'x-api-key: YOUR_API_KEY' \
--output lab-report.pdf
(Binary file content — save the response to a file)
{
"error": "Document not found"
}
⌘I
curl --request GET \
--url https://anivahealth.com/api/v1/documents/f8a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c \
--header 'x-api-key: YOUR_API_KEY' \
--output lab-report.pdf
(Binary file content — save the response to a file)
{
"error": "Document not found"
}