GET Download Job File
Download a file artifact produced by a Wire task
GET
https://api.anakin.io/v1/wire/jobs/{id}/downloadDownload a file produced by a completed Wire task, for actions that return a file (e.g. a PDF) rather than inline JSON. When a result is a file, GET /jobs/{id} returns data: null with a files manifest; this endpoint streams the actual bytes.
The response body is the file — not JSON. It sets Content-Type and Content-Disposition: attachment; filename="…". Write it to disk; do not JSON-parse a successful response.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id required | string | The job ID returned from POST /v1/wire/task |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
file | string | For a multi-file result, the name of the file to download (from the files manifest in GET /jobs/{id}). Omit to stream the primary file. |
Response — Success
200 OKThe raw file bytes, with headers describing the file:
Content-Type: application/pdf
Content-Disposition: attachment; filename="statement-2026-07-15.pdf"
Content-Length: 128623Response — Error
400 Bad RequestErrors are returned as JSON (only the success body is binary), so branch on the status code before treating the body as a file:
{
"status": "error",
"error": { "code": "NO_DOWNLOAD", "message": "Result is not available for download." }
}Error Responses
| Code | HTTP | When |
|---|---|---|
NO_DOWNLOAD | 400 | The job has no downloadable result, or ?file=<name> doesn't match any file in the manifest |
NOT_FOUND | 404 | The job doesn't exist, or belongs to another user |
Multi-file results
A job can return more than one file. List them from GET /jobs/{id} (files), then download each by name:
curl "https://api.anakin.io/v1/wire/jobs/{id}/download?file=statement.pdf" -H "X-API-Key: your_api_key" -o statement.pdf
curl "https://api.anakin.io/v1/wire/jobs/{id}/download?file=usage.csv" -H "X-API-Key: your_api_key" -o usage.csvCode Examples
curl https://api.anakin.io/v1/wire/jobs/7c3f1a2b-4d5e-6f7a-8b9c-0d1e2f3a4b5c/download \
-H "X-API-Key: your_api_key" \
-o result.pdfimport requests
job_id = '7c3f1a2b-4d5e-6f7a-8b9c-0d1e2f3a4b5c'
resp = requests.get(
f'https://api.anakin.io/v1/wire/jobs/{job_id}/download',
headers={'X-API-Key': 'your_api_key'},
)
resp.raise_for_status()
with open('result.pdf', 'wb') as f:
f.write(resp.content) # raw bytes — do not resp.json()const jobId = '7c3f1a2b-4d5e-6f7a-8b9c-0d1e2f3a4b5c';
const res = await fetch(`https://api.anakin.io/v1/wire/jobs/${jobId}/download`, {
headers: { 'X-API-Key': 'your_api_key' },
});
const blob = await res.blob(); // raw bytes — not res.json()
// In a browser, trigger a download:
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'result.pdf';
a.click();
URL.revokeObjectURL(url);