---
title: "Email history"
method: POST
path: "/stats/email_history"
tags: ["STATISTICS"]
---

# Email history

`POST /stats/email_history`

Retrieve a summary of activity from a specified date range (defaults to last 30 days), per sender email address, SMTP username, domain or subaccount.

## Request body

- object
  - `group_by` string — One of [<code>email_address</code>, <code>username</code>, <code>domain</code>, <code>subaccount</code>] - controls the grouping of results. Defaults to <code>email_address</code>
  - `start_date` string — ISO-8601 formatted datetime which defaults to 30 days prior to the current date at midnight. Timezone is UTC
  - `end_date` string — ISO-8601 formatted datetime which defaults the current time. Timezone is UTC
  - `subaccounts` unknown[] — Pass an optional list of subaccount ids to fetch a summary of only particular subaccounts, ID's can be found by querying <code>/subaccounts/search</code>
    - unknown

## Response `200`

Summary of Account

- object
  - `request_id` string, required
  - `data` object, required
    - `count` integer, required
    - `bounce_percent_total` number — The total percentage of emails that bounced.
    - `open_percent_total` number — The total percentage of emails that were opened.
    - `reject_percent_total` number — The total percentage of emails that were rejected.
    - `spam_percent_total` number — The total percentage of emails that were marked as spam.
    - `unsubscribe_percent_total` number — The total percentage of emails that were unsubscribed from.
    - `history` object[], required
      - `subaccount` string — Only returned if <code>group_by</code> is set to <code>subaccount</code>
      - `domain` string — Only returned if <code>group_by</code> is set to <code>domain</code>
      - `domain_verified` boolean — Only returned if <code>group_by</code> is set to <code>domain</code>
      - `lastip` string, required
      - `used` integer, required
      - `email_address` string — Only returned if <code>group_by</code> is set to <code>email_address</code>
      - `username` string — Only returned if <code>group_by</code> is set to <code>username</code>
      - `description` string — A comment or description of the user, Only returned if <code>group_by</code> is set to <code>username</code>
      - `bytecount` integer, required
      - `avgsize` number, required
      - `bounces` integer
      - `clicks` integer
      - `opens` integer
      - `rejects` integer
      - `spam` integer
      - `unsubscribes` integer
      - `bounce_percent` number — The percentage of emails that bounced.
      - `open_percent` number — The percentage of emails that were opened.
      - `reject_percent` number — The percentage of emails that were rejected.
      - `spam_percent` number — The percentage of emails that were marked as spam.
      - `unsubscribe_percent` number — The percentage of emails that recipients unsubscribed.

## Other responses

- `400` — 400

---

[API](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4.md) · [All operations](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smtp2go/smtp2go-api-v3-0-4/versions/1ba6b25eebb9/schema)
