Create a change-detection monitor

Creates a recurring change-detection monitor for a URL. Webhook deliveries include `X-RapidCrawl-Event: monitor.change_detected` or `X-RapidCrawl-Event: monitor.captured` so receivers can dispatch on the header without parsing the body shape. Scrape-monitor webhook payloads carry an additive `was_preflight: boolean` field. It is `true` only when the cycle confirmed the page was unchanged (the target returned HTTP 304) — emitted as a heartbeat under `notify_on='every'`. On the `notify_on='change'` delivery path, unchanged cycles suppress the webhook entirely. The field is `false` on every other delivery, including all captures that carry a body.

POST
/v1/monitors

Authorization

AuthorizationRequiredBearer <token>

API key. Obtain from POST /v1/account/api-keys.

In: header

Request Body

application/jsonRequired
urlRequiredstring
Format: "uri"
typestring
Default: "screenshot"Value in: "screenshot" | "scrape"
interval_typeRequiredstring
Value in: "hourly" | "daily" | "weekly" | "cron"
cron_expressionstring

5-field cron expression. Required when interval_type is "cron".

change_thresholdnumber
Default: 5Minimum: 0Maximum: 100
notify_onstring
Default: "change"Value in: "change" | "every"
webhook_urlRequiredstring

Webhook endpoint URL (HTTPS only; http:// rejected with HTTP 422)

Pattern: "^https://"Format: "uri"
webhook_secretstring
webhook_headersobject

Max 20 headers. Keys must match /^[A-Za-z0-9-]+$/ and not be reserved.

optionsobject

Screenshot monitor options (device, viewport, format, etc.).

scrape_optionsobject

Scrape monitor options (formats, country, headers, etc.). Only for type=scrape.

metadataobject

Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.

curl -X POST "https://api.bytekit.com/v1/monitors" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "http://example.com",
    "type": "screenshot",
    "interval_type": "hourly",
    "cron_expression": "string",
    "change_threshold": 5,
    "notify_on": "change",
    "webhook_url": "http://example.com",
    "webhook_secret": "string",
    "webhook_headers": {
      "property1": "string",
      "property2": "string"
    },
    "options": {},
    "scrape_options": {},
    "metadata": {}
  }'

Monitor created.

{
  "id": "mon_01j9abc123",
  "type": "screenshot",
  "url": "string",
  "status": "active",
  "interval_type": "hourly",
  "cron_expression": "string",
  "next_capture_at": "2019-08-24T14:15:22Z",
  "notify_on": "string",
  "webhook_url": "string",
  "webhook_headers": {},
  "change_threshold": "string",
  "scrape_options": null,
  "last_content_hash": "string",
  "captures_count": 0,
  "changes_count": 0,
  "skipped_captures": 0,
  "last_captured_at": "2019-08-24T14:15:22Z",
  "last_changed_at": "2019-08-24T14:15:22Z",
  "consecutive_failures": 0,
  "last_error_code": "string",
  "suspension_reason": "string",
  "metadata": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "cancelled_at": "2019-08-24T14:15:22Z",
  "webhook_secret": "a3f1b2c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2"
}