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

Email Preview

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

Operations

Request

Returns or generates an account's email preview address.

Security
basicAuth
curl -i -X POST \
  -u <username>:<password> \
  https://api.mailgun.net/v2/preview/address

Responses

A 200 response

Bodyapplication/json
preview_addressstringrequired
Response
application/json
{ "preview_address": "string" }

Request

Create a shareable link to an email preview test.

Security
basicAuth
Bodyapplication/jsonrequired
test_idstringrequired
curl -i -X POST \
  -u <username>:<password> \
  https://api.mailgun.net/v1/preview/sharing \
  -H 'Content-Type: application/json' \
  -d '{
    "test_id": "some-id"
  }'

Responses

A 200 response

Bodyapplication/json
messagestringrequired

Response message

Response
application/json
{ "message": "record created" }

Request

Returns PreviewShare record by TID.

Security
basicAuth
Path
test_idstringrequired

Test to get

curl -i -X GET \
  -u <username>:<password> \
  'https://api.mailgun.net/v1/preview/sharing/{test_id}'

Responses

A 200 response

Bodyapplication/json
test_idstringrequired
url_uuidstringrequired
urlstringrequired
enabledbooleanrequired
expires_atstring(date-time)required
Response
application/json
{ "test_id": "some-test-id", "url_uuid": "some-uuid", "url": "share.mailgun.com/email-previews/some-uuid", "enabled": true, "expires_at": "0001-01-01T00:00:00Z" }