Webhooks
Receive Fetchply events like new conversations, leads, handoffs, and training results as signed JSON POST requests to your own endpoint.
Webhooks send Fetchply events to your server as they happen. Set them up per agent under Channels → Integrations → Webhooks.
Add an endpoint
- Select Add endpoint, enter the Endpoint URL and an optional Label, and choose the Trigger events.
- Copy the signing secret (it starts with
whsec_). It is shown once. - Select Send test delivery in the endpoint's menu, and check your server received it.
Each agent can have 1 endpoint on the Free plan and up to 50 on paid plans. A Shopify-connected agent follows its store's plan. URLs must be public; private and internal addresses are refused.
Events
| Event | Fires when |
|---|---|
new_conversation | A visitor starts a new chat |
new_message | A visitor sends a message and the agent replies |
new_lead | A visitor submits the lead form |
handoff_requested | A visitor asks for a person |
feedback_received | A visitor rates an answer |
training_completed | Training finishes |
training_failed | Training fails |
Request
Each event is a POST with a JSON body:
{
"event": "new_lead",
"chatbotId": "d581c7e2-...",
"timestamp": "2026-05-21T14:30:00.000Z",
"data": {
"leadId": 42,
"sessionId": "sess_abc123",
"name": "Jane Doe",
"email": "[email protected]",
"phone": "+1234567890",
"fields": { "company": "Acme Inc" }
}
}Headers:
| Header | Value |
|---|---|
X-Fetchply-Event | The event name |
X-Fetchply-Delivery | A unique delivery ID; use it to ignore duplicates |
X-Fetchply-Signature | t=<unix seconds>,v1=<hex HMAC-SHA256> |
Verify the signature
The signature is HMAC-SHA256 of <t>.<raw body> with your signing secret, as lowercase hex. Compare it with the v1 value, and reject old timestamps to stop replays.
const { createHmac, timingSafeEqual } = require('node:crypto');
function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ''));
}Use the raw request body, before any JSON parsing.
Delivery and retries
- Reply with any
2xxwithin 10 seconds. - Timeouts,
408,429, and5xxare retried with growing waits (1 minute, doubling, up to 30 minutes), up to 6 attempts. - Other
4xxresponses are not retried. - The same event can arrive more than once; deduplicate on
X-Fetchply-Delivery.
Troubleshooting
Add endpoint is greyed out. The agent has as many endpoints as its plan allows. Delete one, or upgrade from Free to get up to 50. Endpoints you already have keep working after a downgrade.
Nothing arrives. Check the endpoint is active, subscribed to the event, and reachable from the internet.
Signatures never match. Sign the raw body exactly as received, and use this endpoint's current secret.
Events arrive twice. A retry followed a slow response. Answer quickly and deduplicate on the delivery ID.