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

Request

Reprocess an image validation test.

Security
basicAuth
Path
idstringrequired

Test ID

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

Responses

A 200 response

Bodyapplication/json
metaobject or null
itemsobject(github.com-mailgun-inspect-internal-imagevalidation-CreateResource)
Response
application/json
{ "meta": { "status": "Processing" }, "items": { "id": "67a654ba0f53254b9fdca3e2", "links": {} } }

Request

Optimizes images by test id

Security
basicAuth
Path
idstringrequired

The ID of the image validation test we want to optimize the images for.

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

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-imagevalidation-ImageOptimization)
Response
application/json
{ "meta": { "status": "Completed" }, "items": [ {} ] }

Request

Optimizes a single image by test id

Security
basicAuth
Path
idstringrequired

The ID of the image validation test we want to optimize the images for.

image_idstringrequired

The ID of the image we want to optimize

curl -i -X POST \
  -u <username>:<password> \
  'https://api.mailgun.net/v1/inspect/images/{id}/optimize/{image_id}'

Responses

A 200 response

Bodyapplication/json
metaobject or null
paginggithub.com-mailgun-scaffold-httpapi-paging-PagingResponse (object) or null
Any of:
itemsgithub.com-mailgun-inspect-internal-imagevalidation-ImageOptimization (object) or null
Any of:
Response
application/json
{ "meta": { "status": "Completed" }, "items": { "optimized_images": [] } }

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

Email Preview

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

Operations