Skip to main content
GET
/
user
/
leads
Списък с потенциални клиенти
curl --request GET \
  --url https://call.aiployees.com/api/user/leads \
  --header 'Authorization: Bearer <token>'
{
  "current_page": 1,
  "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:18:04",
      "updated_at": "2025-06-30 11:18:04",
      "campaign": {
        "id": 1,
        "name": "My new campaign"
      },
      "secondary_contacts": [
        {
          "id": 2,
          "phone_number": "+1234567899",
          "variables": {
            "customer_name": "Jane Doe Secondary",
            "email": "jane.doe.secondary@example.com"
          },
          "status": "created",
          "created_at": "2025-06-30 11:18:04",
          "updated_at": "2025-06-30 11:18:04"
        }
      ]
    }
  ],
  "first_page_url": "https://call.aiployees.com/api/user/leads?page=1",
  "from": 1,
  "last_page": 10,
  "last_page_url": "https://call.aiployees.com/api/user/leads?page=10",
  "links": [
    {
      "url": null,
      "label": "&laquo; Previous",
      "active": false
    },
    {
      "url": "https://call.aiployees.com/api/user/leads?page=1",
      "label": "1",
      "active": true
    },
    {
      "url": "https://call.aiployees.com/api/user/leads?page=2",
      "label": "2",
      "active": false
    }
  ],
  "next_page_url": "https://call.aiployees.com/api/user/leads?page=2",
  "path": "https://call.aiployees.com/api/user/leads",
  "per_page": 15,
  "prev_page_url": null,
  "to": 15,
  "total": 150
}
Този endpoint ви позволява да изведете всички потенциални клиенти, принадлежащи на удостоверения потребител, с различни опции за филтриране и пагинация.

Query параметри

status
string
Филтриране на потенциални клиенти по статус. Възможни стойности: created, scheduled, processing, completed, rescheduled, reached-max-retries, blacklisted
campaign_id
integer
Филтриране на потенциални клиенти по ID на кампания
phone_number
string
Филтриране на потенциални клиенти по телефонен номер (поддържа се частично съвпадение)
date_from
string
Филтриране на потенциални клиенти, създадени от тази дата (формат YYYY-MM-DD)
date_to
string
Филтриране на потенциални клиенти, създадени до тази дата (формат YYYY-MM-DD)
per_page
integer
Брой потенциални клиенти на страница (1-100, по подразбиране: 15)
page
integer
Номер на страница (по подразбиране: 1)

Полета в отговора

data
array
current_page
integer
Номерът на текущата страница
per_page
integer
Брой елементи на страница
total
integer
Общ брой потенциални клиенти, отговарящи на критериите
last_page
integer
Номерът на последната страница
{
  "current_page": 1,
  "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:18:04",
      "updated_at": "2025-06-30 11:18:04",
      "campaign": {
        "id": 1,
        "name": "My new campaign"
      },
      "secondary_contacts": [
        {
          "id": 2,
          "phone_number": "+1234567899",
          "variables": {
            "customer_name": "Jane Doe Secondary",
            "email": "jane.doe.secondary@example.com"
          },
          "status": "created",
          "created_at": "2025-06-30 11:18:04",
          "updated_at": "2025-06-30 11:18:04"
        }
      ]
    }
  ],
  "first_page_url": "https://call.aiployees.com/api/user/leads?page=1",
  "from": 1,
  "last_page": 10,
  "last_page_url": "https://call.aiployees.com/api/user/leads?page=10",
  "links": [
    {
      "url": null,
      "label": "&laquo; Previous",
      "active": false
    },
    {
      "url": "https://call.aiployees.com/api/user/leads?page=1",
      "label": "1",
      "active": true
    },
    {
      "url": "https://call.aiployees.com/api/user/leads?page=2",
      "label": "2",
      "active": false
    }
  ],
  "next_page_url": "https://call.aiployees.com/api/user/leads?page=2",
  "path": "https://call.aiployees.com/api/user/leads",
  "per_page": 15,
  "prev_page_url": null,
  "to": 15,
  "total": 150
}