# Website forms, webhooks and Zapier

Send leads from a website form, Zapier, Make or your own code into Lead with a webhook URL, and know what comes back.

Source: https://support.rework.com/article/lead-webhooks

> **In plain words:** A **webhook** is a web address that Lead gives you. When another tool sends a lead's details to that address, Lead creates the lead. You use it to connect a website form, a landing page builder, Zapier, Make or your own code, without any export or copy-paste. This page shows you how to set it up. It ends with a section you can hand to a developer. New to the words **lead**, **source** and **service**? See [Lead basics: words to know](https://support.rework.com/article/lead-basics).

**Where to find it:** Lead > **Settings** in the left sidebar > **Lead sources** > **Source integrations** > click a source > tab **Details**. **Who can use it:** People who can manage the lead service you send leads to.

## Pick the right kind of source

Lead has one kind of web address, and several source types that use it. They differ in setup help and in how the lead's channel is decided.

| 
You have

 | 

Use this source type

 | 

Why

 |
| --- | --- | --- |
| 

A form on a page built with Webflow, Unbounce, Wix, Ladipage or HighLevel

 | 

The source with that name, in the **Landing pages** group

 | 

The builder can send each form submission to a webhook. Lead's channel comes from the page's tracking details (UTM tags and the referring site).

 |
| 

A tool that Zapier or Make can connect to (Google Sheets, Typeform, a CRM, and so on)

 | 

**Zapier** or **Make**, in the **Connectors** group

 | 

Zapier and Make watch the other tool and send each new entry to the webhook.

 |
| 

Your own website code or app

 | 

**HTTP API**, in the **API** group

 | 

A developer sends the lead as JSON from your own code.

 |

The **channel** of a lead says where it came from, such as Facebook Ads or Trade Show. For HTTP API, Zapier, Make and HighLevel, send a `lead_channel` field to set it. Without one, the lead's channel is Unknown. See [Channels and attribution](https://support.rework.com/article/lead-channels-and-attribution).

## Set it up

1. In Lead, open **Settings**, then **Lead sources**. Choose the lead service the leads should land in.
   
2. On the **Source integrations** tab, click **Connect new**, then click **Connect** on your source type.
   
3. Type a **Name** for the source, such as "Website: pricing page", and click **Connect**. The steps are in [Connecting sources](https://support.rework.com/article/lead-connecting-sources).
   
4. Click the new source's name. The **Details** tab opens.
   
5. Under **Endpoint**, copy the web address. You can also use **Copy webhook URL** in the source's row menu.
   

![The Details tab of a Generic API source, with the Endpoint box and its copy button](https://storage.googleapis.com/reworkv3-public/success/261015/FWtgzQJBU2rrQG3h6b5BvUrG8pQfxUgrvflVwil4AIR4FJEjqWkUYs9Jbxc9Q96f/img.zh0M1M1gKduqnKYlP6NFhZYRylvA2LBcq1lRu6tTwxxMEqTQxYV0itNcDfzFTSQY.png)

1. Open your website builder, Zapier or Make. Add a webhook step or integration that sends form submissions to that address. The **Details** tab shows setup tips for the builder you chose, at the top.
   
2. Submit one real test entry through your form.
   
3. In Lead, open the lead list of that service. The test lead should be at the top.
   

> **Important:** The address contains a secret token. Anyone who has the address can create leads in your service. Do not post it on a public page, in a shared document or in a support ticket.

Next, check that the answers landed in the right fields. Open **Transform fields** on the source and follow [Mapping a source's fields](https://support.rework.com/article/lead-mapping-source-fields).

### What each tool needs

- **Zapier:** add a "Webhooks by Zapier" action, choose POST, paste the address, and map your trigger's fields to the lead fields listed on the **Details** tab.
  
- **Make:** add an "HTTP" module with "Make a request", choose POST, paste the address, and map the fields in the same way.
  
- **Webflow, Wix, Unbounce, Ladipage, HighLevel:** in the builder's form or automation settings, add a webhook that posts submissions to the address. Each builder names this differently, so follow the setup tips on the source's **Details** tab and the builder's own help.
  

## What a lead needs to be accepted

Each lead needs at least one way to identify it: a **name**, an **email**, a **phone number**, or an **external id** (a number or code from your own system, such as a form entry id). A lead with none of these is rejected.

If the same external id arrives again, Lead does not create a second lead.

## Change or stop the address

- **Regenerate token** (in the source's row menu) makes a new address. The old address stops working at once, so update the sending tool straight away.
  
- **Disconnect** pauses the source. While paused, the address does not accept leads. **Reconnect** turns it back on.
  
- Leads sent while you are viewing demo data still go into your real data. They will not appear until you leave demo mode.
  

## For your developer

Hand this section to the person who writes the code. Your **Details** tab shows your exact address and the list of field codes your service accepts.

### The two addresses

| 
Use

 | 

Address ends with

 | 

Body

 |
| --- | --- | --- |
| 

One lead

 | 

`/lead`

 | 

One JSON object, or a form-encoded body

 |
| 

Many leads

 | 

`/lead.bulk`

 | 

A JSON array, or an object `{"leads": [ ... ]}`, up to 500 leads

 |

Both addresses share the same token:

```
POST https://your-lead-domain/webhook/incoming/YOUR_TOKEN/lead
POST https://your-lead-domain/webhook/incoming/YOUR_TOKEN/lead.bulk
```

- The token is in the path, before `lead`. Copy the whole address from the source, and swap only the last part for the bulk address.
  
- Send a `POST`. Other methods get a 404.
  
- Send `Content-Type: application/json` for JSON, or `application/x-www-form-urlencoded` for a form post.
  
- No other header or password is needed. The token is the credential.
  

### Example request

```
{
  "ext_id": "form-2210",
  "name": "Kim Nguyen",
  "email": "kim@example.com",
  "phone": "+84909123456",
  "your_budget": "5000",
  "lead_channel": "FB_ADS",
  "utm_source": "facebook",
  "utm_medium": "cpc",
  "utm_campaign": "spring-launch"
}
```

- `ext_id` is your own id for the entry. `id`, `lead_id` and `leadgen_id` also work as the external id.
  
- `name`, `email` and `phone` fill the matching lead fields. Other keys fill a lead field with the same code, or match through the source's mapping. Keys with no match are kept with the lead as raw data.
  
- `lead_channel` sets the channel for HTTP API, Zapier, Make and HighLevel sources. Use a channel code such as `FB_ADS`, `GOOGLE_ADS` or `TRADE_SHOW`.
  
- `utm_source`, `utm_medium`, `utm_campaign`, `utm_term` and `utm_content` are stored with the lead's attribution. Landing page sources also read UTM tags and the referring page to work out the channel.
  

A bulk request with two leads:

```
{
  "leads": [
    { "ext_id": "a1", "name": "Kim Nguyen", "email": "kim@example.com" },
    { "ext_id": "a2", "name": "Lan Tran", "phone": "+84901234567" }
  ]
}
```

### What comes back

| 
Situation

 | 

Response

 |
| --- | --- |
| 

Lead saved

 | 

`200` with `{"ok": true, "lead_id": "...", "deduped": false}`

 |
| 

Same external id sent before and already processed

 | 

`200` with `{"ok": true, "lead_id": "...", "deduped": true}`. The first lead is left as it was.

 |
| 

Lead rejected, for example no name, email, phone or external id

 | 

`200` with `{"ok": false, ...}`. A rejected lead still gets a 200, so always check `ok`.

 |
| 

Wrong, regenerated or disconnected token, or a method other than POST

 | 

`404`, with no detail

 |
| 

The lead service is inactive

 | 

`409` with the message "This service is inactive and does not accept new records." Retrying will not help until the service is active again.

 |
| 

Bulk accepted

 | 

`200` with `{"ok": true, "queued": 2}`. The leads are saved in the background after this reply.

 |
| 

Bulk body is not valid JSON

 | 

`400` with "invalid JSON"

 |
| 

Bulk body has no list

 | 

`400` with "leads array required"

 |
| 

Bulk body has more than 500 leads

 | 

`400` with "max 500 leads per request"

 |

Notes for testing and operations:

- Keep the `lead_id` from each reply. It identifies the lead in the [Public API](https://support.rework.com/article/lead-public-api), which reads and updates leads but does not create them.
  
- A bulk request that is accepted does not tell you about each lead. Leads that fail validation are skipped. Send a few single leads first to check your field codes.
  
- If the sender sees a 404 after working before, someone regenerated the token or disconnected the source. Copy the address again from the source.
  
- Webhook leads always go into real data, even if the person who set it up is viewing demo data.
  
- If one of your fields has a value that does not match a dropdown option in Lead, the lead is still saved and that one field is left empty. See [Mapping a source's fields](https://support.rework.com/article/lead-mapping-source-fields).
  

## Troubleshooting

| 
Problem

 | 

Why it happens

 | 

What to do

 |
| --- | --- | --- |
| 

The sender reports a 404

 | 

The address is wrong, the token was regenerated, or the source is disconnected

 | 

Copy the address again from the source. Check the source is not **Paused**.

 |
| 

The sender reports a 409

 | 

The lead service is inactive

 | 

Make the service active again in its settings.

 |
| 

The sender gets success but no lead appears

 | 

The lead was rejected (for example no name, email, phone or id), or the lead went to another service

 | 

Check the reply for `"ok": false`. Check which service the source belongs to.

 |
| 

The lead appears but some fields are empty

 | 

The incoming field names do not match any lead field

 | 

Open **Transform fields** and map them. See [Mapping a source's fields](https://support.rework.com/article/lead-mapping-source-fields).

 |
| 

The lead shows Unknown as its channel

 | 

HTTP API, Zapier, Make and HighLevel need a `lead_channel` field to set it

 | 

Add `lead_channel` to the payload, or set the channel in your tool.

 |
| 

You cannot see leads sent in a test

 | 

You are viewing demo data

 | 

Leave demo mode. Test leads are in your real data.

 |

More help: [Playbook: get website form leads into Lead](https://support.rework.com/article/lead-playbook-website-form), [Fix it by symptom](https://support.rework.com/article/lead-fix-by-symptom) and [Common errors and fixes](https://support.rework.com/article/lead-common-errors).
