SimplyFill.

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

NameTypeDescription
file_idstringFile 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

HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="<original-name>.pdf"
Content-LengthSize 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

Statuserror codeCause
404file_not_foundBad file ID, or you don't own it.
410file_expiredThe 24-hour download window has elapsed.

On this page