Configure webhooks | Guides | Metrikia
Advanced4 min

Configure webhooks

Receive every new lead or won deal within seconds in Zapier, Make, n8n or your server, with an authentication header and an HMAC signature.

What is a webhook?

A webhook is a notification Metrikia sends automatically to the address of your choice when an event happens, for example a new lead. You get the information within seconds, without polling Metrikia. It is how you connect Metrikia to Zapier, Make, n8n or your own server.

Prerequisites

  • Be an owner or an administrator of your Metrikia workspace.
  • A public HTTPS address that accepts JSON POST requests and answers with a 2xx code within 10 seconds (a Zapier, Make or n8n webhook works).

Events sent

EventWhen it is sent
lead.created (Lead created)A lead is created in Metrikia: manual entry, public form, AI assistant. Leads imported by a CRM sync do not trigger it.
lead.updated (Lead updated)A lead is edited in Metrikia.
appointment.created (Appointment created)An appointment is created: booked in Metrikia or synced from your closing tool. Appointments imported from history do not trigger it.
deal.won (Deal won)A sale becomes won: payment recorded in Metrikia, Stripe or GoCardless payment, sync of your CRM. Sales imported from history do not trigger it.

The "Deal lost" event appears in the list but is not sent yet.

Create a webhook

  1. Open Settings > API & Webhooks (/app/settings?s=api-webhooks).
  2. In the Webhooks section, enter the webhook URL (HTTPS required).
  3. Tick the events you want to receive.
  4. Optional: enter an authentication header (name and value), for example Authorization with the value Bearer followed by your token, or X-Webhook-Secret with a secret of your choice. It is sent with every delivery.
  5. Click Create webhook.
  6. Copy the signing secret shown (it starts with whsec_) and keep it safe: it is shown only once.

Expected result: the webhook appears in the list, with the name of its authentication header if it has one. The header value is never shown again.

What a delivery contains

Each delivery is a POST request with a JSON body and these headers:

  • X-Webhook-Event: the event type.
  • X-Webhook-Timestamp: when it was sent.
  • X-Metrikia-Signature: sha256= followed by the HMAC SHA-256 signature of the raw body, computed with your signing secret.
  • X-Webhook-Delivery: the delivery id. It stays the same when Metrikia automatically retries that delivery.
  • Your authentication header, if you set one.

Example for lead.created (metadata fields are present only when known):

{
  "event": "lead.created",
  "timestamp": "2026-11-07T10:00:00+00:00",
  "data": {
    "id": "0193f6a2-...",
    "firstName": "Julie",
    "lastName": "Martin",
    "fullName": "Julie Martin",
    "email": "julie@example.com",
    "phone": "+33612345678",
    "status": "new",
    "source": "setting",
    "created_at": "2026-11-07T10:00:00+00:00",
    "metadata": {
      "utm_source": "instagram",
      "utm_campaign": "launch"
    }
  }
}

Secure the receiving end

Two methods, which you can combine:

  • Authentication header: the simplest. Your tool rejects any request without the right header (in n8n, the Header Auth authentication of the Webhook node, and in Make or Zapier, a filter on the header).
  • HMAC signature: the most robust. Compute the HMAC SHA-256 of the raw body (before any transformation) with your secret, compare it with the value of X-Metrikia-Signature after sha256=, and reject the request if they differ.

Manage an existing webhook

  • Authentication header: on the webhook row, set, replace or remove the header. To replace it, enter a new value.
  • Rotate the secret: generates a new signing secret, shown only once. The old one stops working immediately: update your tool right after. Webhooks created before the secret was shown must go through this step to verify the signature.

Good practices

  • Answer fast (under 10 seconds) and process the content afterwards.
  • Use X-Webhook-Delivery to ignore a retry of a delivery you already processed, and data.id to process the same object only once. A delivery resent from the history gets a new delivery id.
  • Filter on data.source if you only want to process some of the leads.

Track and resend deliveries

  1. Open Settings > API & Webhooks (/app/settings?s=api-webhooks).
  2. On the webhook row, click History.
  3. Review the last 50 deliveries: date, event, attempt number, HTTP code, duration and result (Delivered, or the cause of the failure).
  4. On a failed delivery, click Resend. Metrikia sends the object again with its current data, as a new delivery.

Expected result: the message "Resend queued" appears. Click Refresh: the new delivery shows up with the Resend label.

The Resend button appears only on the last attempt of a failed delivery, once the automatic retries are over. Each delivery can be resent once. The history keeps each attempt for 30 days, without the content sent.

Common issues

  • I receive nothing: check that the address is public and uses HTTPS, that the event is ticked, and that the action really triggers this event (see the table). Private or local addresses are refused.
  • My tool answers 401 or 403: check the name and value of the authentication header. If in doubt, enter the value again.
  • My header is refused: some names are reserved (Host, Content-Type, Cookie, X-Webhook-..., X-Metrikia-...). Authorization is allowed. The value is limited to 728 plain characters, with no line break.
  • The signature does not match: compute it on the raw body, not on reformatted JSON, and check that you use the latest secret shown.
  • My tool was down: Metrikia retries three times within a few seconds, then gives up on that delivery. Open the webhook history to see the cause, then click Resend once your tool is back.
  • The result says Host unreachable: the address does not exist, does not answer or points to a private network. Check the webhook URL.
  • The resend is refused: the delivery was already resent (resend the last attempt of the new delivery instead), the webhook is paused or no longer receives this event, or the lead or deal is archived, anonymized or erased.

To go further, check out our blog, the documentation or contact support.

Ready to take action?

Create your Metrikia account and apply this guide in minutes.