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

# Push leads into a campaign and read the results

> The most common integration, end to end.

## 1. Find the campaign

```bash theme={null}
curl "https://api.getcluster.ai/v1/campaigns?status=running&search=Founders" \
  -H "Authorization: Bearer $CLUSTER_API_KEY"
```

Take the `id` of the campaign you want.

## 2. Add leads

Send up to 100 leads per call. Each lead needs a LinkedIn profile URL or an email.

```bash theme={null}
curl -X POST https://api.getcluster.ai/v1/campaigns/$CAMPAIGN_ID/leads \
  -H "Authorization: Bearer $CLUSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "leads": [
      {
        "email": "ada@example.com",
        "first_name": "Ada",
        "company": "Analytical Engines",
        "custom_variables": { "plan": "pro" }
      },
      { "linkedin_url": "https://www.linkedin.com/in/grace-hopper/" }
    ]
  }'
```

```json theme={null}
{
  "requested_count": 2,
  "added_count": 2,
  "enrolled_count": 2,
  "skipped_existing_count": 0,
  "skipped_duplicate_count": 0,
  "skipped_unreachable_count": 0
}
```

* `custom_variables` fills the variables your campaign's messages use.
* A running campaign enrolls the leads at once. A draft keeps them on its list until it launches.
* The call is safe to retry. People already in the campaign are counted in `skipped_existing_count`.
* A lead the campaign's steps cannot reach, such as an email-only lead in a LinkedIn-only campaign, is counted in `skipped_unreachable_count` when the campaign is running. A draft checks this when it launches.

## 3. Check the leads

```bash theme={null}
curl "https://api.getcluster.ai/v1/campaigns/$CAMPAIGN_ID/leads?limit=100" \
  -H "Authorization: Bearer $CLUSTER_API_KEY"
```

Each lead has a `status` and the last thing that happened to it in `last_event_type`.

## 4. Read the results

```bash theme={null}
curl https://api.getcluster.ai/v1/campaigns/$CAMPAIGN_ID/performance \
  -H "Authorization: Bearer $CLUSTER_API_KEY"
```

You get totals and rates in `performance`, and a day-by-day breakdown in `daily_activity`.

For results across campaigns, or grouped by sender or channel, use `POST /analytics/query`.

## 5. Read the replies

```bash theme={null}
curl "https://api.getcluster.ai/v1/conversations?limit=20" \
  -H "Authorization: Bearer $CLUSTER_API_KEY"
```

Open one with `GET /conversations/{id}` to read its messages, and reply with `POST /conversations/{id}/messages`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.