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

# Get campaign stats detail

> Returns statistics for a specific campaign with each subscriber and their individual events.

<ParamField path="id" type="integer" required>
  Campaign ID.
</ParamField>

<ParamField query="event" type="string">
  Filter by event type: `open`, `send`, `unsub`, `soft_bounce`, `click`, `hard_bounce`, `out_of_band`, `spam`.
</ParamField>

<ParamField query="email" type="string">
  Filter by subscriber email.
</ParamField>

<ParamField query="from_date" type="string">
  Filter from date onwards (`YYYY-MM-DD` in UTC).
</ParamField>

<ParamField query="per_page" type="integer">
  Results per page. Maximum and default is `100`.
</ParamField>

<ParamField query="page" type="integer">
  Page number.
</ParamField>

The `total` field returns the total number of subscribers the campaign was targeted at.
The `open`, `click`, and `send` fields return unique counts — not total events, which can include one subscriber many times.

<RequestExample>
  ```bash cURL theme={null}
  curl https://api2.ecomailapp.cz/campaigns/12345/stats-detail \
    -H "key: YOUR_API_KEY" \
    -H "Content-Type: application/json"
  ```

  ```php PHP theme={null}
  $campaignId = 12345;
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}/stats-detail");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'key: YOUR_API_KEY',
      'Content-Type: application/json',
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "next_page_url": "https://api2.ecomailapp.cz/campaigns/12345/stats-detail?page=2",
    "total": 4256,
    "per_page": 100,
    "subscribers": {
      "foo@bar.com": {
        "open": 2,
        "send": 1,
        "unsub": 0,
        "soft_bounce": 0,
        "click": 1,
        "hard_bounce": 0,
        "out_of_band": 0,
        "spam": 0
      }
    }
  }
  ```
</ResponseExample>
