Webhooks

Receive a JSON POST each time something happens in your Emelia campaigns: email sent, opened, clicked, replied, bounced, LinkedIn invitation accepted, WhatsApp reply, campaign finished.

A webhook is a URL that Emelia calls with a JSON POST each time a selected event happens in a campaign: a reply, an acceptance, a bounce. Use it to update your CRM, alert your team or route replies the moment they arrive.

The routes below work on advanced campaigns, the multichannel campaigns of the current app.

Create a webhook

POST/webhook
curl -X POST https://api.emelia.io/webhook \
  -H "Authorization: $EMELIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "hookUrl": "https://hooks.yourcompany.com/emelia/9f2c4e1a7b",
    "campaignId": "6651f0c2a1b2c3d4e5f60718",
    "type": "advanced",
    "events": ["MAIL_REPLIED", "LINKEDIN_REPLIED"]
  }'
Response
{ "success": true, "webhookId": "6702c1d4e5f6a7b8c9d0e1f2" }
FieldValue
hookUrlThe URL that receives the events. Use a public HTTPS URL that is hard to guess.
campaignIdThe id of a campaign, or ALL_CAMPAIGNS for all your campaigns, current and future, except the finished or archived ones.
typeAlways advanced. Without it, the route works on legacy campaigns.
eventsThe events to receive. A misspelled name is accepted and never fires.

To change the events of a URL on a campaign, delete the URL and create it again: a URL registered twice receives everything twice.

With ALL_CAMPAIGNS, webhookId is the id of your account. Read the ids of the registrations with List webhooks.

Send a test event

POST/webhook/{hookId}/test
curl -X POST https://api.emelia.io/webhook/6702c1d4e5f6a7b8c9d0e1f2/test \
  -H "Authorization: $EMELIA_API_KEY"

Your URL receives a MAIL_REPLIED event with test: true and a fake contact. A success: true response means that the event was sent, not that your endpoint accepted it: check on your side that it arrived.

Events

Pick the names to pass in events. The full payload of each is on Campaign activity and Campaign finished.

Email

EventWhen
EMAIL_SENTAn email step was sent. The name is EMAIL_SENT, not MAIL_SENT.
OPENED, CLICKEDThe tracking pixel loaded, or a tracked link was clicked. Needs tracking on the campaign. Delivered 30 to 60 seconds later.
WEBSITE_VISITEDA contact who clicked a tracked link triggered one of your pixel rules that has the "Create an activity in the campaign" action, once per rule and per contact. Needs the Emelia pixel on the site. rule is the name of the rule, link the page seen. Delivered 30 to 60 seconds later.
MAIL_REPLIEDFirst email reply of the contact, with reply, sentiment, sender and messageId.
RE_REPLY_EMAILEvery later email of a contact who already replied, with reply, date (of the message) and messageId. No sentiment.
BOUNCEDA bounce was detected. No campaign field, step is 0.
UNSUBSCRIBEDThe contact unsubscribed.

LinkedIn

EventWhen
VISITED, INVITED, ACCEPTED, INMAIL_SENT, LIKEDLinkedIn actions.
MESSAGE_SENTA LinkedIn message was sent, with the text in content.
LINKEDIN_REPLIEDFirst LinkedIn reply of the contact, with reply and sentiment.
RE_REPLY_LINKEDINEvery later LinkedIn message of a contact who already replied, with reply, date (of the message) and messageId. No sentiment.

RE_REPLY_EMAIL and RE_REPLY_LINKEDIN are sent only if you subscribe to them. They are not stored: absent from the activities route, no replay, and nothing once the campaign is finished.

WhatsApp

EventWhen
WHATSAPP_MESSAGE_SENTA WhatsApp message was sent.
WHATSAPP_REPLIEDA WhatsApp reply was received, with reply.

Campaign

EventWhen
CAMPAIGN_ENDINGThe campaign was closed by the daily job, see Campaign finished.

Never sent for these campaigns: SENT, MAIL_SENT, FOLLOWED, TASK_COMPLETED, TASK_FAILED.

A MAIL_REPLIED delivery looks like this:

{
  "event": "MAIL_REPLIED",
  "campaign": "Q4 SaaS founders",
  "campaignId": "6651f0c2a1b2c3d4e5f60718",
  "senderName": "Marie Martin",
  "sender": "marie.martin@yourcompany.com",
  "contact": {
    "id": "6703d2e5f6a7b8c9d0e1f2a3",
    "firstName": "Claire",
    "lastName": "Fontaine",
    "email": "claire.fontaine@nexora.io",
    "company": "Nexora"
  },
  "date": "2026-10-13T10:20:00.000Z",
  "step": 0,
  "reply": "Hi Marie, sounds interesting. Can we talk on Tuesday?",
  "sentiment": { "classification": "INTERESTED", "score": 0.92 },
  "messageId": "<CAF7x2y3z@mail.nexora.io>"
}
  • contact starts with the custom variables of the contact, then the standard fields. company is the first custom variable whose name contains "company".
  • sentiment is the AI classification of the reply: INTERESTED, NOT_INTERESTED, NEUTRAL, OUT_OF_OFFICE, HOSTILE, DELEGATION, INCOMPREHENSION or QUESTION_ASK, with a score. It is present only when reply classification runs on your account.
  • date is an ISO 8601 date in UTC, usually the time Emelia processed the event.
  • Absent fields are omitted, never null.

Receive the events

Answer fast with a 2xx, then do the work in the background.

# Simulate a delivery on your local endpoint
curl -X POST https://hooks.yourcompany.com/emelia \
  -H "Content-Type: application/json" \
  -d '{"event": "MAIL_REPLIED", "campaign": "Q4 SaaS founders", "contact": {"email": "claire.fontaine@nexora.io"}, "date": "2026-10-13T10:20:00.000Z", "step": 0, "reply": "Can we talk on Tuesday?"}'

List and delete your webhooks

GET/webhook
curl https://api.emelia.io/webhook \
  -H "Authorization: $EMELIA_API_KEY"
Response
{
  "webhooks": [
    {
      "id": "6702c1d4e5f6a7b8c9d0e1f2",
      "typeOfCampaign": "advanced",
      "campaignId": "6651f0c2a1b2c3d4e5f60718",
      "campaignName": "Q4 SaaS founders",
      "url": "https://hooks.yourcompany.com/emelia/9f2c4e1a7b",
      "events": ["MAIL_REPLIED", "LINKEDIN_REPLIED"],
      "status": "active"
    }
  ]
}

There is one entry per campaign: a URL registered on all your campaigns appears once for each of them.

DEL/webhook
curl -X DELETE https://api.emelia.io/webhook \
  -H "Authorization: $EMELIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "hookUrl": "https://hooks.yourcompany.com/emelia/9f2c4e1a7b",
    "campaignId": "6651f0c2a1b2c3d4e5f60718",
    "type": "advanced"
  }'

With ALL_CAMPAIGNS in campaignId, the URL is removed from all your campaigns and is no longer added to new ones.

You can also list, test and delete your webhooks in the Emelia app, in Settings, API & Webhooks.

Delivery rules

Build your handler for these rules:

  • No signature. Deliveries carry Content-Type: application/json and nothing else: no secret, no signature header. Use a URL that is hard to guess, and treat the payload as a hint: confirm important facts with the API before acting on them.
  • No retry on HTTP errors. Your response is ignored. A few events are retried on network errors only. An endpoint that is down misses the events.
  • No ordering. Events come from different services: an OPENED can arrive after the MAIL_REPLIED.
  • No event id. To deduplicate, build a key from event, campaign, the contact and step. A URL registered twice on a campaign receives everything twice.
  • No timeout on Emelia's side, but answer in a few seconds anyway.

Other webhooks: legacy campaigns have their own events (email, LinkedIn), and the LinkedIn scraper has its own FINISHED and ERROR webhooks.

On this page