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.
Gets stat totals for an entire account
{- "resolution": "month",
- "description": "Optional Description",
- "start": "Tue, 14 Feb 2012 00:00:00 UTC",
- "stats": [
- {
- "accepted": {
- "incoming": 2,
- "outgoing": 1,
- "total": 3
}, - "clicked": {
- "total": 1,
- "unique": 1
}, - "delivered": {
- "http": 10,
- "optimized": 5,
- "smtp": 15,
- "total": 20
}, - "opened": {
- "total": 20,
- "unique": 1
}, - "time": "Fri, 01 Apr 2012 00:00:00 UTC"
}
], - "end": "Fri, 01 Apr 2012 00:00:00 UTC"
}
Gets stat totals for an entire domain
{- "resolution": "month",
- "description": "Optional Description",
- "stats": [
- {
- "accepted": {
- "incoming": 2,
- "outgoing": 1,
- "total": 3
}, - "clicked": {
- "total": 1,
- "unique": 1
}, - "delivered": {
- "http": 10,
- "optimized": 5,
- "smtp": 15,
- "total": 20
}, - "opened": {
- "total": 20,
- "unique": 1
}, - "time": "Fri, 01 Apr 2012 00:00:00 UTC"
}
], - "start": "Tue, 14 Feb 2012 00:00:00 UTC",
- "end": "Fri, 01 Apr 2012 00:00:00 UTC"
}
Gets stat totals for domains in an account for a single time resolution
{- "start": "Tue, 14 Feb 2012 00:00:00 UTC",
- "description": "Optional Description",
- "end": "Fri, 01 Apr 2012 00:00:00 UTC",
- "resolution": "month",
- "stats": [
- {
- "accepted": {
- "incoming": 2,
- "outgoing": 1,
- "total": 3
}, - "clicked": {
- "total": 1,
- "unique": 1
}, - "delivered": {
- "http": 10,
- "optimized": 5,
- "smtp": 15,
- "total": 20
}, - "opened": {
- "total": 20,
- "unique": 1
}, - "time": "Fri, 01 Apr 2012 00:00:00 UTC"
}
]
}
Gets filtered and group stat totals for an entire account
{- "stats": [
- {
- "accepted": {
- "incoming": 2,
- "outgoing": 1,
- "total": 3
}, - "clicked": {
- "total": 1,
- "unique": 1
}, - "delivered": {
- "http": 10,
- "optimized": 5,
- "smtp": 15,
- "total": 20
}, - "opened": {
- "total": 20,
- "unique": 1
}, - "time": "Fri, 01 Apr 2012 00:00:00 UTC"
}
], - "resolution": "month",
- "start": "Tue, 14 Feb 2012 00:00:00 UTC",
- "description": "Optional Description",
- "end": "Fri, 01 Apr 2012 00:00:00 UTC"
}
Gets aggregate counts by email service provider
{- "providers": {
- "aol.com": {
- "unsubscribed": 0,
- "accepted": 0,
- "clicked": 1,
- "opened": 1,
- "unique_clicked": 1
}, - "gmail.com": {
- "accepted": 0,
- "clicked": 2,
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0
}
}
}
Gets aggregate counts on devices that triggered events ('tablet', 'phone', 'pc', etc…)
{- "devices": {
- "unknown": {
- "unsubscribed": 0,
- "accepted": 0,
- "clicked": 2,
- "opened": 1,
- "unique_clicked": 1
}, - "desktop": {
- "accepted": 0,
- "clicked": 1,
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0
}, - "mobile": {
- "accepted": 0,
- "clicked": 2,
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0
}, - "tablet": {
- "unsubscribed": 0,
- "accepted": 0,
- "clicked": 2,
- "opened": 1,
- "unique_clicked": 1
}
}
}
Gets aggregate counts by country (USA, RUS, etc…)
{- "countries": {
- "us": {
- "accepted": 0,
- "clicked": 1,
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0
}, - "ru": {
- "accepted": 0,
- "clicked": 2,
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0
}
}
}