Mailgun Email Preview service with RESTful JSON HTTP API for providing email previews.
Email Preview API (1.0.0)
The Code Analysis API analyzes HTML email content to detect CSS features and provides comprehensive compatibility reports across major email clients, including support statistics, version-specific compatibility data, and detailed feature breakdowns to ensure optimal email rendering.
Request
Returns a paginated list of all spam tests for the account, ordered by created_at desc. Supports filtering by status and region.
Filter by spam test lifecycle status
| Enum Value | Description |
|---|---|
| pending | Test created. |
| processing | Test accepted; seeds still delivering |
| completed | Results fully mapped and persisted |
| failed | Unrecoverable error during test execution |
Filter by sending region
| Enum Value | Description |
|---|---|
| us1 | United States region |
| eu1 | European Union region |
Field to sort by
| Enum Value | Description |
|---|---|
| created_at | Sort by creation time (default) |
| updated_at | Sort by last update time |
- US Mailgunhttps://api.mailgun.net/v1/inspect/spam
- EU Mailgunhttps://api.eu.mailgun.net/v1/inspect/spam
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.mailgun.net/v1/inspect/spam?status=pending®ion=us1&sort_by=created_at&sort_order=desc&limit=0'{ "meta": {}, "items": [ { … }, { … } ], "links": {} }
Request
Initiates an inbox placement test with subject and HTML provided directly in the request body. Returns immediately with status=processing; poll GET using the Retry-After interval.
- US Mailgunhttps://api.mailgun.net/v1/inspect/spam
- EU Mailgunhttps://api.eu.mailgun.net/v1/inspect/spam
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.mailgun.net/v1/inspect/spam \
-H 'Content-Type: application/json' \
-d '{
"subject": "string",
"html": "string",
"from_name": "string",
"sending_ip": "string",
"region": "string"
}'{ "meta": {}, "item": { "id": "67a654ba0f53254b9fdca3e2", "status": "processing", "subject": "Welcome to Mailgun", "region": "us1", "created_at": "2026-03-11T10:00:00Z", "updated_at": "2026-03-11T10:00:05Z" }, "links": {} }
- US Mailgunhttps://api.mailgun.net/v1/inspect/spam/{spam_test_id}
- EU Mailgunhttps://api.eu.mailgun.net/v1/inspect/spam/{spam_test_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.mailgun.net/v1/inspect/spam/{spam_test_id}'{ "meta": {}, "item": { "id": "67a654ba0f53254b9fdca3e2", "status": "completed", "subject": "Welcome to Mailgun", "region": "us1", "results": { … }, "created_at": "2026-03-11T10:00:00Z", "updated_at": "2026-03-11T10:01:30Z" }, "links": {} }