> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/api-docs/email-marketing/marketing-stats/get-email-marketing-stats.md).

# Get Email Marketing stats

Returns aggregated performance metrics for the account's Email Marketing traffic, campaigns and automations together: counts and rates for deliveries, bounces, opens, clicks, spam complaints, and unsubscriptions over a date range. The numbers match Email Marketing > Stats Overview in the app for the same filters. Email Live Sending traffic is not included; `GET /api/stats` reports it.

Open, click, spam, and unsubscription rates are shares of `delivery_count`, unlike `GET /api/email_campaigns/{email_campaign_id}/stats`, which divides every rate by `sent_count`.

The API token needs at least viewer access to the account; a token with access only to specific sending domains or sandboxes gets `403`. The endpoint allows 10 requests per minute per account, counted separately from `GET /api/stats`.

```json
{"openapi":"3.1.0","info":{"title":"Email Campaigns","version":"2.0.0"},"tags":[{"name":"Marketing Stats","description":"Retrieve aggregated Email Marketing statistics"}],"servers":[{"description":"Mailtrap API","url":"https://mailtrap.io"}],"security":[{"HeaderAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"HeaderAuth":{"type":"apiKey","description":"Pass the API token in the Api-Token header","in":"header","name":"Api-Token"},"BearerAuth":{"type":"http","description":"Pass the API token as a Bearer token in the Authorization header","scheme":"bearer"}},"parameters":{"marketing_stats_start_date":{"name":"start_date","description":"Start of the aggregation window (inclusive), in `YYYY-MM-DD` format.","in":"query","required":true,"schema":{"type":"string","format":"date"}},"marketing_stats_end_date":{"name":"end_date","description":"End of the aggregation window (inclusive), in `YYYY-MM-DD` format.","in":"query","required":true,"schema":{"type":"string","format":"date"}},"sending_domain_ids":{"name":"sending_domain_ids[]","description":"IDs of the sending domains to include, as returned by the Sending Domains API. If omitted,\nevery sending domain of the account is included. An ID that is not a sending domain of the\naccount returns `400`.","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer","format":"int64"}}},"sources":{"name":"sources[]","description":"Email Marketing sources to include. If omitted, campaigns and automations are both included.","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["campaigns","automations"]}}},"email_service_providers":{"name":"email_service_providers[]","description":"Recipient email service providers to include. If omitted, all providers are included. A\nvalue outside the list is not rejected; it matches nothing, so every count is `0`.","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["Google","Yahoo","Outlook","Hey","Google Workspace","Zoho Email","ProtonMail","Yandex","iCloud","Office 365","Amazon SES (Simple Email Service)","Proofpoint Email Protection","Mimecast Email Protection","GMX.net","Rackspace","OVH hosted","Linode hosted","GoDaddy","Symantec Email Protection","Barracuda Email Protection","Cisco Email Protection","FastMail","Naver","Seznam","Comcast","Spectrum"]}}}},"responses":{"MarketingStatsResponse":{"description":"Aggregated Email Marketing statistics.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/MarketingStats"}}}}}},"MARKETING_STATS_BAD_REQUEST":{"description":"A date is missing or invalid, a sending domain ID is not in the account, or a source is\nunknown; `errors` names the parameter and, where there is one, the rejected value.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"UNAUTHENTICATED":{"description":"Authentication failed — missing or invalid API token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthenticatedResponse"}}}},"PERMISSION_DENIED":{"description":"The API token does not have permission to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionDeniedResponse"}}}},"MARKETING_STATS_RATE_LIMITED":{"description":"Too many requests. Two limits apply: 10 requests per minute per account on this endpoint, and\nthe global 150 requests per 10 seconds per API token. The response body tells them apart,\nand only the global throttle sets the `x-ratelimit-*` headers.","headers":{},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EndpointRateLimitedResponse"},{"$ref":"#/components/schemas/RateLimitedResponse"}]}}}}},"schemas":{"MarketingStats":{"type":"object","description":"Aggregated Email Marketing metrics for the requested period and filters. Rates are fractions\nfrom 0 to 1, not rounded. Every count and rate is `0` when nothing matched.","required":["delivery_count","delivery_rate","bounce_count","bounce_rate","open_count","open_rate","click_count","click_rate","spam_count","spam_rate","unsubscription_count","unsubscription_rate","sent_count"],"properties":{"delivery_count":{"type":"integer"},"delivery_rate":{"type":"number","format":"double","description":"`delivery_count` / `sent_count`."},"bounce_count":{"type":"integer"},"bounce_rate":{"type":"number","format":"double","description":"`bounce_count` / `sent_count`."},"open_count":{"type":"integer"},"open_rate":{"type":"number","format":"double","description":"`open_count` / `delivery_count`."},"click_count":{"type":"integer"},"click_rate":{"type":"number","format":"double","description":"`click_count` / `delivery_count`."},"spam_count":{"type":"integer"},"spam_rate":{"type":"number","format":"double","description":"`spam_count` / `delivery_count`."},"unsubscription_count":{"type":"integer"},"unsubscription_rate":{"type":"number","format":"double","description":"`unsubscription_count` / `delivery_count`."},"sent_count":{"type":"integer","description":"Delivered plus bounced messages."}}},"BadRequestResponse":{"type":"object","required":["errors"],"properties":{"errors":{"type":"string"}}},"UnauthenticatedResponse":{"type":"object","properties":{"error":{"type":"string"}}},"PermissionDeniedResponse":{"type":"object","properties":{"errors":{"type":"string"}}},"EndpointRateLimitedResponse":{"type":"object","required":["errors"],"properties":{"errors":{"type":"string"}}},"RateLimitedResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}},"paths":{"/api/marketing/stats":{"get":{"operationId":"getMarketingStats","summary":"Get Email Marketing stats","description":"Returns aggregated performance metrics for the account's Email Marketing traffic, campaigns\nand automations together: counts and rates for deliveries, bounces, opens, clicks, spam\ncomplaints, and unsubscriptions over a date range. The numbers match Email Marketing > Stats\nOverview in the app for the same filters. Email Live Sending traffic is not included;\n`GET /api/stats` reports it.\n\nOpen, click, spam, and unsubscription rates are shares of `delivery_count`, unlike\n`GET /api/email_campaigns/{email_campaign_id}/stats`, which divides every rate by\n`sent_count`.\n\nThe API token needs at least viewer access to the account; a token with access only to\nspecific sending domains or sandboxes gets `403`. The endpoint allows 10 requests per minute\nper account, counted separately from `GET /api/stats`.","tags":["Marketing Stats"],"parameters":[{"$ref":"#/components/parameters/marketing_stats_start_date"},{"$ref":"#/components/parameters/marketing_stats_end_date"},{"$ref":"#/components/parameters/sending_domain_ids"},{"$ref":"#/components/parameters/sources"},{"$ref":"#/components/parameters/email_service_providers"}],"responses":{"200":{"$ref":"#/components/responses/MarketingStatsResponse"},"400":{"$ref":"#/components/responses/MARKETING_STATS_BAD_REQUEST"},"401":{"$ref":"#/components/responses/UNAUTHENTICATED"},"403":{"$ref":"#/components/responses/PERMISSION_DENIED"},"429":{"$ref":"#/components/responses/MARKETING_STATS_RATE_LIMITED"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mailtrap.io/api-docs/email-marketing/marketing-stats/get-email-marketing-stats.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
