/docs/components/batch-export/single-download
Single Download
POST one export identifier and receive either the file stream or the exported URL.
This route resolves one export and returns either the file or the exported URL.
- Method: `POST`
- Path: `/viewer/exports/download`
- Content-Type: `application/json`
- Auth header: `x-api-key: CLIENT_API_KEY` when the backend protects export routes. If you need to issue or manage that client key, see API Key Management Overview.
- Base URL example: `https://db-backend-domain/api`
Send `sourceFileUrl` in the body.
Request examples
Call the same route in one of two ways depending on the response you need.
Without responseType
With responseType=urls
The same route supports binary download mode and JSON URL mode.
- Default: backend returns the actual file stream.
- URL mode: `POST /viewer/exports/download?responseType=urls` returns JSON.
- URL response shape: `{ "success": true, "exportedUrl": "https://..." }`
Do not use the same response parsing logic for both modes.
- Default mode: read the response as a blob and trigger browser download.
- URL mode: read the response as JSON.
- Filename source: prefer `Content-Disposition` when the backend provides it.
- Fallback: only use a generic client-side default such as `canvas-export` when the header is missing or unreadable.
Use separate client examples for the default download response and the URL-only response.
Without responseType
With responseType=urls
