API referenceGenerate
Download generated PDF
Stream a generated PDF by its file ID.
Download generated PDF
Streams a generated PDF. Returns 200 OK with Content-Type: application/pdf and the file bytes in the body.
Signature
GET /api/v1/generate/download/{file_id}Permissions
API key scope: read or higher. Caller must own the underlying generation request.
Path parameters
| Name | Type | Description |
|---|---|---|
file_id | string | File ID returned by POST /generate/pdf or by /generate/status. |
Example
curl -L -o invoice.pdf \
https://api.simplyfill.app/v1/generate/download/f_2nB9d4Z... \
-H "Authorization: Bearer $SIMPLYFILL_API_KEY"import { writeFile } from 'node:fs/promises'
const bytes = await client.generate.download('f_2nB9d4Z...')
await writeFile('invoice.pdf', bytes)pdf_bytes = client.generate.download("f_2nB9d4Z...")
with open("invoice.pdf", "wb") as f:
f.write(pdf_bytes)Response
| Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename="<original-name>.pdf" |
Content-Length | Size in bytes |
The body is the PDF.
Expiry
Download URLs are valid for 24 hours from the time the source generation completed. After expiry, the file is purged from object storage and any download attempt returns 410 Gone. If you need long-lived storage, copy the file to your own bucket within the window.
Errors
| Status | error code | Cause |
|---|---|---|
404 | file_not_found | Bad file ID, or you don't own it. |
410 | file_expired | The 24-hour download window has elapsed. |