Skip to main content
POST
/
v1
/
jobs
Async jobs
curl --request POST \
  --url https://screenshot.cleariflow.com/v1/jobs \
  --header 'Content-Type: application/json' \
  --data '
{
  "request": {},
  "priority": 123
}
'
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}

Getting started

Base URL

https://screenshot.cleariflow.com/v1/jobs

Create a job

Enqueue an async screenshot job with the same ScreenshotRequest payload used by the synchronous endpoint.

Example request

curl -X POST 'https://screenshot.cleariflow.com/v1/jobs' \
  -H 'Content-Type: application/json' \
  -d '{
    "request": {
      "api_key": "YOUR_UNIQUE_API_KEY",
      "url": "https://cleariflow.com"
    },
    "priority": 10
  }'
This successful request returns a job identifier:
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}

Create job parameters

request
Object
required
A ScreenshotRequest object with the same fields as the synchronous screenshot endpoint (url, render, actions, cookies, etc.).
priority
Integer
Job priority. Higher values are processed first. Defaults to 0.

Get job status

Poll a job by ID to check its status and retrieve results when complete.

Base URL

https://screenshot.cleariflow.com/v1/jobs/{job_id}

Example request

curl 'https://screenshot.cleariflow.com/v1/jobs/550e8400-e29b-41d4-a716-446655440000'
While the job is running:
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "running"
}
When the job completes successfully:
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "done",
  "result": {
    "ok": true,
    "image_base64": "/9j/4AAQSkZJRg...",
    "content_type": "image/jpeg",
    "meta": {
      "elapsed_ms": 8123
    }
  }
}

Job status values

StatusDescription
queuedJob is waiting in the queue.
runningBrowser session is active.
doneScreenshot completed; result contains the output.
failedScreenshot failed; error contains a description.

Response parameters

job_id
String
Unique identifier for the async job.
status
String
Current job status: queued, running, done, or failed.
result
Object
The screenshot result object (same shape as the synchronous endpoint response). Present when status is done.
error
String
Error message. Present when status is failed.
meta
Object
Additional metadata about the job execution.