# Email analytics

Open Settings → Email analytics to inspect delivery outcomes, recipient counts, rates and message timelines. History survives deleting a sent copy or inbox; deleting the account removes its history.

`GET /api/v1/analytics/metrics` accepts `start_date`, `end_date` (ISO timestamps; end exclusive), `inbox_id`, `domain_id`, `timezone` (IANA name) and `granularity` (day or hour). The default is seven days; a range can span at most 90 days.

The window selects messages by send time, including outcomes received later. Outcome counts use distinct envelope recipients; `messages` counts distinct sends. Delivery means acceptance by the receiving mail server and does not prove inbox placement. Rates are fractions from 0 to 1, or null when no eligible recipients exist.

`GET /api/v1/analytics/sends` accepts the same filters and returns up to 50 sends. Pass `next_cursor` as `before` for the next page. `GET /api/v1/analytics/sends/:id` returns recipients and up to 100 events; pass its `next_cursor` as `cursor` for more events. These endpoints require `mail:read` and respect inbox restrictions.

## Storage

Account storage includes message bodies, raw originals, attachments and drafts. Free accounts have 100 MiB; Pro accounts have 5 GiB. Trash and spam count until permanently deleted. Concurrent writes reserve space atomically. Full accounts reject API writes with HTTP 507; SMTP senders receive a temporary failure so they can retry after space is freed. Read usage with `GET /api/v1/storage`, `client.storage.usage()` or the MCP tool `get_storage_usage`. Account-wide mail:read access is required.

## Optional tracking

Tracking is disabled by default. Set `track_opens` and `track_clicks` on a send to override account defaults. HTML opens use a recipient-specific image; HTTP(S) anchor links use a recipient-specific redirect to a stored destination. Plain text and unsupported links stay unchanged. Send previews keep the original HTML.

Read defaults with `GET /api/v1/analytics/tracking`. Change them with `PATCH /api/v1/analytics/tracking` and a JSON object containing either boolean. Changing defaults requires account-wide `inboxes:manage` access. Changes affect future sends.

Opens and clicks are observations, not proof that a person read a message. Privacy proxies, prefetching and scanners can generate requests; image blocking can hide reads. Unique counts count each recipient once. The event timeline retains repeated observations. Open/click rates divide observed delivered recipients by delivered recipients with that tracking enabled. No IP address or user agent is stored.

## SDK, MCP and webhooks

The TypeScript SDK exposes `client.analytics.metrics()`, `sends()`, `events(sendId)`, `tracking()` and `updateTracking()`. MCP exposes `get_email_metrics`, `list_email_sends` and `get_email_events`.

Subscribe to `message.delivered`, `message.delayed`, `message.bounced`, `message.failed`, `message.opened` and `message.clicked` for outcomes and observations. Events include the send id, recipient, timestamp and event details. Webhooks may be retried; deduplicate by their event id.

## Guides

- [Email for AI agents](https://mailforbots.com/email-for-ai-agents)
- [A hosted MCP email server](https://mailforbots.com/mcp-email-server)
- [How to let an AI agent sign up for a website and read the verification email](https://mailforbots.com/blog/let-ai-agent-sign-up-for-websites)
