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

# Get Account Metrics

> Retrieve aggregated email engagement metrics across all campaigns and sequences.

Returns aggregated email engagement metrics (sends, deliveries, bounces, opens, clicks, unsubscribes) across your entire account for a given time period. Test sends are excluded from these performance metrics by default so previews do not skew results, but they still count toward send usage and quota. Open and click metrics also exclude detected email-security scanners and tracked brand assets by default.

`GET /api/v1/stats` is kept as a backward-compatible alias for this endpoint.

## Query Parameters

<ParamField query="period" type="string">
  Sliding time window. One of: `1h`, `24h`, `7d`, `30d`, `90d`. Ignored when
  `start` and `end` are provided.
</ParamField>

<ParamField query="start" type="string">
  Start of custom time range (ISO 8601, e.g. `2026-02-01T00:00:00Z`). Must be
  used with `end`.
</ParamField>

<ParamField query="end" type="string">
  End of custom time range (ISO 8601, e.g. `2026-02-14T00:00:00Z`). Must be used
  with `start`. Max range: 90 days.
</ParamField>

<ParamField query="includeMachineEngagement" type="boolean" default="false">
  Set to `true` to include detected scanner, preview, and tracked asset
  open/click events in engagement metrics.
</ParamField>

## Response Fields

| Field             | Type     | Description                                            |
| ----------------- | -------- | ------------------------------------------------------ |
| `sent`            | `number` | Emails sent in the period                              |
| `delivered`       | `number` | Emails delivered (capped at sent)                      |
| `bounced`         | `number` | Emails that bounced                                    |
| `opened`          | `number` | Unique opens (deduplicated by email send)              |
| `clicked`         | `number` | Unique clicks (deduplicated by email send)             |
| `unsubscribed`    | `number` | Unsubscribes in the period                             |
| `deliveryRate`    | `number` | Delivery rate percentage (delivered / sent)            |
| `bounceRate`      | `number` | Bounce rate percentage (bounced / sent)                |
| `openRate`        | `number` | Open rate percentage (opens / delivered)               |
| `clickRate`       | `number` | Click rate percentage (clicks / delivered)             |
| `unsubscribeRate` | `number` | Unsubscribe rate percentage (unsubscribes / delivered) |

## Common Queries

### How many emails did we send in the last 7 days?

```bash theme={null}
curl "https://api.sequenzy.com/api/v1/metrics?period=7d" \
 -H "Authorization: Bearer YOUR_API_KEY"
```

Check the `sent` field in the response.

### What's our overall open rate this month?

```bash theme={null}
curl "https://api.sequenzy.com/api/v1/metrics?start=2026-02-01T00:00:00Z&end=2026-02-28T00:00:00Z" \
 -H "Authorization: Bearer YOUR_API_KEY"
```

Check the `openRate` field — this is calculated as opens / delivered.

### How are we doing in the last 24 hours?

```bash theme={null}
curl "https://api.sequenzy.com/api/v1/metrics?period=24h" \
 -H "Authorization: Bearer YOUR_API_KEY"
```

Useful for daily monitoring dashboards or Slack alerts.

### Sync daily metrics to our data warehouse

Use fixed time ranges to pull yesterday's metrics on a cron schedule:

```bash theme={null}
curl "https://api.sequenzy.com/api/v1/metrics?start=2026-02-13T00:00:00Z&end=2026-02-14T00:00:00Z" \
 -H "Authorization: Bearer YOUR_API_KEY"
```

Fixed ranges are idempotent — safe to retry without double-counting.

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "period": "7d",
    "stats": {
      "sent": 3400,
      "delivered": 3380,
      "bounced": 20,
      "opened": 1020,
      "clicked": 340,
      "unsubscribed": 5,
      "deliveryRate": 99.41,
      "bounceRate": 0.59,
      "openRate": 30.18,
      "clickRate": 10.06,
      "unsubscribeRate": 0.15
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Invalid period. Must be one of: 1h, 24h, 7d, 30d, 90d"
  }
  ```

  ```json 401 theme={null}
  { "success": false, "error": "Unauthorized" }
  ```

  ```json 500 theme={null}
  { "success": false, "error": "Internal server error" }
  ```
</ResponseExample>
