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

# Lead Inbound Webhook

> Creates a new lead in the account identified by the webhook token.
The token is a per-account secret found in the account settings.
If a lead with the same phone number already exists, the existing
lead is returned without creating a duplicate.




## OpenAPI

````yaml POST /api/webhooks/leads/{token}
openapi: 3.1.0
info:
  title: Naturalead Inbound Webhooks API
  version: 1.0.0
  description: >
    Inbound webhook endpoints for receiving messages and leads from external

    services. These endpoints do not use standard API key authentication.

    Each channel uses its own verification mechanism (token-based,
    signature-based,

    or challenge-response).
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security: []
tags:
  - name: Lead Webhooks
    description: Inbound lead creation via webhook token
  - name: Telegram Webhooks
    description: Inbound Telegram messages
  - name: Email Webhooks
    description: Inbound email messages via Resend
  - name: WhatsApp Webhooks
    description: Inbound WhatsApp messages via Meta Cloud API
paths:
  /api/webhooks/leads/{token}:
    post:
      tags:
        - Lead Webhooks
      summary: Lead inbound webhook
      description: |
        Creates a new lead in the account identified by the webhook token.
        The token is a per-account secret found in the account settings.
        If a lead with the same phone number already exists, the existing
        lead is returned without creating a duplicate.
      operationId: leadInboundWebhook
      parameters:
        - name: token
          in: path
          required: true
          description: Account-specific webhook token
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Lead's full name (defaults to "Unknown")
                phone:
                  type: string
                  description: Lead's phone number (required, used for deduplication)
                email:
                  type: string
                  format: email
                  description: Lead's email address
                tags:
                  type: array
                  items:
                    type: string
                  description: Tags to apply to the lead
              required:
                - phone
              additionalProperties:
                type: string
                description: Any additional string fields are stored as custom fields
      responses:
        '200':
          description: Lead already exists (deduplication by phone)
          content:
            application/json:
              schema:
                type: object
                properties:
                  leadId:
                    type: integer
                  created:
                    type: boolean
                    example: false
        '201':
          description: Lead created
          content:
            application/json:
              schema:
                type: object
                properties:
                  leadId:
                    type: integer
                  created:
                    type: boolean
                    example: true
        '400':
          description: Validation error (e.g. missing phone)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid webhook token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error

````