Skip to main content
Lekalao calls your application when something happens: a subscription, an unsubscribe, a bounce. You create the address to call in Settings → Outgoing webhooks (how to).

The request

One JSON POST per event and per endpoint:
Answer with a 2xx code within 15 seconds. Redirects are not followed.

The events

Subscribers

subscriber.created, subscriber.confirmed, subscriber.unsubscribed, subscriber.tag_added, subscriber.tag_removed.
tag is there only for the two tag events.
Someone who subscribes to a double opt-in list and never confirms sets off no event at all.

Campaigns

campaign.sent, once a campaign’s last e-mail has gone out:

Provider feedback

mail.bounced and mail.complaint, when a provider reports a bounce or a complaint:
type is hard_bounce, soft_bounce or complaint. campaign is null for a transactional or automation e-mail.

Filtering by list

An endpoint set to Only for one list hears only about that list. campaign.sent follows the campaign’s list.

Check the signature

X-Lekalao-Signature is the HMAC SHA-256, in hexadecimal, of the raw body of the request, with the endpoint’s signing secret. Compute it on the bytes you received, before any JSON decoding, and compare in constant time.
Do not re-encode the JSON before computing the signature: one space or a different key order changes the result.

Failures

  • Lekalao does not retry on its own. Every call is in the Calls we made log, with your server’s answer, and Send again replays it.
  • After 10 failures in a row, the endpoint is switched off. Switch it back on once your server is fixed.

Advice

  • Answer quickly. Queue the work and answer 204 at once.
  • Be idempotent. The same event can arrive twice, after a Send again for example: keep track of what you have already handled (event, id or address, date) to ignore a duplicate.
  • Do not count on the order. Two events close together can arrive the wrong way round; read the resource back through the API when the state matters.
  • Locally, expose your server through a tunnel (ngrok, Cloudflare Tunnel): Lekalao refuses to call a private address or localhost.