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 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 }

Retrieve Export Job Details for Email Preview Test Screenshots

Request

Retrieves the status and details of an export job created to collect screenshots for an Email Preview Test. Provide both the test ID and the job ID to fetch the export job information.

Security
basicAuth
Path
test_idstringrequired

Unique identifier of the Email Preview Test

job_idstringrequired

Unique identifier of the export job

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

Responses

A 200 response

Bodyapplication/json
job_idstringrequired
test_idstringrequired
clientsArray of stringsrequired
job_statusstringrequired
zip_urlstring
failed_clientsArray of strings
errorobject(github.com-mailgun-emailpreview-queue_tracking-APIError)
Response
application/json
{ "job_id": "67b469d74b911fa30a4d782e", "test_id": "98b469d74b956fa30a4d125f", "clients": [ "android11_gmailapp_pixel5_dm", "android12_gmailapp_pixel6_dm" ], "job_status": "Completed", "zip_url": "https://example.com/export.zip" }

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