AgentMail metrics API
The metrics API from AgentMail — 2 operation(s) for metrics.
The metrics API from AgentMail — 2 operation(s) for metrics.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/agentmail-metrics-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Reference Metrics API
version: 1.0.0
servers:
- url: https://api.agentmail.to
description: prod
- url: https://x402.api.agentmail.to
description: prod-x402
- url: https://mpp.api.agentmail.to
description: prod-mpp
- url: https://api.agentmail.eu
description: eu-prod
tags:
- name: metrics
paths:
/v0/metrics/events:
get:
operationId: query-events
summary: Query Events
description: 'Counts of email events (sent, delivered, bounced, etc.) over time for
the organization. Defaults to the last 24 hours; `start` must be within
the last 90 days, and a future `end` is clamped to now. Omit `period`
for individual event counts, or set it to sum counts into buckets of
that many seconds.
**CLI:**
```bash
agentmail metrics list
```'
tags:
- metrics
parameters:
- name: event_types
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_MetricEventTypes'
- name: start
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_Start'
- name: end
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_End'
- name: period
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_Period'
- name: limit
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_MetricLimit'
- name: descending
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_Descending'
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/type_metrics_QueryMetricsResponse'
'400':
description: Error response with status 400
content:
application/json:
schema:
$ref: '#/components/schemas/type__ValidationErrorResponse'
/v0/metrics/usage:
get:
operationId: query-usage
summary: Query Usage
description: 'Cumulative usage series for the organization. Each point is the running
total of the usage type at that timestamp, not the change within the
bucket. Defaults to the last 24 hours; `start` must be within the last
90 days, and a future `end` is clamped to now. The range divided by
`period` must not exceed 1000 buckets.'
tags:
- metrics
parameters:
- name: usage_types
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_UsageTypes'
- name: start
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_Start'
- name: end
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_End'
- name: period
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_Period'
- name: limit
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_MetricLimit'
- name: descending
in: query
required: false
schema:
$ref: '#/components/schemas/type_metrics_Descending'
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/type_metrics_QueryUsageResponse'
'400':
description: Error response with status 400
content:
application/json:
schema:
$ref: '#/components/schemas/type__ValidationErrorResponse'
components:
schemas:
type_metrics_UsagePoint:
type: object
properties:
timestamp:
type: string
format: date-time
description: Timestamp of the point.
value:
type: integer
format: int64
description: Cumulative value of the usage metric at the timestamp.
required:
- timestamp
- value
title: UsagePoint
type_metrics_Descending:
type: boolean
description: Sort in descending order.
title: Descending
type_metrics_MetricLimit:
type: integer
description: Limit on number of buckets to return.
title: MetricLimit
type_metrics_Period:
type: integer
description: Size of each time bucket as a whole number of seconds, between 1 and 86400.
title: Period
type_metrics_QueryMetricsResponse:
type: object
additionalProperties:
type: array
items:
$ref: '#/components/schemas/type_metrics_MetricBucket'
description: Metrics grouped by event type.
title: QueryMetricsResponse
type__ErrorFix:
type: string
description: The concrete next action that resolves the error.
title: ErrorFix
type_metrics_Start:
type: string
format: date-time
description: Start timestamp for the query.
title: Start
type__ValidationErrorResponse:
type: object
properties:
name:
$ref: '#/components/schemas/type__ErrorName'
code:
$ref: '#/components/schemas/type__ErrorCode'
message:
$ref: '#/components/schemas/type__ErrorMessage'
errors:
description: Validation errors. Each entry has a path and a message identifying the invalid field.
fix:
$ref: '#/components/schemas/type__ErrorFix'
docs:
$ref: '#/components/schemas/type__ErrorDocs'
required:
- name
- errors
title: ValidationErrorResponse
type__ErrorName:
type: string
description: Name of error.
title: ErrorName
type_metrics_UsageType:
type: string
enum:
- storage_bytes
- message_count
- thread_count
- inbox_count
- pod_count
- domain_count
description: 'Type of usage metric. Inbox-scoped queries carry `storage_bytes`,
`message_count`, and `thread_count`; pod-scoped queries add `inbox_count`
and `domain_count`; organization-scoped queries add `pod_count`.'
title: UsageType
type__ErrorMessage:
type: string
description: Error message.
title: ErrorMessage
type_metrics_MetricBucket:
type: object
properties:
timestamp:
type: string
format: date-time
description: Timestamp of the bucket.
count:
type: integer
description: Count of events in the bucket.
required:
- timestamp
- count
title: MetricBucket
type_metrics_UsageTypes:
type: array
items:
$ref: '#/components/schemas/type_metrics_UsageType'
description: List of usage metric types to query. Omit to query every type valid for the scope.
title: UsageTypes
type__ErrorCode:
type: string
description: Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
title: ErrorCode
type_metrics_End:
type: string
format: date-time
description: End timestamp for the query.
title: End
type_metrics_MetricEventTypes:
type: array
items:
$ref: '#/components/schemas/type_metrics_MetricEventType'
description: List of metric event types to query.
title: MetricEventTypes
type_metrics_QueryUsageResponse:
type: object
additionalProperties:
type: array
items:
$ref: '#/components/schemas/type_metrics_UsagePoint'
description: Cumulative usage series grouped by usage type.
title: QueryUsageResponse
type_metrics_MetricEventType:
type: string
enum:
- message.received
- message.received.spam
- message.received.blocked
- message.received.unauthenticated
- message.sent
- message.delivered
- message.bounced
- message.complained
- message.rejected
- domain.verified
description: Type of metric event.
title: MetricEventType
type__ErrorDocs:
type: string
description: Link to the error reference entry for this code.
title: ErrorDocs
securitySchemes:
Bearer:
type: http
scheme: bearer