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
{- "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"
}
], - "paging": {
}
}
{- "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"
}
Returns a list for a given domain for different event types
{- "tag": "tag1",
- "provider": {
- "aol.com": {
- "clicked": 1,
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0,
- "accepted": 0
}, - "gmail.com": {
- "accepted": 0,
- "clicked": 2,
- "opened": 1,
- "unique_clicked": 1,
- "unsubscribed": 0
}
}
}
Retrieve stats by tag
{- "start": "Tue, 14 Feb 2012 00:00:00 UTC",
- "description": "Optional Description",
- "tag": "tag1",
- "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"
}
]
}