Mailgun keeps track of every inbound and outbound message event and stores this log data. This data can be queried and filtered to provide insights into the health of your email infrastructure.
Gets customer event logs for an account
start | string The start date (default: 1 day before current time). Must be in RFC 2822 format: https://datatracker.ietf.org/doc/html/rfc2822.html#page-14 |
end | string The end date (default: current time). Must be in RFC 2822 format: https://datatracker.ietf.org/doc/html/rfc2822.html#page-14 |
events | Array of strings The set of events to include. |
metric_events | Array of strings Optional set of analytics metric events. Will be converted into corresponding events. |
object Filters to apply to the query. | |
include_subaccounts | boolean Include logs from all subaccounts. |
include_totals | boolean Include total number of log entries. |
{- "start": "Mon, 08 Jul 2024 00:00:00 -0000",
- "end": "Fri, 12 Jul 2024 00:00:00 -0000",
- "filter": {
- "AND": [
- {
- "attribute": "domain",
- "comparator": "=",
- "values": [
- {
- "label": "example.com",
- "value": "example.com"
}
]
}
]
}, - "include_subaccounts": true
}
{- "start": "Mon, 08 Jul 2024 00:00:00 -0000",
- "end": "Fri, 12 Jul 2024 00:00:00 -0000",
- "items": [
- {
- "id": "JDhSWf9mT5OFxCkZfpDU5d",
- "event": "failed",
- "@timestamp": "2024-07-08T16:30:18.530Z",
- "account": {
- "id": "12345"
}, - "delivery-status": {
- "message": "Turret client: server connection failed",
- "attempt-no": 5,
- "code": 680,
- "session-seconds": 15.026,
- "retry-seconds": 145
}, - "domain": {
- "name": "example.com"
}, - "recipient": "example@gmail.com",
- "recipient-domain": "gmail.com",
- "recipient-provider": "Gmail",
- "envelope": {
- "sender": "bob@example.com",
- "transport": "smtp",
- "sending-ip": "198.52.100.1",
- "targets": "bob@example.com"
}
}
], - "pagination": {
- "previous": "cjsijbijewbu78t678tVTYUYU76754fyuiksi23h75",
- "next": "cjsijbijewbu78t678tVTYUYU76754fyuiksin98hh",
- "first": "cjsijbijewbu78t678tVTYUYU76754fyuiksin865g",
- "last": "875bunjnWkmis75bjklnsdk0s7jksnjknlknc64aTR",
- "total": 1000
}, - "aggregates": { }
}