Skip to main content
PATCH
Update a monitor

Overview

Send only the fields you want to change; everything else stays as it is. The response is the updated monitor.

Pause and resume

A paused monitor keeps its settings and history but runs no scheduled checks, so it costs nothing. Set "status": "active" to resume. The next check runs at the next scheduled time — runs missed while paused are not replayed. A check can still be run by hand while paused, with POST /monitor/{id}/run.

Example request

What each field does

Changing targets

Each target keeps its own snapshots, so what you get on the next check depends on whether a target is still the same target:
  • A target you send with its existing id keeps its snapshots.
  • A target without an id that watches the same URLs as an existing one inherits that target’s id, and its snapshots, automatically. Changing only its options — adding an exclude_selectors, say — keeps its history.
  • Any other target is new. Its first check is a silent baseline: every page is new, and nothing is announced.
Snapshots of targets you leave out are deleted.
Changing what a target compares — its selectors, or switching it to the json mode — can make the next check report pages as changed once, because the old snapshot was taken the old way. From the check after that, the comparison is like for like again.

Rotating the signing secret

The new secret is in the response, and applies to every delivery from then on, including retries of events queued before the change.

GET /monitor/{id}

The monitor as it now runs.

DELETE /monitor/{id}

Delete it for good.

Authorizations

X-API-Key
string
header
required

Your Prefetch API key. Obtain one from the dashboard.

Path Parameters

id
string
required

The monitor id returned by POST /monitor.

Example:

"mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c"

Body

application/json

Any subset of the create fields, plus status. Fields you leave out stay as they are.

name
string
Maximum string length: 256
schedule
object

Exactly one of cron or text. A bare string is accepted too, and read as cron when it has five cron fields.

goal
string | null

null clears the goal and turns judging off.

Maximum string length: 2000
judge_enabled
boolean
targets
(Scrape target · object | Crawl target · object)[]

Replaces the whole list.

Required array length: 1 - 50 elements

Watches a fixed list of pages, each fetched the way GET /scrape would fetch it.

webhook
object | null

null removes the webhook.

retention_days
integer
Required range: 1 <= x <= 365
status
enum<string>

Pause or resume. Resuming runs at the next scheduled time; runs missed while paused are not replayed.

Available options:
active,
paused

Response

Monitor updated.

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required