Skip to content

Monitor with events

After this guide an agent can ask “what changed since I last looked?” instead of reading every report again, and know when to use a webhook instead.

events_list returns events oldest first. Each has a seq, a number that only goes up within the workspace.

  1. First call: { "limit": 100 }. Without after you get the oldest events still kept.
  2. Handle the items. Store nextAfter.
  3. Next call: { "after": <nextAfter>, "limit": 100 }. You get only what is newer.
  4. When items is empty, nextAfter is the after you sent. Wait and ask again.
Fact Value
Page size At most 100 per call
Kept for 30 days. Past that, an old after skips what was cleared.
What you see Only events whose reading tool your key holds the scope for: a deposit needs wallet:read, a clip needs clips:read.
Order By seq. A reader that has seen seq n has seen everything that will ever get a smaller number.
Budget Reads are 600 per minute per key, so polling every 30 to 60 seconds is cheap.

Use it for outcomes the agent is waiting on: campaign.activated, campaign.budget_added, approval.rejected, approval.expired, deposit.credited, clip.submitted. The types are in the Event reference.

events_list Webhook
Needs a public server No Yes, https on port 443
Latency Your polling interval Seconds
Order Strict by seq Not guaranteed
Duplicates None Possible: dedupe by id
If you are down Read from your last nextAfter Retried over about 45 hours, then dead

Use a webhook to be woken, and events_list to catch up after downtime. The id is the same in both.

Setup: Receive events. Signatures: Verify signatures.