Choose a monitor type
Search
Find relevant web results over time.
Page
Track changes to the text on pages you already know.
Agent
Run an Agent API task and read its updates.
How monitoring works
Create a monitor with your targets and schedule. You can add a goal to describe the results you want. The first run is due immediately. The service starts it asynchronously. The next runs follow the schedule while the monitor is active. A run is one execution of a monitor. The monitor keeps saved state between runs to identify new findings or page changes. See Search run windows, Page comparisons, and Agent saved state. The run saves the findings it keeps inchanges. It saves any Page fetch or processing errors in target_errors. You can read saved runs through the API. You can also configure webhooks to get notifications.
Quickstart
Create a Search monitor. Read its first results. To track changes at URLs you already know, use the Page quickstart instead. You need a Perplexity API key. The Python and TypeScript examples useclient.monitors in the Perplexity SDKs. The cURL examples use jq. Set the key in your environment:
Create a monitor
This request creates a Search monitor. The response contains the configuration of the monitor. Use the Check results request to read the results.Response
Response
MONITOR_ID to the id in the response. The examples on this page use the value from your environment:
Check results
The service starts the first run asynchronously. Ifdata is empty or the run is queued or running, wait. Then send the same request again. Limit the number of retries. Read changes after the run succeeds. A successful run can return no findings.
If the run is failed or skipped, read error. Do not send a request to /run to start the first check.
Read the latest run:
Response
Response
Run status and history
If the status is
queued or running, get the run again later. Limit the number of retries. Treat an unknown status as an unfinished run.
Run history is retained for 90 days. The monitor and run lists accept limit and after. The default limit is 20 and the maximum is 100. If has_more is true, use the id of the last entry in data as after to read the next page.
Schedules
Useinterval for a delay that repeats between runs. Specify a value from 1m to 31d in whole minutes, hours, days, or weeks. Use cron to specify a clock time. For example, {"type": "cron", "cron": "0 9 * * 1-5", "timezone": "America/New_York"} sets the time to 9 a.m. on weekdays. A cron expression needs five fields. A cron schedule uses UTC by default.
For a cron schedule, runs must be no more than 31 days apart. The first run is due immediately for both schedule types. The service adds jitter to the schedule of the next runs. For an interval, the jitter is 10% of the interval or less. For a cron schedule, the jitter is 10 minutes or less after the cron time. See Update a monitor for the full schedule object.
Update the monitor to check once a day:
Run now
After the first run finishes, you can request a manual run of an active monitor. The202 response is the queued run. It does not contain the final result:
Response
Response
id from the response with Get a run. If a run is already queued or running, the request returns 409 with error.type: "run_in_progress" and error.current_run_id. Check that run. Do not retry the request in a loop. For a paused monitor, the service returns 409 invalid_state. Resume the monitor before you request a run.
Goals and judging
Use agoal to describe which findings matter to you.
You can update the goal on the same monitor. To clear the goal, send an empty string:
changes. If you provide a top-level goal, the service checks if the findings match it. The service also judges findings without a goal.
Each monitor type uses different checks. See Search judging, Page judging, and Agent judging.
Manage monitors
Get the monitor to check its configuration and status:Response
Response
PATCH to update a monitor. See Update a monitor for supported fields and request examples.
List monitors
Get a list of your monitors to find their IDs and statuses:has_more is true, use the id of the last monitor as after to read the next page.
Pause and resume
When you pause a monitor, the service stops scheduled runs and keeps the state of the monitor. A queued run changes toskipped. A run that has already started can finish.
active. The service calculates the time of its next run again. The state can expire after a pause of more than 90 days. If this happens, a Page monitor can set a new baseline rather than report a change from the old baseline.
Delete and clean up
Delete a monitor when you no longer need it. The service removes the monitor, its run history, and its state. It does not schedule more runs:Error handling
For a JSON error, Monitor API returns anerror object with message, type, and a numeric code. A validation error can also identify param. A failed run has error.code and error.message. A skipped run has error.skip_reason and error.message instead. Use the typed code or reason to decide what to do. Do not use the message text to make this decision.
Automatic pausing
The service can pause a monitor automatically if its sources or its configured webhook fail repeatedly. It can also pause the monitor if a credit check denies a run or the organization policy blocks the run. The service setsstatus: "paused" and sets pause_reason. The service stops the schedule. The response does not include next_run_at.
Read pause_reason to find the cause of the pause. A run that fails or has status skipped does not necessarily mean that the monitor is paused.
The service counts a webhook delivery as a failure only after the delivery ends and all retries that apply are complete. The service does not count each retry separately. The service does not count a successful run with no changes as a source failure.
After you correct the cause, resume the monitor. This restores its schedule and clears its failure counts. The service does not resume the monitor automatically if you add credits or fix a receiver.
Webhook notifications
Webhooks are optional for all monitors. You can add a webhook after you create a monitor. You can still read results through the API.Configure a webhook
Setwebhook.url to the public HTTPS URL of a receiver you control. Do not include credentials in the URL. The URL must be 2,048 bytes or less. Replace https://example.com/webhooks/perplexity with the public HTTPS URL of your receiver:
webhook.secret securely. The service returns a generated secret only once, in the response to the create or update request that attaches the webhook. It does not return the secret in later reads or an idempotent replay. You can also supply your own signing secret. The service never returns a secret that you supply. Use webhook updates to rotate a secret.
If the monitor has no webhook, the response does not include the webhook field. To create a monitor without a webhook, omit webhook or set it to null. An empty object or an empty URL is invalid.
Events
By default, a webhook subscribes tomonitor.changes.detected and monitor.paused. Set webhook.events to the events you want:
Events include a snapshot of the monitor in
data.monitor. The monitor.created, monitor.changes.detected, and monitor.run.completed events always include data.run. The object in data.run is the same as the object from Get a run.
Example event
Example event
This event contains one result from Search. Page and Agent events use the same structure with their own change types.
diff.truncated applies only to the diff text. It does not apply to the event body.
For an automatic pause, data.monitor.pause_reason identifies the cause. The data.run field is optional. If the event includes this field, it contains the run that caused the pause. Delivery to a receiver with a fault can fail. Check the monitor directly. Do not wait for the event.
Verify signatures
Webhook deliveries use Standard Webhooks v1. They include three headers. Verify the signature before you process the event:
In this notation,
<webhook-id> and <webhook-timestamp> are the values from the request headers. The + joins the bytes.
signing_key to calculate the HMAC-SHA256 of signed_payload. Encode the digest in base64. Compare the result with the v1 signatures from the header in constant time. Accept a signature that matches only if the timestamp is within five minutes of your clock.
Use the original bytes of the request body before you parse or reserialize the JSON. Use webhook-id to remove duplicate events. This value equals id in the event body. Use data.run.changes[].id to remove duplicate changes. Webhook delivery is at least once. Events can arrive out of order.
The Standard Webhooks libraries implement this check. Store the signing secret in your secret manager. Then give the receiver access to the secret as MONITOR_WEBHOOK_SECRET. Do not log the secret in deployed code. For Python, install flask and standardwebhooks. For TypeScript, install express and standardwebhooks.
These receivers pass the raw body to verify. They skip repeated webhook-id values. They return 204:
Delivery and retries
Return any2xx response within 10 seconds. Then process the event asynchronously. The service ignores the response body. It does not follow redirects.
Delivery errors do not change the status of a completed run. If delivery fails repeatedly, the service can automatically pause the monitor.
Update or remove a webhook
Use Update a monitor to attach a webhook or replace its URL and event subscriptions. If you omitevents or send an empty list, the webhook uses the default subscriptions. To keep subscriptions that are not the default, include the events you want in the update.
To remove notifications without stopping runs, send this request:
Test delivery
Send one signed test event to the receiver you configured:event_id, delivered, and duration_ms. It includes status_code or error if available. Check delivered even if the HTTP response is 200.
The monitor.webhook.test event includes data.monitor but not data.run. The test does not create a run. The service does not retry the event. You can test a paused monitor. If the monitor has no webhook, the service returns 409 invalid_state. Configure a webhook before you test delivery.
Pricing and limits
See Monitor API pricing for the rates and billable units. Use the pricing calculator to estimate the cost of Search and Page runs. Perplexity bills Agent runs as Agent API usage. See Monitor API limits for HTTP request tiers, limits on active monitors, and instructions for retries. Requests to poll or manage monitors share the HTTP request budget. All monitor types share the same active monitor limit.Examples
Track competitor news
Create a Search monitor to check daily for product launches and business news.
Track API and pricing changes
Use a Page monitor to track changes to a changelog, a pricing page, and an API guide.