What are Webhooks?

A webhook lets Leadtrekker send the details of every new lead to another application as soon as the lead is created, for example a CRM, an automation platform such as Zapier, Make or Integrately, or a system you have built yourself.

You give Leadtrekker the URL of the receiving application and choose which lead fields to send and what to call them. Leadtrekker then makes an HTTP request to that URL with the chosen fields every time a new lead is added to your account.

Webhooks send data out of Leadtrekker. To send leads into Leadtrekker, use the Leadtrekker API instead.

When Webhooks Are Sent

A webhook is called once for every new lead created on your account, no matter how the lead was added (for example from a website form, the API, a landing page or manually in Leadtrekker).

  • Webhooks are only sent when a lead is created. Updating a lead, changing its status or adding notes does not call a webhook.
  • Only webhooks that are Enabled are called. New webhooks start out disabled so that you can map the fields first.
  • Every enabled webhook on your account is called for every new lead. Webhooks cannot be limited to certain sources or statuses.
  • Webhooks are sent while your Leadtrekker account is active: it may not be suspended, and it must either still be within its free lead allowance or have at least one licensed user.
  • Each webhook is called once. If the receiving application is unavailable, the call is not retried.

Setting Up a Webhook

Webhooks are managed under Settings > Integrations > Webhooks in Leadtrekker.

  1. Click Add webhook.
  2. Give the webhook a name so that you can recognise it later, for example Send leads to our CRM.
  3. Choose the method. Use POST unless the receiving application tells you otherwise (see The Request).
  4. Enter the URL that the receiving application gave you, and click Add webhook.
  5. On the webhook's page, map the fields that should be sent.
  6. Switch the webhook to Enabled and click Update.

Test With a Real Lead

The easiest way to test a new webhook is to enable it and add a test lead. The response from the receiving application is saved on the lead's audit trail (see Responses & Troubleshooting).

Mapping Fields

Only the fields that you map are sent. For each field you choose a Leadtrekker lead field and the webhook field name that the receiving application expects, for example Lead Name → first_name.

  • Webhook field names are case sensitive and must match the names the receiving application expects exactly. Email and email are different fields.
  • Each webhook field name can be used once per webhook. Mapping a second lead field to the same name replaces the first one.
  • The same lead field can be sent more than once under different names.

Available Lead Fields

Lead Field Value Sent
Lead ID The lead's unique Leadtrekker ID, for example 994913.
Lead Name The name of the lead.
Lead Number The lead's phone number.
Lead Email The lead's email address.
Lead Company The lead's company name.
Lead Source The name of the lead's source, for example Website.
Lead Status The name of the lead's status when it was created, for example Pending.
Custom fields Any custom field configured on your account. The lead's value for that custom field is sent. If the lead has no value for it, the field is left out of the request.

The Request

Leadtrekker sends the mapped fields in the body of the request, encoded as multipart/form-data, in the same way that a web form with those field names would be submitted. The fields are not sent as JSON.

For example, with the mappings Lead Name → first_name, Lead Email → email and Lead Source → source, the receiving application gets the form fields:

first_name = Jane Smith
email      = jane@example.com
source     = Website

POST or GET

Use POST. With GET, Leadtrekker still sends the fields in the request body rather than in the URL's query string, and most applications ignore the body of a GET request, so the fields would not arrive. Only choose GET if the receiving application specifically reads form data from GET requests.

Receiving the Fields

Most platforms read form data automatically. If you are building the receiving end yourself in PHP, the fields arrive in $_POST:

<?php
// Leadtrekker webhook receiver
$name   = isset($_POST['first_name']) ? $_POST['first_name'] : '';
$email  = isset($_POST['email']) ? $_POST['email'] : '';
$source = isset($_POST['source']) ? $_POST['source'] : '';

// ... save the lead in your own system ...

echo 'OK';

Security

Leadtrekker does not add authentication headers or a signature to webhook requests. To make sure that only Leadtrekker can post to your endpoint:

  • Always use an https:// URL so that lead details are encrypted in transit.
  • Use the long, hard-to-guess URL that automation platforms generate for you, or add a secret of your own to the URL, for example https://example.com/leadtrekker-webhook?token=YOUR-SECRET, and check it on your side.
  • Keep webhook URLs private. Anyone who knows the URL can send data to it.

Your Leads Are Your Data

Lead details sent through a webhook leave Leadtrekker and are handled by the receiving application. Only send leads to applications and providers that you trust with your lead data.

Responses & Troubleshooting

After calling a webhook, Leadtrekker saves the receiving application's response on the lead's audit trail as "<webhook name> webhook call result: <response>." Open the lead and check its audit trail to see what the receiving application replied.

If Leads Are Not Arriving

  • Check that the webhook is switched to Enabled.
  • Check that the lead was newly created. Updates to existing leads do not call webhooks.
  • Check that at least one field is mapped, and that the webhook field names match the receiving application's field names exactly, including upper and lower case.
  • Check that the method is POST.
  • Check the URL for typos, and that the receiving application is online.
  • Look at the response saved on the lead's audit trail for an error message from the receiving application.

Support

Should you experience any difficulty setting up a webhook, please contact us or send an email to support[at]leadtrekker.com.