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

# Campaign Performance

> Get performance metrics for each campaign with engagement rates and lead counts

## Path Parameters

<Note>No path parameters</Note>

## Query Parameters

<ParamField query="api_key" type="string" required>
  Your SmartLead API key
</ParamField>

<ParamField query="start_date" type="string" required>
  Start date in YYYY-MM-DD format
</ParamField>

<ParamField query="end_date" type="string" required>
  End date in YYYY-MM-DD format
</ParamField>

<ParamField query="timezone" type="string">
  Timezone string (e.g. "America/New\_York"), optional
</ParamField>

<ParamField query="client_ids" type="string">
  Comma-separated client IDs (optional)
</ParamField>

<ParamField query="campaign_ids" type="string">
  Comma-separated campaign IDs (optional)
</ParamField>

<ParamField query="limit" type="string">
  Max number of results to return (optional)
</ParamField>

<ParamField query="offset" type="string">
  Pagination offset (optional)
</ParamField>

<ParamField query="full_data" type="string">
  Set to "true" to return full data set (optional)
</ParamField>

## Request Body

<Note>No request body required</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://server.smartlead.ai/api/v1/analytics/campaign/overall-stats?api_key=YOUR_KEY&start_date=2024-01-01&end_date=2024-01-31&timezone=America%2FNew_York"
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "YOUR_API_KEY"

  response = requests.get(
      "https://server.smartlead.ai/api/v1/analytics/campaign/overall-stats",
      params={
          "api_key": API_KEY,
          "start_date": "2024-01-01",
          "end_date": "2024-01-31",
          "timezone": "America/New_York"
      }
  )

  result = response.json()
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';

  const response = await fetch(
    `https://server.smartlead.ai/api/v1/analytics/campaign/overall-stats?api_key=${API_KEY}&start_date=2024-01-01&end_date=2024-01-31&timezone=America%2FNew_York`
  );

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Request successful
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid request parameters or malformed request body
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key. Check your authentication.
</ResponseField>

<ResponseField name="404" type="Not Found">
  The requested resource (campaign, lead, email account, etc.) does not exist or you don't have access to it
</ResponseField>

<ResponseField name="422" type="Validation Error">
  Request validation failed. Check parameter types, required fields, and value constraints.
</ResponseField>

<ResponseField name="429" type="Rate Limit Exceeded">
  Too many requests. Please slow down and retry after the rate limit resets.
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Server error occurred. Please try again or contact support if the issue persists.
</ResponseField>

<ResponseField name="503" type="Service Unavailable">
  API is temporarily unavailable or under maintenance. Please try again later.
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "ok": true,
    "data": {
      "campaign_wise_performance": [
        {
          "id": 12345,
          "campaign_name": "Q1 Cold Outreach",
          "sent": 500,
          "opened": 250,
          "replied": 45,
          "bounced": 8,
          "open_rate": "50%",
          "reply_rate": "9%",
          "bounce_rate": "1.6%",
          "positive_reply_rate": "5%",
          "positive_replied": 25,
          "unique_lead_count": 480,
          "unique_open_count": 230
        }
      ]
    }
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Invalid API Key"
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "error": "Resource not found"
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "error": "Invalid parameters provided"
  }
  ```
</ResponseExample>

## How these metrics are calculated

<Note>
  Shared rules (inclusive date boundaries, unique vs raw counts, rate formulas) are documented once in [How Analytics Metrics Are Calculated](/api-reference/analytics/how-metrics-are-calculated).
</Note>

One row is returned per campaign. All metrics are scoped to emails **sent** within the date range (`sent_time`), inclusive on both ends; a single date returns that one full day.

| Field                                     | How it's calculated                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sent` / `opened` / `replied` / `bounced` | Raw event counts within the range. Additive.                                                                                                                                                                                                                                                                                                                                              |
| `positive_replied`                        | Distinct leads tagged **positive** (`sentiment_type = 'positive'`). **Note:** the date attribution on this breakdown endpoint differs from the [`overall-stats-v2` tile](/api-reference/analytics/overview) (which is reply-date) — don't assume the two match for the same window. Use `overall-stats-v2` or the day-wise positive endpoints as the source of truth for positive counts. |
| `unique_lead_count`                       | `COUNT(DISTINCT lead)` sent at least one email in the range (deduplicated per campaign by email). **Not** additive across days.                                                                                                                                                                                                                                                           |
| `unique_open_count`                       | `COUNT(DISTINCT lead)` that opened in the range. Not additive across days.                                                                                                                                                                                                                                                                                                                |
| `open_rate`                               | `unique_open_count / unique_lead_count`                                                                                                                                                                                                                                                                                                                                                   |
| `reply_rate`                              | `replied / unique_open_count` (falls back to `unique_lead_count` when open tracking is off, e.g. plain-text sends)                                                                                                                                                                                                                                                                        |
| `positive_reply_rate`                     | `positive_replied / replied`                                                                                                                                                                                                                                                                                                                                                              |
| `bounce_rate`                             | `bounced / unique_lead_count` (per unique lead, not per email sent)                                                                                                                                                                                                                                                                                                                       |
