Skip to main content

Webhooks

Send Lodgix events to your own tools

Written by Bobby Wiles

Webhooks let Lodgix notify an outside system the moment something happens in your account. When an event you subscribe to occurs, Lodgix sends an HTTP POST with a JSON payload to a URL you choose. This is how you connect Lodgix to automation platforms like n8n or to your own custom service.

You will find the Webhooks located under Modules > Integrations > Webhooks.

Create a Webhook

  1. Go to Modules, then Integrations, then Webhooks.

  2. Click Create Webhook (or Add Endpoint if you already have an existing webhook).

  3. Give it a Name so you can recognize it later (for example, "n8n Webhook").

  4. Enter the Endpoint URL. This must start with https://. Lodgix will POST to this URL.

  5. Select the events you want to receive. Such as Message Received.

  6. Click Create.


Request headers

Every delivery includes these headers:

X-Lodgix-Event The event type, for example message.received

X-Lodgix-Delivery A unique ID for this delivery

X-Lodgix-Timestamp Unix time (seconds) when the request was signed

X-Lodgix-Signature The signature of the payload (see Verifying below)


Verifying the payload is really from Lodgix

Every request is signed with the secret from your endpoint, so you can confirm it genuinely came from Lodgix and was not tampered with. The signature is in the X-Lodgix-Signature header in the form sha256=<hash>, where the hash is:

HMAC_SHA256(secret, "{X-Lodgix-Timestamp}.{raw request body}")

To verify a request:

  1. Read the X-Lodgix-Timestamp and X-Lodgix-Signature headers.

  2. Compute HMAC_SHA256(your_secret, timestamp + "." + raw_body).

  3. Compare it to the value after sha256= in the header. Use a constant time comparison.

  4. Reject the request if the timestamp is more than 5 minutes old, to prevent replay.

Important: sign the raw request body exactly as received. Do not re-serialize the JSON first, because changes in spacing or key order will produce a different signature.

n8n MHAC Verification Example

  1. In the Webhook trigger node, turn Raw Body on under Options.

  2. Add an Extract from File node (operation: Extract From Text File, input binary field: data) to get the raw body as text.

  3. Use a Crypto node (HMAC, SHA256) with the value {{ $('Webhook').item.json.headers['x-lodgix-timestamp'] }}.{{ $json.body_text }} and your secret, output as HEX.

  4. Compare sha256= plus that value to the x-lodgix-signature header, and check the timestamp is recent, before continuing.

Did this answer your question?