Skip to content

Stats

Mailgun collects many different events and generates event statistics which are available in your Control Panel. This data is also available via our stats API endpoint.

WARNING: This API is deprecated in favor of our Metrics API.

Totals for entire account
deprecated

Request

Gets stat totals for an entire account

Security
basicAuth
Query
startstring

The start date in RFC 2822 format or unix epoch (default: 7 days ago)

endstring

The end date in RFC 2822 format or unix epoch (default: current time)

resolutionstring

The gregorian resolution the query is for 'day, month, hour` (default: day)

durationstring

If duration is provided than it's calculated from the 'end' date and overwrites the 'start' date

eventstringrequired

Name of the event(s) to receive the stats for (Multiple events are allowed). Supported events are: accepted, delivered, failed, opened, clicked, unsubscribed, complained, stored

curl -i -X GET \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v3/stats/total?start=string&end=string&resolution=string&duration=string&event=string'

Responses

A 200 response

Bodyapplication/json
tagstring
descriptionstringrequired
startstringrequired
endstringrequired
typeobject(github.com-mailgun-scout-model-types-StatType)
resolutionstringrequired
statsArray of objects(github.com-mailgun-scout-model-stats-StatsItem)required
Response
{ "description": "Optional Description", "start": "Tue, 14 Feb 2012 00:00:00 UTC", "end": "Fri, 01 Apr 2012 00:00:00 UTC", "resolution": "month", "stats": [ {} ] }