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.
credentialsobjectNoBasic Auth credentials forwarded to the target site. See Credentials for details and examples.
metadataRecord<string, unknown>NoArbitrary metadata echoed back in job payloads. See Metadata for usage patterns.
optionsSnapshotOptionsNoControls output capture and content filtering. See below for details.

Snapshot Options

FieldTypeDefaultNotes
format"png" | "jpeg" | "webp" | "pdf""png"Output format. Use pdf for PDF document generation.
darkModebooleanfalseEnable dark color scheme for the page.
imageOptionsImageOptionsOptions specific to image output (png/jpeg/webp). See Image Options.
pdfOptionsPdfOptionsOptions specific to PDF output. See PDF Options.
blockBlockOptionsContent blocking options. See Block Options.

Example Request

curl -s -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com/"
    ],
    "viewports": [
      {
        "width": 1280,
        "height": 800
      }
    ],
    "options": {
      "format": "jpeg",
      "block": {
        "cookieBanners": true,
        "chats": true,
        "ads": true,
        "trackers": true
      }
    }
  }' \
  "https://api.watchero.io/api/v1/snapshots"

See Image Options and PDF Options for format-specific examples.

Response

202 Accepted (Jobs still running)

When jobs are still processing or the timeout expires before completion:

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

200 OK (Complete)

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

Error Responses

StatusDescription
400 Bad RequestInvalid schema. Includes a details array from Zod validation.
500 Internal Server ErrorServer failure 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.