Skip to content

Email Preview API (1.0.0)

Mailgun Email Preview service with RESTful JSON HTTP API for providing email previews.

Download OpenAPI description
Languages
Servers
US Mailgun

https://api.mailgun.net/

EU Mailgun

https://api.eu.mailgun.net/

Email Preview

This API provides functionality to create and manage email preview tests, as well as create shareable links.

Operations

Get Test Results

Request

Returns the results for the specified email preview test.

Security
basicAuth
Path
test_idstringrequired

Test to get results for

curl -i -X GET \
  -u <username>:<password> \
  'https://api.mailgun.net/v1/preview/tests/{test_id}/results'

Responses

A 200 response

Bodyapplication/json
property name*object(github.com-mailgun-emailpreview-clients-preview-TestResult)additional property
Response
application/json
{ "android10_gmailapp_pixel4_dm": { "id": "android10_gmailapp_pixel4_dm", "displayname": "Gmail App Pixel 4", "client": "Gmail App", "os": "Android 10 (Dark Mode)", "category": "Mobile", "browser": "", "screenshots": {}, "thumbnail": "https://images.emailonacid.com/1234", "fullthumbnail": "https://images.emailonacid.com/90479d4733fc5f409475644cb01384b0b21bc53f1c32e0ed609756dfb63d2f5%3A1741804257", "status": "Complete", "statusdetails": {} }, "android10_gmailapp_pixel4_lm": { "id": "android10_gmailapp_pixel4_lm", "displayname": "Gmail App Pixel 4", "client": "Gmail App", "os": "Android 10", "category": "Mobile", "browser": "", "screenshots": {}, "thumbnail": "https://images.emailonacid.com/YXBpLzRRZVp3Z0479d4733fc5f409475644cb01384b0b21bc53f1c32e0ed609756dfb63d2f5%3A1741804257", "fullthumbnail": "https://images.emailonacid.com/YXBpLzRRZVp3ZzlBbmJydjVEZjBUOW9obUxpU1RUQmpe=d90479d4733fc5f409475644cb01384b0b21bc53f1c32e0ed609756dfb63d2f5%3A1741804257", "status": "Complete", "statusdetails": {} } }

Reprocess Emailpreview Test

Request

Reprocesses the test for the passed clients.

Security
basicAuth
Path
test_idstringrequired

Test to reprocess

curl -i -X PUT \
  -u <username>:<password> \
  'https://api.mailgun.net/v1/preview/tests/{test_id}/results/reprocess'

Responses

A 200 response

Bodyapplication/json
property name*object(github.com-mailgun-emailpreview-clients-preview-ReprocessInfo)additional property
Response
application/json

Get Test Content (empty)

Request

Gets HTML content of the passed test.

Security
basicAuth
Path
test_idstringrequired

Test to get the content of

curl -i -X GET \
  -u <username>:<password> \
  'https://api.mailgun.net/v1/preview/tests/{test_id}/content'

Responses

A 200 response

Bodyapplication/json
contentstringrequired
Response
application/json
{ "content": "string" }

Image Validation

The Image Validation API processes image URLs or uploads to provide comprehensive details such as dimensions, type, file size, and format, reports frame count, animation duration, color depth, and transparency for GIFs, and include image optimization capabilities.

Operations

Accessibility

The Accessibility API evaluates HTML emails against WCAG standards, providing a clear pass/fail assessment to ensure compliance with accessibility guidelines.

Operations