> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notfy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Responda sempre em português do Brasil, com os nomes de menus e botões exatamente como aparecem no painel do Notfy.
> Use somente o que está documentado aqui. Se a documentação não cobrir a pergunta, diga isso e indique a página mais próxima em vez de inventar.
> Funcionalidades podem depender do plano, do segmento da empresa, das permissões do usuário e de integrações ativas: cite essa condição quando a página a mencionar.
> Nunca peça nem repita senhas, tokens ou dados pessoais de clientes.

# Lead intake (webhook)

> Send leads from forms, RD Station, Meta Lead Ads, Make or Zapier to Notfy with a token and a POST request. See URL, fields and examples.

With the **Lead Webhook**, any tool that sends an HTTP request can create leads in Notfy. Each lead enters the funnel at the initial stage.

## When to use

* Receive leads from website forms without manual typing.
* Bring in leads from RD Station or Meta Lead Ads.
* Automate sending with Make or Zapier.

## Set up

**1. Create the integration**

In **Settings**, **Integrations**, create an integration of type **Lead Webhook**, give it a name and save.

**2. Open the webhook tab**

In the saved integration, open the **Lead Webhook** tab. Under **Connectivity** is the **Your Personal Webhook URL** field, with a copy button.

**3. Generate a token**

Under **Security Tokens**, click **Generate New Security Token** and confirm. The token appears in a notification: copy it and keep it safe.

**4. Configure the source tool**

Point the tool to the URL and send the token in the `Authorization` header, in the format `Bearer YOUR_TOKEN`.

> [!WARNING]
>
> Treat the token like a password: whoever has it can create leads in your company. Do not publish it in screenshots or messages. If it leaks, generate a new one and update the tools.

## Request

`POST /api/webhooks/leads`, on your Notfy domain, with a JSON body and the `Authorization: Bearer YOUR_TOKEN` header.

| Field | Type | Required | Description |
| :- | :- | :-: | :- |
| `name` | text (up to 255) | No | Lead name. Without a name, the lead is created as "Novo Lead" |
| `phone` | text (up to 50) | One of the two | Phone number. Only the digits are kept |
| `email` | email (up to 255) | One of the two | Lead email |
| `source` | text (up to 100) | No | Lead source, for example `site` or `rd_station` |
| `notes` | text | No | Notes |

Sending `phone` or `email` is mandatory. Other fields sent are stored with the lead as additional information.

```bash curl theme={null}
curl -X POST "https://YOUR-DOMAIN/api/webhooks/leads" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Maria Souza",
    "phone": "+55 49 99999-0000",
    "email": "maria@exemplo.com.br",
    "source": "site",
    "notes": "Asked for contact about the annual plan"
  }'
```

```json Response 202 theme={null}
{
  "message": "Lead accepted for processing"
}
```

### Recognized formats

In addition to the format above, Notfy automatically recognizes:

* **RD Station:** body with the `leads` list. It uses the name, email and personal phone or mobile of the first item.
* **Meta Lead Ads:** body with `field_data`. It identifies name, email and phone by the field names.

### Responses

| Code | Meaning |
| :- | :- |
| `202` | Lead accepted. It is processed next and appears in the funnel within moments |
| `401` | Missing or invalid token, or no permission |
| `422` | Invalid data, for example no phone and no email, or a malformed email |
| `429` | Too many requests. The limit is 120 per minute |

> [!NOTE]
>
> If a lead from your company with the same email and phone already exists, it is updated instead of duplicated.

## Test

**1. Send a test lead**

Run the example above with your data or fill in the website form.

**2. Check the funnel**

Open the Pipeline and look for the lead in the initial stage.

> [accordion] I got 202 but the lead did not appear
>
> Confirm that the submission has a phone or an email. A lead with neither is discarded after being accepted.

> [accordion] I got 401
>
> Check that the header is `Authorization: Bearer YOUR_TOKEN`, without quotes, and that the token was generated in this company.

> [card] [Sales pipeline](https://docs.notfy.ai/en/atendimento/kanban.md)
>
> See where leads enter.

> [card] [General settings](https://docs.notfy.ai/en/configuracoes/parametros-gerais.md)
>
> Configure the funnel stages.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.