Jobs

Submit a durable render job

The same renders as the synchronous endpoints - kind is one of screenshot, pdf, qr, image, clip, site_preview, document or bundle and request is that endpoint's body (an image job names its template inside request) - accepted with 202 and run by a worker. Poll the job, or cancel it, then collect the result while it is hosted: 24 hours, private, through a signed link valid for 15 minutes. A process restart after the 202 never loses the job.

Send Idempotency-Key on every submission. The same key with the same request returns the existing job with 200; the same key with a different request is a 409 idempotency_conflict. external_id is your own reference, up to 120 characters.

Billing: the most the job can count is reserved on your billing account when it is accepted - in the same step, so a job you were told about always holds its reservation, and a refusal leaves no job. The one reservation is kept across retries of the job and committed, with what the job produced, when it succeeds; a site preview reserves the 60 second limit and commits its real length. A job that fails, is cancelled while queued, or is cancelled while running without a usable output, counts nothing. The job's usage says what it holds: {"meter", "reserved", "committed"}.

Capacity: an account may have 1,000 unfinished jobs (queued, running or being cancelled); a job past that is 429 queue_full and is not created. A job that uses the browser runs in one of the account's 2 browser slots, shared with its synchronous renders; while both are busy it waits in the queue rather than being refused.

post/v1/jobs

Request

  • Base URL: https://api.ironfang.com/render
  • URL: https://api.ironfang.com/render/v1/jobs
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Makes a submission safe to retry. Any string up to 255 characters; surrounding whitespace is ignored and a longer key is a 400 bad_request. A key is remembered per account for as long as the job it created exists, and has no expiry of its own. Jobs and batches keep separate key spaces.

A job submitted again under its key returns the existing job with 200 when the request is the same, and is a 409 idempotency_conflict when it differs. A batch submitted again under its key returns the batch the key first created, with its jobs and 202; the request is not compared, so a batch has no conflict response.

Request body

external_idstring
kind'screenshot' | 'pdf' | 'qr' | 'image' | 'clip' | 'site_preview' | 'document' | 'bundle' required
requestobject required

The synchronous endpoint's request body for that kind. For document: {"template": "<id>", "revision": <number>, "data": {...}}, the revision optional. The revision is resolved when the job is accepted - the published one unless named - and the job renders it on every attempt, however the template changes meanwhile. The data is checked against that revision's schema then: problems are a 422 data_invalid with fields.

Example request

{
  "delivery": {
    "storage_key": "captures/{external_id}/{job_id}.png"
  }
}

Response

The same Idempotency-Key and request were seen before; this is that job.

Changes

No recorded changes to this operation across all 1 revision of this API.