---
title: "Get campaign statistics"
method: GET
path: "/stats/advanced"
tags: ["Campaign tracking"]
---

# Get campaign statistics

`GET /stats/advanced`

## Request

- Base URL: `https://api.emelia.io`
- URL: `https://api.emelia.io/stats/advanced`
- Auth: API key in header `Authorization`

Global and per step statistics of a multichannel campaign. Computed on demand (can take several seconds) and then cached; `Cache-Control: max-age=300` is set when `detailed` is not `true`. Errors are unusual here: an unknown campaign or ANY error (including an invalid parameter) returns 401, and a failure of the statistics engine can return HTTP 200 with `{"error": "Error"}`. For a few accounts a 503 `STATS_COMPUTING` with `Retry-After: 30` is returned while a computation is in progress.

## Query parameters

- `campaignId` string, required: MongoDB ObjectId: 24 hexadecimal characters.
- `detailed` boolean
- `start` string, date-time
- `end` string, date-time
- `providerId` string: MongoDB ObjectId: 24 hexadecimal characters.

## Response `200`

Success.

- union
  - CampaignStats
    - `global` object
      - `contacts` number
      - `contacted` number
      - `replied` number
      - `visited` number
      - `invited` number
      - `accepted` number
      - `message_sent` number
      - `inmail_sent` number
      - `linkedin_replied` number
      - `mail_replied` number
      - `liked` number
      - `sent` number
      - `opened` number
      - `clicked` number
      - `bounced` number
      - `unsubscribed` number
      - `progress_percent` number
      - `accepted_percent` number
      - `opened_percent` number
      - `clicked_percent` number
      - `linkedin_replied_percent` number
      - `mail_replied_percent` number
      - `bounced_percent` number
      - `unsubscribed_percent` number
    - `steps` union: One array per action step, in sequence order: EMAIL steps contain one item per version, other steps one item. For a DRAFT campaign this is an empty OBJECT `{}` instead of an array.
      - array[]
        - union[]
          - union
            - StepStatEmail: Statistics of one version of an EMAIL step.
              - …
            - StepStatOther: Statistics of a non email step.
              - …
      - object
  - object
    - `error` string

## Other responses

- `401`: Unknown campaign, invalid parameter or any other error (all mapped to 401).
- `500`: Unexpected error. IMPORTANT: this is also what you receive today when the per minute quota of your account is exceeded (the quota error is not mapped to 429 for API keys). No `Retry-After` header is sent. Wait until the next minute window before retrying.
- `503`: Statistics already being computed (only for some accounts).

---

[API](https://skmtc.dev/emelia/apis/emelia-api.md) · [All operations](https://skmtc.dev/emelia/apis/emelia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/emelia/apis/emelia-api/revisions/8c0cb435f2c4?raw)
