Inbound webhooks
Create an address your own systems can post to, sign each delivery with its secret, and use it to start a flow with the Webhook received trigger.
An inbound webhook is an address (URL) that your own system, such as a CRM, shop or booking tool, can post to. Each delivery can start any flow whose Webhook received trigger uses that endpoint. Every delivery must be signed with the endpoint's secret, so nobody else can start your flows.
Note: Every role except Billing Administrator can see inbound webhooks. Owners, Admins and Marketing Managers can create them, replace their secrets and disable or enable them.
This page is about posting into IconEngage to start a flow. To have IconEngage post events out to your system, see Event webhooks.
Create an inbound webhook
- Go to Automation › Inbound webhooks.
- Click Create an inbound webhook.
- Enter a Name, so you can recognise it when choosing it in a trigger.
- Enter a Signing secret: at least 32 characters (up to 256). Use a long random value and store the same value on your system. Click Show secret to check what you typed.
- Click Create inbound webhook.
The secret is stored encrypted and never shown again. Afterwards you see only its last four characters.
You can also create one without leaving the flow builder: in a Webhook received trigger, click Create a new inbound webhook. The new endpoint is chosen for that trigger at once.
The list
| Column | What it shows |
|---|---|
| Name | The endpoint's name. |
| URL | Hidden until you click Show URL. Click Copy URL to copy it. |
| Signing secret | "Ends" and the last four characters. |
| State | Accepting deliveries or Refusing every delivery. |
| Last accepted delivery | When a delivery was last accepted, or Never. |
Tip: Treat the URL like a password: its last part is what lets a system reach this endpoint. Only a correctly signed delivery is accepted.
From a row's actions you can:
- Replace signing secret: the URL stays the same. The new secret works from the moment you save it, and the old one stops at once with no overlap. Update your system at the same moment, or disable the endpoint first if it can't switch instantly.
- Disable: the endpoint refuses every delivery until you Enable it again.
How your system signs a delivery
The page shows these rules under How your system signs a delivery:
- Send a POST with a JSON object as the body, at most 256 KB.
- Set the
X-IconEngage-Timestampheader to the current time in Unix seconds. Deliveries more than 5 minutes off are refused. - Set the
X-IconEngage-Signatureheader tov1=followed by the hex HMAC-SHA256, using the signing secret, of the timestamp, a full stop, and the exact body bytes. - An answer of
202means the delivery was received.409means this exact delivery was already received, and nothing runs twice.
For example, from a shell:
TS=$(date +%s)
BODY='{"customer":{"wa_id":"919876543210"},"order":{"id":"A-1001"}}'
SIG=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')
curl -X POST "$ENDPOINT_URL" \
-H "Content-Type: application/json" \
-H "X-IconEngage-Timestamp: $TS" \
-H "X-IconEngage-Signature: v1=$SIG" \
--data "$BODY"A 202 only means the delivery was received. Whether a flow starts is decided afterwards, as described below.
Use it in a flow
- In a flow's draft, add the Webhook received trigger.
- Under Inbound endpoint, choose your endpoint. Disabled endpoints are marked "(disabled)".
- Under Where the contact's WhatsApp number is, enter the path to the customer's WhatsApp number in your JSON, for example
customer.wa_id. The number must include the country code; a leading+, spaces and dashes are ignored. - Under Copy from the delivery, click Add mapping for each value you want in the flow: a path (like
order.id) and the variable to put it in. Declare the variables first under Variables. Up to 20 mappings. - Build the rest of the flow and publish it.
What happens to each delivery:
- The number belongs to one of your contacts: a run starts for that contact.
- The number is not one of your contacts: no run starts. It is counted on the version's page as Webhook named no contact of yours. The webhook does not create contacts.
- You left the path blank (or the path isn't in the delivery): the run starts with no contact, so no step can message anyone, but HTTP and webhook steps still work.
The delivery is only ever read as data. Because the run has no conversation yet, the first message step must have Send from chosen and is usually a template. See Flows and WhatsApp numbers.
Tip: Test the flow with Test, filling in the mapped values under What the trigger received, before you point your real system at it.
Still need help?
Write to us at [email protected] and tell us what you were trying to do. Already a customer? Sign in to IconEngage — the same articles are under Help in the app.