---
title: "UTC hour or day buckets of message.received, message.sent, message.bounced, and message.complained. received and sent follow direction. bounced and complained follow those labels and are zero when absent. start and end default to the last 30 days and cannot exceed 90 days (400 invalid_range). A bad timestamp is 400 invalid_date. A bad period is 400 invalid_period. An unknown type is 400 invalid_type. Counts only; message bodies are not returned. An inbox-scoped key sees only its inbox. Another account's inbox is 404 inbox_not_found."
method: GET
path: "/api/v1/metrics/events"
tags: ["Metrics"]
---

# UTC hour or day buckets of message.received, message.sent, message.bounced, and message.complained. received and sent follow direction. bounced and complained follow those labels and are zero when absent. start and end default to the last 30 days and cannot exceed 90 days (400 invalid_range). A bad timestamp is 400 invalid_date. A bad period is 400 invalid_period. An unknown type is 400 invalid_type. Counts only; message bodies are not returned. An inbox-scoped key sees only its inbox. Another account's inbox is 404 inbox_not_found.

`GET /api/v1/metrics/events`

## Request

- Base URL: `https://cooperemail.com`
- URL: `https://cooperemail.com/api/v1/metrics/events`
- Auth: HTTP bearer

## Query parameters

- `types` string: Comma-separated: message.received, message.sent, message.bounced, message.complained. Default message.received,message.sent.
- `start` string: ISO-8601 inclusive start. Default is 30 days before end.
- `end` string: ISO-8601 exclusive end. Default is now.
- `period` 'hour' | 'day'
- `inbox_id` string: Inbox id, username, or email on this account.

## Response `200`

Time buckets and counts

- MetricsEvents
  - `object` 'metrics', required
  - `period` 'hour' | 'day', required
  - `data` object[], required
    - `bucket_start` string, required: UTC bucket start, ISO-8601
    - `counts` object, required: Requested series. Absent labels are 0.

---

[API](https://skmtc.dev/cooperemail/apis/cooper-email-api.md) · [All operations](https://skmtc.dev/cooperemail/apis/cooper-email-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cooperemail/apis/cooper-email-api/revisions/6d800a7b3e33?raw)
