Docs
Create Snapshot

Create Snapshot

Kick off snapshot capture jobs for one or more URLs.

Endpoint

POST /api/v1/snapshots

Query Parameters

NameTypeDefaultDescription
timeoutinteger (ms)0Optional. Waits for up to the given duration before returning. When omitted the endpoint returns immediately with the initial snapshot status.

Request Body

The body must satisfy the SnapshotRequestSchema from @watchero/types:

FieldTypeRequiredNotes
urlsstring[]YesAbsolute URLs to capture. Each URL creates an individual job.
viewportsViewport[]YesEvery viewport must include width and height. Optional flags like deviceScaleFactor, isMobile, isLandscape, and hasTouch mirror the schema defaults.
credentials{ name: string; pass: string; }NoBasic Auth credentials forwarded to the target site.
metadataRecord<string, unknown>NoArbitrary metadata echoed back in job payloads, useful for correlating results.
options{ fullPage?: boolean; format?: "png" | "jpeg" | "webp"; quality?: number }NoControls screenshot capture. Defaults to full-page PNG. Set fullPage to false for viewport-only shots, choose format to force png, jpeg, or webp, and supply quality (1-100) when using jpeg/webp to tune compression.

Example Request

curl -s -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://site.com/"
    ],
    "viewports": [
      {
        "width": 1496,
        "height": 812,
        "deviceScaleFactor": 2
      }
    ]
  }' \
  "https://api.watchero.io/api/v1/snapshots"

Example Response (202 Accepted while jobs are still running)

{
  "id": "cmhdgfak60002mdtxnen6g2qi",
  "status": "QUEUED",
  "results": []
}

When every job finishes before the timeout expires, the endpoint responds with HTTP 200 and a COMPLETE payload identical to the Get Snapshot response.

Errors with invalid schemas return HTTP 400 and include a details array from Zod. Server failures return HTTP 500 with an error message.


We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking Accept, you agree to our use of cookies.
Learn more.