Skip to main content
POST
/
user
/
lead
Създаване на lead
curl --request POST \
  --url https://call.aiployees.com/api/user/lead \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone_number": "<string>",
  "campaign_id": 123,
  "variables": {
    "customer_name": "<string>",
    "email": "<string>"
  },
  "allow_dupplicate": true,
  "secondary_contacts": [
    {
      "phone_number": "<string>",
      "variables": {
        "customer_name": "<string>",
        "email": "<string>"
      }
    }
  ]
}
'
{
  "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": [
      {
        "id": 2,
        "phone_number": "+1234567891",
        "variables": {
          "customer_name": "Jane Doe Secondary",
          "email": "jane.doe.secondary@example.com"
        },
        "status": "created",
        "created_at": "2025-06-30 11:53:20",
        "updated_at": "2025-06-30 11:53:20"
      },
      {
        "id": 3,
        "phone_number": "+1234567892",
        "variables": {
          "customer_name": "Bob Doe Office",
          "email": "bob.doe.office@example.com"
        },
        "status": "created",
        "created_at": "2025-06-30 11:53:20",
        "updated_at": "2025-06-30 11:53:20"
      }
    ]
  }
}
Този endpoint ви позволява да създадете нов lead в системата на Aiplocalls.

Request body

phone_number
string
required
Телефонният номер на lead-а в E.164 формат (например +1234567890)
campaign_id
integer
required
ID-то на кампанията, за която да се създаде lead-ът
variables
object
Персонализирани променливи за предаване към lead-а. Можете да включите всички променливи, които са дефинирани във вашия асистент (вижте Променливи за повиквания). Примерите по-долу са само за илюстрация — използвайте вашите собствени имена на променливи, както са конфигурирани в настройките на асистента.
allow_dupplicate
boolean
Дали да се позволяват дублиращи се leads в кампанията.
secondary_contacts
array
Масив от secondary contact leads, които да се създадат заедно с основния lead

Response

message
string
default:"Lead created successfully"
Съобщението от отговора
data
object
Обектът с данни за lead-а
{
  "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": [
      {
        "id": 2,
        "phone_number": "+1234567891",
        "variables": {
          "customer_name": "Jane Doe Secondary",
          "email": "jane.doe.secondary@example.com"
        },
        "status": "created",
        "created_at": "2025-06-30 11:53:20",
        "updated_at": "2025-06-30 11:53:20"
      },
      {
        "id": 3,
        "phone_number": "+1234567892",
        "variables": {
          "customer_name": "Bob Doe Office",
          "email": "bob.doe.office@example.com"
        },
        "status": "created",
        "created_at": "2025-06-30 11:53:20",
        "updated_at": "2025-06-30 11:53:20"
      }
    ]
  }
}