Skip to the content

Webhooks

HeyServo posts signed JSON to your URL when something happens: a conversation starts, a lead is captured, a ticket moves. Your CRM or automation can react straight away.

Where
Workspace menuDeployDevelopersWebhooks
Permission
Needs Manage keys and webhooks
Time
11 min read
Markdown
01 / 05Add an endpoint. On DevelopersWebhooks, click Add endpoint.
  1. Add an endpoint. On DevelopersWebhooks, click Add endpoint.
  2. Where, and for which assistants. Paste your receiver's URL. Leave Agents empty to hear every assistant.
  3. Pick the events. Tick what your system cares about. Here: new leads and handovers.
  4. A test event goes out. HeyServo sends webhook.test to the URL as soon as you add it.
  5. Check the deliveries. Every endpoint's row menu has Deliveries, with Send again for any delivery.
The story

How a delivery works

From something happening in a conversation to your server accepting the delivery, and what happens when it cannot.

1

A lead is captured

Layla asks Golden Oven's assistant about a custom cake on WhatsApp and leaves her name and number. When the conversation is finished, HeyServo writes it up as a lead and scores it.

That is a lead.captured event. Every endpoint subscribed to it, for this assistant or for all assistants, gets a delivery.

2

HeyServo posts to your URL

Within seconds, HeyServo sends a POST to each subscribed endpoint. The body is an envelope: an event id, the type, when it was created, the assistant, and data with the lead's details.

The headers say which event it is (X-Molly-Event), which delivery this is (X-Molly-Delivery-Id) and how to prove it came from HeyServo (X-Molly-Signature).

3

Your server checks the signature

Your receiver takes t from the signature header, joins it with a dot to the raw body exactly as received, and signs that with the endpoint's signing secret. If the result matches v1, the delivery is genuine.

Checking that t is recent stops someone replaying an old delivery. HeyServo does not set a window: five minutes is a common choice.

4

200: delivered

Your server answers quickly with a 2xx. The delivery shows as Delivered on the endpoint's Deliveries sheet. Do slow work, such as creating the CRM contact, after you answer.

Use X-Molly-Delivery-Id to ignore a delivery you have already handled: delivery is at least once.

5

If your server is down

A timeout or an answer of 400 or more is a failure. HeyServo retries after 30 seconds, 2 minutes, 8 minutes, 30 minutes and 2 hours.

If the sixth attempt also fails, the delivery is marked Failed and the whole endpoint is paused until you resume it.

01 / 05A lead is captured. Layla's conversation ends and the assistant writes it up as a hot lead.
  1. A lead is captured. Layla's conversation ends and the assistant writes it up as a hot lead.
  2. HeyServo posts to your URL. A JSON POST with the event's type, a delivery id and a signature in the headers.
  3. Your server checks the signature. An HMAC-SHA256 of the timestamp and the raw body, with the endpoint's secret.
  4. 200: delivered. Any answer below 400 counts as delivered.
  5. If your server is down. HeyServo tries again, waiting longer each time, up to 6 attempts.

What webhooks are

A webhook endpoint is an address on your server that HeyServo calls when an event you subscribed to happens. Endpoints belong to the workspace. Each can hear every assistant, including ones added later, or only the assistants you pick. Each has its own signing secret, so your server can prove a delivery came from HeyServo.

Webhooks tell you what happened. To tell an assistant something happened in your app, use the Events API. To read data whenever you like, use the Read API.

Add an endpoint

GoalAn endpoint that receives the events you picked, with a test delivery already through.

  1. 1

    Open DevelopersWebhooks and click Add endpoint

  2. 2

    Paste the URL

    A public http or https address. Addresses on private networks are refused.

  3. 3

    Add a Description if you like

    For example CRM sync.

  4. 4

    Choose Agents

    Leave it empty to receive every assistant's events, including assistants added later. Or find and pick the ones you want.

  5. 5

    Tick the Events

    Each event shows when it fires. Select all and Clear help with long lists.

  6. 6

    Click Add endpoint

    A webhook.test delivery goes out at once. You see "Endpoint added. The test event went through." or "Endpoint added, but the test event failed".

  7. 7

    Copy the signing secret

    Open the endpoint's row menu, choose Signing secret, click Reveal and copy it into your server's secrets.

Add an endpoint, Edit endpoint5 controls
URLText
Where deliveries go. Must start with http:// or https:// and be reachable on the public internet.
DescriptionText
Optional. Your label.
AgentsList
Which assistants' events. Empty means every assistant, now and later.
EventsList
The event types this endpoint hears. See the list below.
ActiveSwitch
Edit only. Off stops deliveries. Turning it back on also clears a pause after repeated failures.
Default On

Event types

These are every event you can subscribe to, with the line the picker shows and the fields in data.

Conversations

EventFires whendata
conversation.startedA conversation began, on any channel.conversation_id, channel, contact_id, contact_name
conversation.endedA conversation ended (resolved, closed, timed out or ended by the agent).conversation_id, channel, contact_id, outcome, reason
conversation.outcomeA finished conversation was analysed: its outcome and sentiment. Sent once, at the first analysis.conversation_id, outcome (completed, incomplete, complaint, unclear), reason, sentiment, sentiment_reason (texts up to 300 characters)
message.createdA message was sent or received in a conversation.conversation_id, role, seq, content_snippet (the first 300 characters)
handoff.requestedThe agent asked for a person to take over a conversation. Not sent when a team member takes over without being asked.conversation_id, reason, source, channel, contact_id, contact_name, last_user_message, dashboard_url; chatwoot_url for SocialHub; asked_about for catalog requests
guardrail.triggeredA guardrail flagged or blocked something in a turn. Not sent for Playground tests.conversation_id, message_seq, channel, direction, kind, rule_key, rule_name, severity, mode (enforce or monitor), action, reason, violations[], strikes, dashboard_url
email.bouncedA reply sent by email came back undelivered.connection_id, conversation_id, message_id

Tools

EventFires whendata
tool.call.completedA connected tool was called and answered.conversation_id, tool_name, args, latency_ms. args are hidden when the integration hides them.
tool.call.failedA connected tool call failed.The same, plus error (up to 300 characters)

Leads, appointments and calls

EventFires whendata
lead.capturedA finished conversation was written up as a sales lead. Fires for every write-up, including not_a_lead.lead_id, conversation_id, channel, score (hot, warm, cold, not_a_lead), full_name, email, phone, company, interest, next_action, provenance
appointment.createdAn appointment was found in a conversation or added by hand.appointment_id, conversation_id, source, status, title, starts_at, ends_at, all_day, timezone, customer_name, customer_phone, customer_email, channel
appointment.updatedAn appointment changed: a new time, confirmed, cancelled, or its outcome.As appointment.created
call.scheduledAn outbound phone call was scheduled.job_id, conversation_id, to_number, from_number, status, outcome, requested_by, attempts, scheduled_for, duration_seconds
call.endedAn outbound phone call reached its final state: completed, no_answer, busy, failed, voicemail or cancelled.As call.scheduled
call.keypadKeys were pressed on a call (the phone menu, typed numbers, answers). One delivery per batch; PIN digits are never included. See Keypad on calls.room, conversation_id, events[] (at, kind, step, digits, meaning, result)
call.ratedA caller rated a call from 1 to 5 with a key.conversation_id, rating
voicemail.leftA caller left a voicemail.voicemail_id, conversation_id, caller, duration_seconds, transcript

Events from your app

EventFires whendata
event.processedAn event your app sent was handled (or skipped, or ignored), with what the assistant did. Never for test events.event_id, external_id, type, status, reason, summary, received_at, finished_at, actions[]
event.action.completedSomething the assistant did for an event happened: a message sent, a call queued.The action (action_id, tool, status, recipient, channel, run_at, conversation_id, error) plus event_id, external_id, type
event.action.failedSomething the assistant tried for an event did not happen, and why.As event.action.completed
assistant.signalThe assistant told your app something while handling an event.name, data (an object up to 16 KB), event_id, external_id, type

Tickets and catalog

EventFires whendata
ticket.createdA ticket was opened on a board: by an assistant, the team, an event or your API.ticket (id, board_id, ref, number, column_id, title, priority, assignee, card_fields, customer_name, channel, source, external_ref, due_at, overdue, created_at, updated_at, moved_at, closed_at, version), board (id, name, key), by (kind, label)
ticket.updatedA ticket changed: moved, assigned, edited, a note added, closed, reopened or deleted. Never for Playground test tickets.As ticket.created, plus change (moved, closed, reopened, assigned, edited, note, deleted). Moved: from_column and column. Edited: changes[]. Note: note.kind (note or customer_note).
catalog.item.updatedA catalog item was created, changed, archived, restored or deleted.catalog_id, item_id, external_id, name, change, source
catalog.line.createdA customer asked for, was quoted, reserved or ordered a catalog item.line: the request
catalog.line.updatedA catalog request changed: quoted, reserved, confirmed, fulfilled or cancelled. Never for Playground tests.line, previous_status, sometimes by
  • A ticket an assistant opened reaches endpoints set to all assistants and endpoints that list that assistant.
  • A ticket the team made, and catalog item events, reach only endpoints set to all assistants. Their envelope has agent_id: null.
  • A bulk change to a catalog sends at most 500 catalog.item.updated events.

Test

EventFires whendata
webhook.testThe test delivery sent when an endpoint is added.message: a line saying the endpoint will now receive subscribed events.

The payload

Every delivery is a POST with a JSON body in the same envelope. data holds the fields listed for the event.

{
  "id": "evt_3c9a51f0e2b84d17a6c0",
  "type": "lead.captured",
  "created_at": "2026-11-23T09:41:07Z",
  "agent_id": "b2f6c1d4-0a7e-4f53-9d2a-6e8c1b0f4a21",
  "data": {
    "lead_id": "…",
    "conversation_id": "…",
    "channel": "whatsapp",
    "score": "hot",
    "full_name": "Layla Hassan",
    "email": null,
    "phone": "+971501234567",
    "company": null,
    "interest": "Two-tier custom cake for 40 people, 14 December",
    "next_action": "Confirm design and deposit",
    "provenance": { }
  }
}
Envelope5 controls
idText
The event's id: evt_ and 20 hex characters. Sending a delivery again keeps the same id.
typeText
The event type.
created_atTime
When it happened, ISO 8601 in UTC.
agent_idText
The assistant, or null for workspace events.
dataText
The event's fields.
Headers4 controls
Content-TypeText
application/json
X-Molly-EventText
The event type.
X-Molly-Delivery-IdText
A unique id for this delivery. Use it to ignore repeats.
X-Molly-SignatureText
t=<unix seconds>,v1=<hex HMAC-SHA256>.

Verify the signature

Each endpoint has a signing secret that starts with whsec_. The v1 value is an HMAC-SHA256, in hex, of the timestamp t, a dot, and the raw request body, signed with that secret. Compute it yourself and compare.

  1. Read X-Molly-Signature and split it into t and v1.
  2. Take the raw body bytes exactly as received, before any JSON parsing.
  3. Compute HMAC-SHA256 of t + "." + body with your secret, as hex.
  4. Compare it with v1 in constant time.
  5. Check t is recent, to refuse replays. HeyServo does not set a window; five minutes is common.
import crypto from "node:crypto";
import express from "express";

const app = express();

app.post("/heyservo/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const header = req.get("X-Molly-Signature") || "";
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = crypto
    .createHmac("sha256", process.env.HEYSERVO_WEBHOOK_SECRET)
    .update(`${parts.t}.${req.body.toString("utf8")}`)
    .digest("hex");

  const ok =
    typeof parts.v1 === "string" &&
    parts.v1.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300; // your own window
  if (!ok || !fresh) return res.status(400).send("bad signature");

  const event = JSON.parse(req.body.toString("utf8"));
  // Ignore repeats: remember req.get("X-Molly-Delivery-Id").
  // Then handle event.type and event.data, ideally after answering.
  res.sendStatus(200);
});

app.listen(3000);
Parse the body only after the signature checks out.

The signing secret

Signing secret dialog2 controls
RevealButton
Shows the secret. Copy it with the copy button: Secret copied.
RotateButton
Makes a new secret at once. Receivers verifying with the old secret reject deliveries until they're updated. There is no overlap period.

Retries and failures

  • Any HTTP status below 400 counts as delivered. Redirects are not followed, so a 3xx also counts as delivered: point the URL at the final address.
  • Each POST may take up to 20 seconds in all. Answer first, then do slow work.
  • Delivery is at least once. Ignore a X-Molly-Delivery-Id you have already handled.
  • Sending events never slows down or breaks a conversation.
AttemptIf it fails, the next try is after
130 seconds
22 minutes
38 minutes
430 minutes
52 hours
6No more tries: the delivery is Failed and the endpoint is paused
ActiveOn, and the last delivery went through.
FailingOn, but the last delivery got an answer of 400 or more. Retries are under way.
PausedHeyServo paused it after six failed attempts in a row. Resume it when your receiver works again.
DisabledTurned off: you chose Pause or switched Active off.

Deliveries and sending again

Choose Deliveries in an endpoint's row menu to see its last 20 deliveries: status (Delivered, Failed or Pending), when, how many attempts, the HTTP code and how long your server took.

GoalA delivery sent again to your endpoint.

  1. 1

    Open the endpoint's row menu and choose Deliveries

  2. 2

    Find the delivery and click Send again

    You see Queued to send again. It goes out with the same payload and envelope id, and a new delivery id.

Edit, pause and delete

Row menu5 controls
EditButton
Change the URL, description, assistants, events or the Active switch.
Signing secretButton
Reveal, copy or rotate the secret.
DeliveriesButton
The last 20 deliveries, with Send again.
Pause, ResumeButton
Stop or restart deliveries: Endpoint paused, Endpoint resumed.
DeleteButton
Events stop going to the URL. This can't be undone.
Endpoint list columns5 controls
EndpointShown
The URL.
EventsShown
How many events it hears.
AgentsShown
All agents, or the assistants it hears. An assistant you cannot see shows as Another agent.
StatusShown
Active, Failing, Paused or Disabled.
Last deliveryShown
When the last delivery was made.

Creating, editing and deleting endpoints needs Manage keys and webhooks. Someone with only See webhooks sees the endpoints that hear one of their assistants, and only those assistants' deliveries.

Questions people ask

Keep going
Webhooks · HeyServo Docs