Mailgun lets you tag each outgoing message with a custom value. When you access stats on your messages, they will be aggregated by these tags.
List all tags associated with a domain
A 200 response
required | Array of objects |
required | object |
A 400 response
{- "paging": {
}, - "items": [
- {
- "description": "Optional description",
- "first-seen": "2023-01-02 02:14:27 +0000 UTC",
- "last-seen": "2023-09-06 18:45:51 +0000 UTC",
- "tag": "my-tag-1"
}, - {
- "description": "Optional description",
- "first-seen": "2023-01-02 02:14:27 +0000 UTC",
- "last-seen": "2023-09-06 18:45:51 +0000 UTC",
- "tag": "my-tag-2"
}
]
}
{- "tag": "my-tag-1",
- "description": "Optional description",
- "first-seen": "2023-01-02 02:14:27 +0000 UTC",
- "last-seen": "2023-09-06 18:45:51 +0000 UTC"
}
Returns a list for a given domain for different event types
{- "provider": {
- "aol.com": {
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0,
- "accepted": 0,
- "clicked": 1
}, - "gmail.com": {
- "unsubscribed": 0,
- "accepted": 0,
- "clicked": 2,
- "opened": 1,
- "unique_clicked": 1
}
}, - "tag": "tag1"
}
Retrieve stats by tag
{- "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"
}
], - "tag": "tag1",
- "start": "Tue, 14 Feb 2012 00:00:00 UTC",
- "description": "Optional Description",
- "end": "Fri, 01 Apr 2012 00:00:00 UTC"
}