--- title: "Statistics for your whole account, now in the API" description: "\"How many emails did each of our customers send in March?\"If you run a platform or an agency, you get this question from finance every month. Until now it was harder to answer than it should be. The existing statistics in AhaSend are built from your messages, so they go back only as far as your message retention. And short retention is what you want: there is no reason to keep data about individual messages longer than you need it." url: https://ahasend.com/blog/email-statistics-your-whole-account-history-now-api markdown_url: https://ahasend.com/blog/email-statistics-your-whole-account-history-now-api.md lang: en type: blog_post published: 2026-11-12 updated: 2026-11-12 author: "Mark Kraakman" category: "Product Update" image: https://cms.ahasend.com/sites/default/files/2026-11/email-statistics.png --- # Statistics for your whole account, now in the API _By Mark Kraakman, November 12, 2026, in Product Update_ ![Email statistics](https://cms.ahasend.com/sites/default/files/2026-11/email-statistics.png) *"How many emails did each of our customers send in March?"* If you run a platform or an agency, you get this question from finance every month. Until now it was harder to answer than it should be. The existing statistics in AhaSend are built from your messages, so they go back only as far as your message retention. And short retention is what you want: there is no reason to keep data about individual messages longer than you need it. The numbers are a different matter. You need them for invoices, for yearly reports and for the board deck, long after the messages themselves are gone. So we separated the two. The new [Get Email Statistics](https://ahasend.com/docs/api-reference/reports/get-email-statistics) endpoint returns the email counts of your account, or of each of its domains, for any period in your account's history. It is not limited by your retention settings. ## What you can do with it **Charge email through per customer.** With a breakdown by domain you get the counts of every sending domain per month. If each of your customers sends from their own domain, that is your invoice basis. `reception_count` is the number of messages AhaSend accepted, and it is the same count our billing uses, so your numbers match ours. **Report without building a counter yourself.** Many teams keep their own tally from webhooks, just to be able to say what they sent last quarter. You can stop doing that. Volumes per hour, day, week or month are one request away. **Look back further than a month.** Compare this November with last November, or see how a domain grew over the past years. Domains you deleted are still in there. ## What is counted The counts cover transactional mail, campaigns and inbound mail. Inbound mail is counted under the domain that received it. Sandbox mail is not counted. For every period you get eight counters: messages accepted, delivered, bounced and suppressed, spam complaints, temporary delivery failures, opens and clicks. The last three count events, so one message can add more than one open. Opens and clicks are never fully accurate; we make a reasonable effort to filter out bots and scanners. ## How it works Ask for the monthly counts per domain since January: ```bash curl --request GET \ --url 'https://api.ahasend.com/v2/accounts/{account_id}/statistics/emails?group_by=month&breakdown=domain&from_time=2026-01-01T00:00:00Z&to_time=2026-11-01T00:00:00Z' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` Each row in `data` is one domain in one period: ```plaintext { "from_timestamp": "2026-03-01T00:00:00Z", "to_timestamp": "2026-04-01T00:00:00Z", "sender_domain": "customer-one.com", "reception_count": 48210, "delivered_count": 47655, "bounced_count": 498, "suppressed_count": 57, "complained_count": 3, "deferred_count": 1204, "opened_count": 0, "clicked_count": 0 } ``` Next to the rows, `totals` gives the counts of the whole request, which is often all you need. A few things to know: - Periods are in UTC, and weeks start on Monday. - A range can be at most 31 days per hour, 366 days per day or week, and 5 years per month. - Leave out `breakdown=domain` and you get one row per period for the whole account. Use `sender_domain` to select specific domains. - The API key needs the `statistics-transactional:read:all` scope, or the same scope for specific domains. A key with domain scopes sees only those domains. ## Or just ask The same statistics are available through the [AhaSend MCP server](https://ahasend.com/docs/mcp-server). Connect it to your AI assistant and ask in plain words: > How many emails did each of our domains send per month this year? Put it in a table. That is the monthly report for finance, without a line of code. The full reference, with every parameter and the paging of large breakdowns, is in the [docs](https://ahasend.com/docs/api-reference/reports/get-email-statistics).