Prerequisites: Before implementing Monitor webhooks, read Webhook Setup & Verification for critical information on:
- Recording your webhook secret
- Verifying HMAC signatures
- Security best practices
- Retry policies
Overview
Webhooks allow you to receive real-time notifications when a Monitor execution completes, fails, or when material events are detected, eliminating the need for polling. This is especially useful for scheduled monitors that run at long gaps (hourly, daily, or weekly) and notify your systems only when relevant changes occur.Setup
To register a webhook for a Monitor, include awebhook parameter when creating the monitor:
Webhook Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Your webhook endpoint URL. Can be any domain you control. |
event_types | array[string] | Yes | Event types to subscribe to. See Event Types below. |
Event Types
Monitors support the following webhook event types:| Event Type | Description |
|---|---|
monitor.event.detected | Emitted when a run detects one or more material events. |
monitor.execution.completed | Emitted when a Monitor run completes successfully (without detected events). |
monitor.execution.failed | Emitted when a Monitor run fails due to an error. |
monitor.event.detected and monitor.execution.completed are mutually distinct and correspond to different
runs.
Webhook Payload Structure
For Monitor webhooks, thedata object contains:
monitor_id: The unique ID of the Monitorevent: The event record for this run.metadata: User-provided metadata from the Monitor (if any)
Security & Verification
For HMAC signature verification and language-specific examples, see the Webhook Setup Guide - Security & Verification.Retry Policy
See Webhook Setup Guide - Retry Policy for delivery retries and backoff details.Best Practices
- Scope your query: Clear, explicit instructions lead to higher-quality event detection.
- Choose the right cadence: Use
hourlyfor fast-moving topics,dailyfor most news,weeklyfor slower changes. - Use webhooks: Prefer webhooks to avoid unnecessary polling and reduce latency.
- Manage lifecycle: Cancel monitors you no longer need to reduce usage.
Related Topics
- Quickstart: Create, retrieve, update, and delete monitors
- Status and Errors: Status codes and error semantics
- [API Reference]: See
POST /v1alpha/monitorswithwebhookin request body