Download a PDF

Once a job is completed, you can either stream the file through PDFox (using your API key) or get a signed, credential-free download URL to share with users.

Stream via API key

GET /v1/generate/jobs/:jobId/file

The response is the raw PDF binary (Content-Type: application/pdf), with Content-Disposition: attachment set to the document filename. Requires an Authorization header with the document:read scope. Use this when downloading server-side.

Signed download URL

GET /v1/generate/jobs/:jobId/download

Returns url and expiresIn (seconds). The url points at the /file endpoint with a signed token query parameter already included — use it as-is. No Authorization header needed, so it's safe for browser redirects or <a href> links.

Signed URLs expire after 1 hour. Don't store them — request a fresh one with your API key when needed.

Errors

Both endpoints return 422 JOB_NOT_COMPLETED while the job is still queued or processing, and 422 JOB_FAILED (with the job's error as the message) if it failed. A job or document that doesn't exist returns 404 NOT_FOUND.

Webhook download URL

The webhook payload also includes a downloadUrl — the same kind of signed URL, valid for 1 hour, delivered automatically when the job completes.

# Stream the file directly (requires Authorization header)
curl https://api.pdf-fox.com/v1/generate/jobs/7c9e6679-7425-40de-944b-e07fc1f90ae7/file \
  -H "Authorization: Bearer pdfs_a1b2c3d4_xxxx" \
  -o invoice.pdf