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

  1. Select Add endpoint, enter the Endpoint URL and an optional Label, and choose the Trigger events.
  2. Copy the signing secret (it starts with whsec_). It is shown once.
  3. 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

EventFires when
new_conversationA visitor starts a new chat
new_messageA visitor sends a message and the agent replies
new_leadA visitor submits the lead form
handoff_requestedA visitor asks for a person
feedback_receivedA visitor rates an answer
training_completedTraining finishes
training_failedTraining 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:

HeaderValue
X-Fetchply-EventThe event name
X-Fetchply-DeliveryA unique delivery ID; use it to ignore duplicates
X-Fetchply-Signaturet=<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 2xx within 10 seconds.
  • Timeouts, 408, 429, and 5xx are retried with growing waits (1 minute, doubling, up to 30 minutes), up to 6 attempts.
  • Other 4xx responses 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.