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

Request

Retrieve a paginated list of all accessibility tests that have been submitted. Each test includes details such as its status, the number of checks performed, and, of those checks, how many passes and failures there were. The response is paginated, with a limit of up to 1000 items per page. The total count of records will display in the meta object under the key, 'count'.

Security
basicAuth
Query
limitinteger

Max count of items. Max: 1000. Default: 100

skipinteger

Get the list of items starting at the nth element (paging). Default: 0

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

Responses

A 200 response

Bodyapplication/json
metaobject or null
paginggithub.com-mailgun-scaffold-httpapi-paging-PagingResponse (object) or null
Any of:
itemsArray of objects(github.com-mailgun-inspect-internal-accessibility-GetAccessibilityTestsResource)
Response
application/json
{ "meta": { "count": 9 }, "paging": { "first": "https://api.mailgun.net/v1/inspect/accessibility/tests?limit=100&skip=0", "last": "https://api.mailgun.net/v1/inspect/accessibility/tests?limit=100&skip=0" }, "items": [ {} ] }

Request

This endpoint allows users to submit an accessibility test for processing. It accepts a set of HTML content, processes it for accessibility issues, and returns a unique job ID for tracking the status of the test. The status of the job will display in the meta object, with a status of 'Processing'.

Security
basicAuth
Bodyapplication/jsonrequired
htmlstringrequired

The HTML content to be tested. Can be a raw HTML string or base64 encoded.

encodedboolean

Indicates whether the html content is base64 encoded (true) or raw (false).

curl -i -X POST \
  -u <username>:<password> \
  https://api.mailgun.net/v1/inspect/accessibility \
  -H 'Content-Type: application/json' \
  -d '{
    "html": "string",
    "encoded": true
  }'

Responses

A 201 response

Bodyapplication/json
metaobject or null
itemsobject(github.com-mailgun-inspect-internal-accessibility-CreateAccessibilityResource)
Response
application/json
{ "meta": { "created_at": "2025-05-28T05:30:00Z", "status": "Processing" }, "items": { "id": "677ea3cdf1051e25e7dbfe73", "links": {} } }

Request

Retrieve the details of a specific accessibility test using the provided test ID. This endpoint returns comprehensive details about the test, including metadata and test results.

Security
basicAuth
Path
idstringrequired

The unique identifier of the test.

curl -i -X GET \
  -u <username>:<password> \
  'https://api.mailgun.net/v1/inspect/accessibility/{id}'

Responses

A 200 response

Bodyapplication/json
metaobject or null
itemsArray of objects(github.com-mailgun-inspect-internal-accessibility-AccessibilityResponse)
Response
application/json
{ "meta": { "created_at": "2025-05-28T05:30:00Z", "status": "Complete", "updated_at": "2025-05-28T05:30:10Z" }, "items": [ {} ] }

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

Email Preview

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

Operations