Monitor API
Update a monitor
Replace the name, goal, targets, schedule, webhook, or metadata of a monitor.
PATCH
Each top-level field that you send replaces that whole field. Fields that you omit stay unchanged. The service does not do a nested merge. An empty object returns the monitor unchanged. See Manage monitors for examples.
Send
null to clear goal, metadata, or webhook. If you clear goal, it becomes "". If you clear metadata, it becomes {}. If you clear webhook, the service stops notifications, and runs continue. The service does not accept null for name, targets, or schedule.
Replace targets or schedules
Atargets array replaces the full array and the configuration of each target. Repeat the required fields and any nondefault settings that you want to keep. On a Search target, if you omit max_results, the service resets it to 20. If you omit Search filters, the service restores both freshness date types and removes domain restrictions. If you omit judge.threshold on a Search or Page target, the service resets it to 0.5.
On an Agent target, if you omit effort and profile, the service uses low effort. If you omit Agent filters, the service resets freshness to ["published", "updated"] and clears both domain lists. If you omit one Agent filter, the service resets that filter to its default.
You can switch to a different target type. Send one target for Search or Agent. Send 1 to 10 targets with distinct URLs for Page. Do not mix target types. Do not send an empty array. When you update targets, the service keeps current run windows, seen-URL history, and stored Page baselines within their retention period. A Page URL with no stored baseline sets one when the monitor reads that page successfully for the first time. For an Agent target, see Saved state.
A new schedule replaces the whole schedule. For an active monitor, the service then recomputes next_run_at. It does not recompute next_run_at before the first run finishes or while a queued run has not started. Include type and the required fields for that schedule.
Add, replace, or remove a webhook
Awebhook object replaces the whole webhook. Include url and any event subscriptions that you want to keep. If you omit events or send [], the service selects the default events: monitor.changes.detected and monitor.paused.
If you omit secret on a monitor that already has a webhook, the service keeps the current secret. When you add a webhook to a monitor that has none and omit secret, the service creates one. The service returns that secret in webhook.secret in this response. Save this secret to verify deliveries.
When you supply a different secret, the service rotates the secret. The service signs deliveries with both the new secret and the old secret for 24 hours. The service never returns a secret that you supply. After you configure the webhook, use Test a monitor’s webhook to check delivery.
Authorizations
Body
application/json
Send only the fields you want to replace. The service keeps the fields you omit. Send null to clear goal, metadata, or webhook. When you replace an Agent target, repeat the task and the options you want to keep.
Response
The updated monitor
Fields that do not apply are omitted, never null: webhook,
pause_reason, current_run_id, next_run_at and last_run.