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 by client ID V2

Request

This call returns detailed results for screenshots including their upload locations, send times, completion times, and information about bounces, if any. <test_id> is a test ID returned from test creation or the get test list functions. The <client_id> is required and restricts the returned data exclusively to the specified client. If the client is not present in the test or is invalid, an error will be returned.

Security
basicAuth
Path
test_idstringrequired

Test to get results for

client_idstringrequired

Client to get results for

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

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": {} } }

Get Emailpreview Test Information V2

Request

Retrieves detailed information about a specific test, including the subject, submission time (in UNIX timestamp format), processing statuses, and any content checking results. The response includes one to three properties containing arrays of clients: completed (clients that have successfully uploaded screenshots), processing (clients that are still being processed by our system), and bounced (clients that were bounced by the destination and cannot be retried). Additionally, the system will automatically requeue screenshots if they remain in processing for more than three minutes.

Security
basicAuth
Path
test_idstringrequired

The ID of the test to retrieve

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

Responses

A 200 response

Bodyapplication/json
subjectstringrequired
dateinteger(int32)required
completedArray of strings
processingArray of strings
bouncedArray of strings
content_checkingobject(github.com-mailgun-emailpreview-clients-preview-ContentCheckingResult)
Response
application/json
{ "subject": "Example Subject", "date": 1739876826, "completed": [ "client1" ], "processing": [ "client2" ], "bounced": [ "client3" ], "content_checking": { "link_validation": {}, "image_validation": {}, "accessibility": {} } }

Delete Emailpreview Test V2

Request

Deletes the specified test and its content checking. Once it is deleted, it cannot be recovered.

Security
basicAuth
Path
test_idstringrequired

Test to delete

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

Responses

A 200 response

Bodyapplication/json
successbooleanrequired
Response
application/json
{ "success": true }

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