# Webhooks

> Send every new lead as JSON to a URL of your own: your app, Make, n8n or any tool that takes a webhook.

Every section below does the same job: in the dashboard (Guide), from your code (API) or through an AI assistant (MCP).

## Guide — In the dashboard

Source: /docs/automations/webhook

Each lead that matches the automation is sent as a JSON POST to your URL: the person, their company, the pages they saw and the lead link. Every request carries a signature header you can check with your website's webhook secret.

1. **Automations → New automation**, then **Trigger webhook**.
2. **Paste your URL** and choose: every lead, or only leads with a suggested contact.
3. **Send a test lead** to check your endpoint, then **Save**.


---

## API — From your code

Source: /docs/automations/webhook/api

Authenticated with `?privateKey=YOUR_KEY` (see [Authentication](/docs/authentication)).

<Endpoints ops={["POST /admin/automations", "GET /admin/automations", "PATCH /admin/automations/{id}", "POST /v3/webhooks/test"]} />

<ApiPlayground
  method="post"
  path="/admin/automations"
  tool="create_automation"
  args={`{
  "name": "Docs example: trigger-webhook",
  "isActive": true,
  "website": "64b7f0a1c2d3e4f5a6b7c8d9",
  "when": "new-lead-is-identified",
  "then": "trigger-webhook",
  "interval": "immediately",
  "actions": {
    "sentToWebhook": {
      "url": "https://webhook.site/your-unique-id",
      "whenToPush": "every-time"
    }
  }
}`}
/>

### Use case: Check your endpoint first [#use-case-check-your-endpoint-first]

`POST /v3/webhooks/test` with `webhook` set to your URL sends a sample lead and returns the status your endpoint answered.


---

## MCP — AI agents

Source: /docs/automations/webhook/mcp

Connect the [MCP server](/docs/mcp#quickstart), then just ask.

<Tools names={["create_automation", "test_webhook"]} />

### Use case [#use-case]

> Send every new lead to my n8n webhook.

<McpToolCall name="create_automation">

```json
{
  "websiteId": "64b7f0a1c2d3e4f5a6b7c8d9",
  "name": "New leads to n8n",
  "trigger": {
    "then": "trigger-webhook",
    "actions": {
      "sentToWebhook": {
        "url": "https://n8n.example/webhook/leads",
        "whenToPush": "every-time"
      }
    }
  },
  "actions": []
}
```

</McpToolCall>

### Use case [#use-case-1]

> Test my webhook with a sample lead.

<McpToolCall name="test_webhook">

```json
{
  "websiteId": "64b7f0a1c2d3e4f5a6b7c8d9",
  "webhook": "https://n8n.example/webhook/leads"
}
```

</McpToolCall>

