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

# Create lead

> Add a lead to a campaign for outbound calling.

Creates a new lead in a campaign. The lead will be queued for outbound calling according to the campaign's schedule and retry settings.

## Endpoint

`POST /user/lead`

## Request

<ParamField body="phone_number" type="string" required>
  Lead's phone number in E.164 format (e.g., `+1234567890`).
</ParamField>

<ParamField body="campaign_id" type="integer" required>
  ID of the campaign to add the lead to.
</ParamField>

<ParamField body="variables" type="object">
  Custom variables to pass to the call. Variable names must match those defined on the campaign's assistant.

  <Expandable title="Example variables">
    <ParamField body="customer_name" type="string">Name of the customer.</ParamField>
    <ParamField body="email" type="string">Email address of the customer.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="allow_dupplicate" type="boolean">
  Whether to allow creating a duplicate lead with the same phone number in the same campaign.
</ParamField>

<ParamField body="secondary_contacts" type="array">
  Additional contact numbers to attempt if the primary number does not answer.

  <Expandable title="Secondary contact properties">
    <ParamField body="phone_number" type="string" required>Phone number in E.164 format.</ParamField>
    <ParamField body="variables" type="object">Variables for this secondary contact.</ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="message" type="string">Confirmation message.</ResponseField>

<ResponseField name="data" type="object">
  The created lead.

  <Expandable title="properties">
    <ResponseField name="id" type="integer">Unique identifier of the lead.</ResponseField>
    <ResponseField name="campaign_id" type="integer">Campaign the lead belongs to.</ResponseField>
    <ResponseField name="phone_number" type="string">Lead's phone number in E.164 format.</ResponseField>
    <ResponseField name="variables" type="object">Variables associated with the lead.</ResponseField>
    <ResponseField name="status" type="string">Lead status — always `created` initially.</ResponseField>
    <ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
    <ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>

    <ResponseField name="campaign" type="object">
      Abbreviated campaign info.

      <Expandable title="Campaign properties">
        <ResponseField name="id" type="integer">Campaign ID.</ResponseField>
        <ResponseField name="name" type="string">Campaign name.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="secondary_contacts" type="array">
      Secondary contacts associated with this lead.

      <Expandable title="Secondary contact properties">
        <ResponseField name="id" type="integer">Secondary contact ID.</ResponseField>
        <ResponseField name="phone_number" type="string">Phone number in E.164 format.</ResponseField>
        <ResponseField name="variables" type="object">Variables for this contact.</ResponseField>
        <ResponseField name="status" type="string">Status of this contact.</ResponseField>
        <ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
        <ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://portal.intellixent.ai/api/user/lead" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "phone_number": "+1234567890",
      "campaign_id": 1,
      "variables": {
        "customer_name": "John Doe",
        "email": "john.doe@example.com"
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://portal.intellixent.ai/api/user/lead', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      phone_number: '+1234567890',
      campaign_id: 1,
      variables: {
        customer_name: 'John Doe',
        email: 'john.doe@example.com'
      }
    })
  });

  const data = await response.json();
  console.log(data.data.id); // New lead ID
  ```
</CodeGroup>

```json 200 Response theme={null}
{
  "message": "Lead created successfully",
  "data": {
    "id": 1,
    "campaign_id": 1,
    "phone_number": "+1234567890",
    "variables": {
      "customer_name": "John Doe",
      "email": "john.doe@example.com"
    },
    "status": "created",
    "created_at": "2025-06-30 11:53:20",
    "updated_at": "2025-06-30 11:53:20",
    "campaign": {
      "id": 1,
      "name": "My new campaign"
    },
    "secondary_contacts": []
  }
}
```
