> ## 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.

# List leads

> Retrieve a paginated list of leads with filtering options.

Returns a paginated list of all leads belonging to the authenticated user. Filter by campaign, status, phone number, or date range.

## Endpoint

`GET /user/leads`

## Query parameters

<ParamField query="status" type="string">
  Filter by lead status. Possible values: `created`, `scheduled`, `processing`, `completed`, `rescheduled`, `reached-max-retries`, `blacklisted`.
</ParamField>

<ParamField query="campaign_id" type="integer">
  Filter by campaign ID.
</ParamField>

<ParamField query="phone_number" type="string">
  Filter by phone number (partial match supported).
</ParamField>

<ParamField query="date_from" type="string">
  Filter leads created from this date. Format: `YYYY-MM-DD`.
</ParamField>

<ParamField query="date_to" type="string">
  Filter leads created up to this date. Format: `YYYY-MM-DD`.
</ParamField>

<ParamField query="per_page" type="integer">
  Number of leads per page. Range: 1–100. Default: `15`.
</ParamField>

<ParamField query="page" type="integer">
  Page number. Default: `1`.
</ParamField>

## Response

<ResponseField name="data" type="array">
  Array of lead objects.

  <Expandable title="Lead 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">Current lead status.</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 for this lead.

      <Expandable title="Secondary contact properties">
        <ResponseField name="id" type="integer">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">Contact status.</ResponseField>
        <ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
        <ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="current_page" type="integer">Current page number.</ResponseField>
<ResponseField name="per_page" type="integer">Items per page.</ResponseField>
<ResponseField name="total" type="integer">Total matching leads.</ResponseField>
<ResponseField name="last_page" type="integer">Last page number.</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://portal.intellixent.ai/api/user/leads?campaign_id=1&status=created&per_page=15" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({ campaign_id: 1, status: 'created', per_page: 15 });
  const response = await fetch(
    `https://portal.intellixent.ai/api/user/leads?${params}`,
    {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );

  const data = await response.json();
  console.log(data.data); // Array of leads
  ```
</CodeGroup>

```json 200 Response theme={null}
{
  "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": []
    }
  ],
  "per_page": 15,
  "total": 150,
  "last_page": 10
}
```
