Skip to main content

Create a monitoring job

POST 

/v1/watch/jobs

Registers a page with a schedule and returns the job. The job is created on the fetch platform under flowda's credential; ownership stays with your account here.

Request body​

11 of 11
urlstringrequired
The page to monitor. Immutable afterwards.
Values
absolute http/https URL, publicly resolvable
scheduleobjectrequired
When to check. interval_seconds is 60 … 2592000 and runs on the UTC timeline (the timezone does not shift it); cron is a standard five-field expression interpreted in timezone (weekends included).
Values
{interval_seconds} or {cron} — exactly one
timezonestring
Affects cron schedules only.
Default
UTC
Values
IANA timezone name
countrystring
Access region for the checks.
Default
US
Values
two letters
selectorstring
Monitor only part of the page.
Values
CSS or XPath, per selector_type
selector_typestring
How selector is interpreted.
Default
css
Values
css, xpath
diff_modesstring[]
How differences are computed.
Default
["auto"]
Values
auto, text, json (no duplicates; auto cannot be combined)
retention_daysinteger
How long check history is kept; 0 means keep it indefinitely.
Default
30
Values
0 … 365
webhook_urlstring
Where change events are delivered. flowda rewrites it to its own relay before handing the job to the platform, and swaps your address back in the responses.
Default
no notifications
Values
absolute http/https URL on a public host, port 80 or 443
headersobject<string,string>
Extra headers for the checks.
Default
{}
Values
Host and hop-by-hop headers are rejected
maskobject
Noise reduction for diffing. mask.enabled (boolean) and mask.exclude (array of iso_timestamp, unix_timestamp, relative_time, counter, uuid, session_token, tracking_param, cache_buster, resource_hash, iframe_marker).
Default
{enabled: false, exclude: []}
Values
see below

schedule is a nested object: schedule_interval and schedule_cron used to exist as top-level fields and are rejected — use schedule.

The body is accepted as JSON or form-encoded (application/x-www-form-urlencoded). With form encoding, schedule, headers and mask are JSON object strings and diff_modes is sent by repeating the field name (or as a JSON array string) — the same rules as the other endpoints that accept form bodies.

If webhook_url is new to this account, the response additionally carries data.data.webhook_secret once: store it. It is the HMAC key our callbacks are signed with and it is never returned again — not by GET /v1/watch/jobs/{id}, not in the list.

Receiving callbacks​

We POST to your address with Content-Type: application/json, a JSON body holding the change event, and these headers:

HeaderMeaning
X-Watch-Signaturet= followed by unix seconds, then ,v1= followed by a lowercase hex digest. The digest is HMAC-SHA256 over the string built from those unix seconds, a dot, then the raw request body bytes. Reject anything whose timestamp is more than 5 minutes away, and compare digests in constant time.
X-Flowda-EventEvent name; currently watch.change_detected.
X-Flowda-Event-IdStable idempotency key for job, check and event; use it to deduplicate deliveries.
X-Flowda-Delivery-IdIdentifier of this delivery.
X-Flowda-AttemptAttempt number, starting at 1.

Verify over the raw body bytes you received: parsing the JSON and serializing it again changes the bytes and breaks the signature. Answer 2xx quickly. A non-2xx answer is retried, up to 6 delivery attempts in total, with delays of 10s, 1m, 5m, 30m and 2h between them; 4xx answers other than 408, 425 and 429 stop immediately, and Retry-After is honoured up to 10 minutes.

The body is a watch.change_detected event: the job and check identifiers, a one-line data.check.diff_summary, and the change itself under data.diff. Its schema is the changeDetected callback of this operation; data.delivered_at is when the platform created the event, which is not the timestamp in the signature header.

Request​

Responses​

The created job, nested as data.data.job, plus data.data.webhook_secret when a new callback URL was registered

Response Headers
    Cache-Control

    Always no-store — no intermediary may cache these responses.

    X-Upstream-Request-Id

    The fetch service's own request identifier for this call. Quote it together with the envelope's request_id in support requests.

Callbacks​

POST 

{$request.body#/webhook_url}

Delivered to the callback address registered for this job. Only change events are sent: a check that finds no change delivers nothing, and a job without webhook_url sends nothing.

Every request is signed with that job's webhook_secret; the Webhooks guide lists the headers, the string that is signed and the retry rules. Read the change itself from data.diff, or just its one-line summary from data.check.diff_summary.

Callbacks Responses​

Any 2xx accepts the event. A non-2xx answer is retried, up to 6 delivery attempts in total; 4xx answers other than 408, 425 and 429 stop immediately.