Skip to main content
Async jobs run captures on a supervised worker instead of inside your HTTP request. Use them for PDFs, slow pages, or any capture that must survive client timeouts. All job endpoints live on https://screenshotly.app and use the same API key headers as synchronous capture.

Queue a capture

POST /api/jobs accepts exactly the same body as POST /api/screenshot, including plan-gated fields.
The request is validated, checked against your plan and rate limits, encrypted, and committed to the queue before the API responds 202 Accepted:
statusUrl is a path on https://screenshotly.app; the same value is sent in the Location header.

Idempotency

Send an Idempotency-Key header to make client retries safe. Keys are scoped to the workspace, up to 200 printable ASCII characters, and cannot contain spaces. If a job with the same key already exists, the API returns 200 with that original job and "replayed": true instead of creating a new one. The request body of a replay is not compared with the original, so use a new key for a different capture.

Poll for the result

resultUrl is a signed download link that expires 15 minutes after the job is read. Read the job again to get a fresh link. The stored file itself is kept until asset.expiresAt, which follows the account’s retention setting (1–30 days, 7 by default).
To avoid polling, add a webhook to the capture body. The worker sends screenshot.completed with a 24-hour download link, or screenshot.failed after the last attempt. See Webhooks.

Retries and failures

A failed attempt is retried automatically, up to three attempts in total, after 5 seconds and then 15 seconds. Workers claim jobs atomically and recover jobs whose worker stopped sending heartbeats. While a retry is pending, the job is QUEUED with errorCode: "CAPTURE_RETRY". After the final attempt it becomes FAILED with errorCode: "CAPTURE_FAILED". Only a successful job consumes capture allowance. Each POST counts once toward per-minute throughput, whatever the number of captures it contains.

Cancel a job

The API responds {"id": "…", "status": "CANCELED"}. A queued job is canceled immediately. A running job may finish its current browser operation first; the worker then discards the output and marks the job CANCELED. Jobs that have already finished return 404.

Batch captures

Growth and Scale workspaces can queue up to 20 captures in one request. Each item accepts the full capture body:
  • The whole batch is validated first. If any item is invalid, unsafe, or needs a higher plan, nothing is queued.
  • The batch is rejected with 429 if it contains more captures than your remaining allowance.
  • With an Idempotency-Key (up to 180 characters), each item gets the key <key>:<index>, so a retried batch replays the same jobs. The response is 200 when every job was replayed, otherwise 202.

Errors

Job endpoints use the same error shapes as synchronous capture, plus: