Documentation

Documents

Get the PDF

GET/generations/{id}/pdf

The document's PDF, rendered once on our servers, as a short-lived download URL. If nothing is stored yet, the call renders it on demand and answers when done, usually within a few seconds; if a render is already in flight elsewhere, it answers 202 and you ask again shortly.

Parameters

NameTypeDescription
idrequireduuidThe document's id.
download1Make the URL an attachment named after the document.
redirect1Answer a 302 to the URL instead of JSON.

Request

curl "https://usepaperclerk.com/api/v1/generations/9b8e2f10-5c4d-4e3f-8a7b-6c5d4e3f2a1b/pdf?download=1" \
  -H "Authorization: Bearer pc_YOUR_TOKEN"

Response

JSON
{
  "status": "ready",
  "url": "https://…/generation-pdfs/…/9b8e2f10-5c4d-4e3f-8a7b-6c5d4e3f2a1b.pdf?token=…",
  "pages": 2,
  "expires_in": 60
}
  • The URL stops working after expires_in seconds. Request a fresh one rather than storing it.
  • A render that failed answers 500 with pdf_render_failed; asking again retries it.