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

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

Get Accessibility Tests

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
pagingobject
itemsArray of objects
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": [ {} ] }

Create Accessibility Test

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

Get Accessibility Test

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
itemsArray of objects
Response
application/json
{ "meta": { "created_at": "2025-05-28T05:30:00Z", "status": "Complete", "updated_at": "2025-05-28T05:30:10Z" }, "items": [ {} ] }

Delete Accessibility Test

Request

Delete a specific accessibility test by its unique test ID. This endpoint allows you to remove an accessibility test from the system. If the test ID does not exist, the appropriate error message is returned.

Security
basicAuth
Path
idstringrequired

The unique identifier of the test.

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

Responses

A 200 response

Bodyapplication/json
messagestringrequired
Response
application/json
{ "message": "Accessibility test with test id <id> has been successfully deleted." }