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

# Lead lists add leads

## POST /api/v1/public/lead-lists/:id/add-leads/

Add prospects or companies to an existing lead list. The type of IDs you provide (prospect\_ids or company\_ids) should match the lead list type.

Auth: `X-API-Key`

### Path Parameters

* `id` (integer, required): Lead list ID

### Request Body (For People Lists)

```json theme={null}
{
  "prospect_ids": [12345, 12346, 12347]
}
```

### Request Body (For Company Lists)

```json theme={null}
{
  "company_ids": [678, 679, 680]
}
```

### Response (People List)

```json theme={null}
{
  "success": true,
  "added_count": 3,
  "search_type": "PEOPLE"
}
```

### Response (Company List)

```json theme={null}
{
  "success": true,
  "added_count": 3,
  "search_type": "COMPANY"
}
```

### Error Responses

#### 400 Bad Request

```json theme={null}
{
  "error": "prospect_ids is required for people lists"
}
```

```json theme={null}
{
  "error": "company_ids is required for company lists"
}
```

#### 404 Not Found

```json theme={null}
{
  "error": "Lead list not found"
}
```

### Workflow Example

1. First, search for prospects using the `/public/prospects/search/` endpoint
2. Extract the IDs from the search results
3. Add those IDs to your lead list using this endpoint

### Example Usage

```bash theme={null}
# Add prospects to a people list
curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-leads/" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "prospect_ids": [12345, 12346, 12347]
  }'

# Add companies to a company list
curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/456/add-leads/" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "company_ids": [678, 679, 680]
  }'
```

```python theme={null}
import requests

# Step 1: Search for prospects
search_response = requests.post(
    "https://api.seleqt.ai/api/v1/public/prospects/search/",
    headers={"X-API-Key": "<your-api-key>"},
    json={
        "search_type": "PEOPLE",
        "filters": {"job_title": "CEO"}
    }
)

# Step 2: Extract prospect IDs
prospects = search_response.json()["prospects"]
prospect_ids = [p["id"] for p in prospects]

# Step 3: Add to lead list
add_response = requests.post(
    "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-leads/",
    headers={"X-API-Key": "<your-api-key>"},
    json={"prospect_ids": prospect_ids}
)

print(f"Added {add_response.json()['added_count']} prospects to list")
```
