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/

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

Code Analysis

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.

Operations

Request

Returns the lookup dictionary containing variants, clients, platforms, support levels, and categories used in code analysis.

Security
basicAuth
curl -i -X GET \
  -u <username>:<password> \
  https://api.mailgun.net/v1/inspect/analyze/dictionary

Responses

A 200 response

Bodyapplication/json
lookupsobjectrequired

Collection of lookup tables

lookups.​clientsobjectrequired

Maps client codes to human-readable client names

lookups.​clients.​property name*stringadditional property
lookups.​platformsobjectrequired

Maps platform codes to human-readable platform names

lookups.​platforms.​property name*stringadditional property
lookups.​support_levelsobjectrequired

Maps support level codes to human-readable descriptions

lookups.​support_levels.​property name*stringadditional property
lookups.​categoriesobjectrequired

Maps category codes to human-readable category names

lookups.​categories.​property name*stringadditional property
lookups.​variantsobjectrequired

Maps variant IDs to their client/platform/version details

lookups.​variants.​property name*object(github.com-mailgun-inspect-internal-codeanalysis-Variant)additional property
Response
application/json
{ "lookups": { "clients": {}, "platforms": {}, "support_levels": {}, "categories": {}, "variants": {} } }

Request

Returns a paginated list of all code analysis jobs under the account, showing only the latest version of each test. Uses skip/limit pagination and supports filtering by status.

Security
basicAuth
Query
statusstring

Filter jobs by status (Processing, Completed, Failed)

Enum ValueDescription
Processing

Filter by jobs that are currently processing

Completed

Filter by jobs that have completed

Failed

Filter by jobs that have failed

limitintegerrequired

Limits the number of items returned in a request

curl -i -X GET \
  -u <username>:<password> \
  'https://api.mailgun.net/v1/inspect/analyze?status=Processing&limit=0'

Responses

A 200 response

Bodyapplication/json
metaobject or null

Metadata including pagination links and result counts

itemsArray of objects(github.com-mailgun-inspect-internal-codeanalysis-CodeAnalysisListItem)required

List of code analysis tests

items[].​test_idstringrequired

Unique identifier for the code analysis test

items[].​statusstringrequired

Current processing status of the test

items[].​versioninteger(int32)required

Latest version number of this test

items[].​created_atstring(date-time)required

Timestamp when the test was created

items[].​linksobjectrequired

Hypermedia links for accessing test resources

items[].​links.​selfstringrequired

URL to access this resource

Response
application/json
{ "meta": { "count": 25, "first": "https://api.mailgun.com/v1/inspect/analyze?skip=0&limit=10", "last": "https://api.mailgun.com/v1/inspect/analyze?skip=240&limit=10", "next": "https://api.mailgun.com/v1/inspect/analyze?skip=20&limit=10", "previous": "https://api.mailgun.com/v1/inspect/analyze?skip=0&limit=10" }, "items": [ {}, {} ] }

Request

Create a code analysis test to analyze HTML content for email client feature compatibility.

Security
basicAuth
Bodyapplication/jsonrequired
htmlstring
urlstring
mimestring
transfer_encodingstring
charsetstring
curl -i -X POST \
  -u <username>:<password> \
  https://api.mailgun.net/v1/inspect/analyze \
  -H 'Content-Type: application/json' \
  -d '{
    "html": "string",
    "url": "string",
    "mime": "string",
    "transfer_encoding": "string",
    "charset": "string"
  }'

Responses

A 200 response

Bodyapplication/json
metaobject or null

Metadata about the test creation including status and version

itemsobjectrequired

Details of the created test including ID and links

items.​idstringrequired

Unique identifier for the created test

items.​linksobjectrequired

Hypermedia links for accessing test resources

items.​links.​selfstringrequired

URL to access this resource

Response
application/json
{ "meta": { "status": "Processing", "version": 1 }, "items": { "id": "67a654ba0f53254b9fdca3e2", "links": {} } }

Email Preview

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

Operations