Set up a webhook endpoint
You need a publicly available HTTPS endpoint that acceptsPOST requests. Once you have one, go to Settings → Webhooks in Plain and click + Add webhook target. Choose the URL, the events you want to receive, and copy the signing secret. You’ll need it to verify webhook signatures.
See the webhooks overview for the full setup, including delivery semantics, retries, and security options like request signing and mTLS.
Verify and parse events with the SDK
The@team-plain/webhooks package handles signature verification, replay protection, and JSON schema validation, and gives you fully typed event payloads.
parsePlainWebhook to skip the signature check and just validate the payload shape. See the Webhooks SDK reference for the full API.
Events that matter for an agent
These are the events agents most commonly subscribe to.If you subscribe to both
thread.thread_created and thread.email_received you’ll get two events for the first email in a thread. Check the isStartOfThread field on the email payload if you only want to react once.
