Generate a document
Creates a PDF from a template and data. Needs the scope generate. With no preference, the API holds the request up to 30 seconds. The whole job runs in the request, so it must end within 55 seconds. With Prefer: respond-async, the API holds the request until the job ends, at most 30 seconds, then answers 202. With Prefer: wait=N below 25, the limit is N + 30 seconds.
Authentication
An API key (crk_), an exchanged token (crt_) or a JWT of a trusted issuer. The credential needs the scope of the capability. Read the description of each route.
Headers
wait=N (1 to 90) holds the request up to N seconds. respond-async answers 202 at once. Behind a proxy with a 60 second idle timeout, use wait=55 or less.
A key that makes a retry safe, valid for 24 hours. The same key with another body gives 409 idempotency_key_reused.
Query parameters
The alias of Prefer: wait=N. The Prefer header wins when both are there.
Request
Where the API sends the webhook of the job. Each delivery has an x-cr-signature header: a JWT that you verify with the JWKS of the tenant.
Only asap. Other values give 400 deadline_not_supported.
Response headers
The id of the request: req_ and a ULID. Every answer has it.
true when the answer replays an earlier request with the same key.
Response
The job ended. A failed job also answers 200. Accept: text/event-stream streams the events of the job as server-sent events: job.progress, job.needs_input, job.succeeded, job.failed, job.cancelled, job.expired. A terminal event carries the job and ends the stream.
job_ and a ULID.
Only asap at this time.
Machine jobs only. What the job waits for while its status is needs_input, else null. The other jobs do not have this field.