POST to a URL you choose whenever one of the events you
picked happens. It belongs to the workspace, so everyone in it sees the same
list.
Add a webhook
1
Open Webhooks
In ManyPI, open the profile menu, choose Developers → Webhooks, and
click New webhook.
2
Paste your URL
It must be
https and reachable from the internet.3
Pick a scope
What the webhook covers:
- Whole workspace: everything.
- One brand: only that brand’s events.
- One campaign: replies, bounces, meetings and campaign events for that campaign.
- One scraper: that scraper’s runs.
4
Pick events and save
Optionally add a signing secret so you can check each request came
from ManyPI. Then open the webhook’s menu and click Send test.
Events
Payload
data holds the event’s own fields. id is the same on every retry of the
same event, so use it to ignore duplicates.
Scraper events also carry the fields the older scraper-only webhooks sent
(event, runId, scraperId, status, result, metadata), so receivers
written for them keep working.
Headers
Verify the signature
The signature is a hex HMAC SHA-256 of the raw request body, keyed with your signing secret. Compute it over the bytes you received, before parsing the JSON.created_at is inside the signed body. Refuse requests older than a few
minutes if you want to block replays.
Delivery and retries
- Answer with any
2xxwithin 8 seconds. Do slow work after you respond. - Redirects are not followed, so use the final URL.
- A failed delivery is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 8 hours: six attempts in all.
- After 25 failed attempts in a row the webhook pauses itself and shows Paused after failures. Fix the receiver, use Send test, then Resume.
- Events usually arrive within a minute or two.
Manage webhooks with the API
The webhook routes accept a session or an API key (Authorization: Bearer mpi_…).
scope_type is workspace, brand, campaign or scraper, and scope_id
is the brand, campaign or scraper id (leave it out for workspace). A
workspace can have up to 20 webhooks. The signing secret is never returned.
