Webhooks
See Webhooks for the request simmail sends, signatures, retries and every event type.
| Call | What it does |
|---|---|
GET /api/webhooks | The webhooks. Secrets are shown as ••••. |
PUT /api/webhooks | Replaces all webhooks with the list you send. Answers with the new list. |
Changing webhooks needs the admin role and the webhooks feature of your plan (402 without it).
A webhook:
{ "name": "CI listener", "url": "https://hooks.yourcompany.test/simmail", "events": ["persona.*", "link.opened"], "secret": "a-long-random-secret"}To keep an existing secret when you change a webhook, send "secret": "••••" with the same url. To remove all webhooks, send [].
With the SDKs, EventType names every event (a name ending in * still matches a prefix):
import { Simmail, EventType } from "@plexuslabs/simmail";
const mail = new Simmail();await mail.webhooks.set([ { name: "CI listener", url: "https://hooks.yourcompany.test/simmail", events: ["persona.*", EventType.LinkOpened], secret: "a-long-random-secret" },]);const hooks = await mail.webhooks.list();await mail.webhooks.clear();from simmail import Simmail, EventType
mail = Simmail()mail.webhooks.set([ {"name": "CI listener", "url": "https://hooks.yourcompany.test/simmail", "events": ["persona.*", EventType.LINK_OPENED], "secret": "a-long-random-secret"},])hooks = mail.webhooks.list()mail.webhooks.clear()