Skip to main content
POST
email.metrics.get

Authorizations

Authorization
string
header
required

API key: sk_live_…

Headers

Idempotency-Key
string

Optional. A retry with the same key returns the stored result.

Maximum string length: 255
Pramaan-Max-Price-Micro
string

Optional. The most this request may be priced at, in micro-USD (a whole number above 0). It replaces the capability's own price ceiling for this request, lower or higher. Sources that could cost more are left out; when none is left the answer is 400 with the lowest limit that would work.

Pattern: ^[1-9]\d{0,14}$

Body

application/json
kind
enum<string>
required

events: what happened, per type, in buckets. usage: what you have (storage, messages, inboxes), cumulative. rates: bounce and complaint rates.

Available options:
events,
usage,
rates
inbox
string

Scope the query to one of your inboxes instead of the whole workspace.

Required string length: 1 - 320
eventTypes
string[]

events: restrict to these event types, e.g. message.received.

Maximum array length: 20
Required string length: 1 - 100
usageTypes
string[]

usage: restrict to these types, e.g. message_count, storage_bytes.

Maximum array length: 20
Required string length: 1 - 100
rateTypes
enum<string>[]

rates: restrict to these rate types.

Maximum array length: 2
Available options:
bounce,
complaint
start
string

Window start, ISO 8601. Default: 7 days ago.

Maximum string length: 40
end
string

Window end, ISO 8601. Default: now.

Maximum string length: 40
periodSeconds
integer

Bucket size in seconds (events and usage: 1 to 86400; rates: 60 to 86400).

Required range: 1 <= x <= 86400
windowSeconds
integer

rates: how far back each point looks, in seconds. Default 86400 (a rolling 24 hours).

Required range: 60 <= x <= 2592000
limit
integer

At most this many buckets per type, 1 to 200.

Required range: 1 <= x <= 200
descending
boolean

Sort newest first. Default: oldest first.

Response

The result

kind
enum<string>
required

Which metrics were read.

Available options:
events,
usage,
rates
series
object[]
required

One series per requested type.

inbox
string

The inbox the query was scoped to, when one was.

start
string

Window start actually used, ISO 8601.

end
string

Window end actually used, ISO 8601.