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