Skip to main content
Queue a render and return at once. Get the PDF by webhook, by polling, or both.

Queue a render

POST /v1/render/:slug/async Renders a saved template in the background. Path params: slug — the template’s slug. Body: the template data, plus one reserved key: Every other key goes to the template, as with the sync render. The sync reserved keys s3, save, saveName, and metadata have no special meaning here: an async render does not upload to S3 and does not save to Documents. Those keys are passed to the template as data.

Response

202 Accepted
The template must exist when you queue the job. Otherwise the response is 404. The monthly operation limit is checked when you queue. The operation is counted when the job completes. For a JSX template, the data is embedded in the PDF, as with the sync render.

Webhook

When the job finishes, Forme sends a POST with a JSON body to webhookUrl. On success:
On failure:
  • Delivery is attempted once, with a 10-second timeout. A failed or slow delivery is not retried.
  • The webhook request is not signed. Use a URL that is hard to guess, and check the jobId against jobs you queued. You can also fetch the result with GET /v1/jobs/:jobId using your API key.
  • The job result is kept whether or not the webhook is delivered.

Poll a job

GET /v1/jobs/:jobId Returns the job’s status. Only jobs created with keys of the same account are visible. Polling is not counted as an operation and is not rate-limited.

Response

An unknown job ID returns 404 {"error": "Job not found"}.
A job can fail without a render error, for example when it is interrupted by a service restart. Its error then says so. Queue the render again.