Email Preview

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

List Clients

Returns a list of clients that can perform an email preview. Response mimics https://api.emailonacid.com/docs/latest/email-clients

SecuritybasicAuth
Responses
200

A 200 response

Response Schema: application/json
required
object
additional property
object
id
required
string
client
required
string
os
required
string
category
required
string
default
boolean
browser
string
rotate
boolean
image_blocking
boolean
free
boolean
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

get/v1/preview/tests/clients
Request samples
Response samples
application/json
{
  • "clients": {
    • "android10_gmailapp_pixel4_dm": {
      }
    }
}

List Emailpreview Tests

Returns a list of email preview tests. Response mimics https://api.emailonacid.com/docs/latest/email-testing#get-tests

SecuritybasicAuth
Responses
200

A 200 response

Response Schema: application/json
object
id
string
date
integer <int32>
type
string
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

get/v1/preview/tests
Request samples
Response samples
application/json
[
  • {
    • "date": 0,
    • "headers": {
      },
    • "id": "",
    • "type": ""
    }
]

Create Emailpreview Test

Creates a new email preview test. Request and response mimics https://api.emailonacid.com/docs/latest/email-testing#create-test

SecuritybasicAuth
Request
Request Body schema: create
optional
subject
required
string
object
html
string
mime
string
url
string
transfer_encoding
string
charset
string
reference_id
string
image_blocking
boolean
customer_id
string
clients
Array of strings
Responses
200

A 200 response

Response Schema: application/json
object
id
string
reference_id
string
customer_id
string
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

post/v1/preview/tests
Request samples
create
{
  "subject": "some subject",
  "url": "https://example.com"
}
Response samples
application/json
{
  • "id": "gmail"
}

Get Test Results

Returns the results for the specified email preview test. Response mimics https://api.emailonacid.com/docs/latest/email-testing#get-results

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to get results for

Responses
200

A 200 response

Response Schema: application/json
object
id
string
display_name
string
client
string
os
string
category
string
browser
string
object
status
string
thumbnail
string
full_thumbnail
string
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

get/v1/preview/tests/{test_id}/results
Request samples
Response samples
application/json
null

Get Emailpreview Test Info

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to get the content of

Responses
200

A 200 response

Response Schema: application/json
subject
required
string
date
required
integer <int32>
completed
required
Array of strings
processing
required
Array of strings
bounced
required
Array of strings
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

get/v1/preview/tests/{test_id}
Request samples
Response samples
application/json
{
  • "bounced": [
    • "string"
    ],
  • "subject": "string",
  • "date": 0,
  • "completed": [
    • "string"
    ],
  • "processing": [
    • "string"
    ]
}

Delete Emailpreview Test

Deletes the specified test. Response mimics https://api.emailonacid.com/docs/latest/email-testing#delete-test

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to delete

Responses
200

A 200 response

Response Schema: application/json
success
required
boolean
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

delete/v1/preview/tests/{test_id}
Request samples
Response samples
application/json
{
  • "success": true
}

Reprocess Emailpreview Test

Reprocesses the test for the passed clients. Response mimics https://api.emailonacid.com/docs/5/0/email-testing#reprocess

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to reprocess

Responses
200

A 200 response

Response Schema: application/json
regional
required
boolean
object
success
boolean
remaining_reprocesses
integer <int32>
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

put/v1/preview/tests/{test_id}/results/reprocess
Request samples
Response samples
application/json
null

Get Test Content (empty)

Gets HTML content of the passed test. Response mimics https://api.emailonacid.com/docs/5/0/email-testing#get-test-content

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to get the content of

Responses
200

A 200 response

Response Schema: application/json
content
required
string
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

get/v1/preview/tests/{test_id}/content
Request samples
Response samples
application/json
{
  • "content": "string"
}

Get Test Content

Gets HTML content of the passed test. Response mimics https://api.emailonacid.com/docs/5/0/email-testing#get-test-content

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to get the content of

content
string

Content to get: inlinecss or textonly

Responses
200

A 200 response

Response Schema: application/json
content
required
string
400

A 400 response

401

A 401 response

500

A 500 response

4xx

A 4xx response

get/v1/preview/tests/{test_id}/content/{content}
Request samples
Response samples
application/json
{
  • "content": "string"
}

Generate Preview Address

Returns or generates an account's email preview address.

SecuritybasicAuth
Responses
200

A 200 response

Response Schema: application/json
preview_address
required
string
500

A 500 response

4xx

A 4xx response

post/v1/preview/address
Request samples
Response samples
application/json
{
  • "preview_address": "string"
}

Create PreviewShare

Create a shareable link to an email preview test.

SecuritybasicAuth
Request
Request Body schema: create
optional
test_id
required
string
Responses
200

A 200 response

Response Schema: application/json
message
required
string
500

A 500 response

4xx

A 4xx response

post/v1/preview/sharing
Request samples
create
{
  "test_id": "some-id"
}
Response samples
application/json
{
  • "message": "record created"
}

Get PreviewShare

Returns PreviewShare record by TID.

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to get

Responses
200

A 200 response

Response Schema: application/json
test_id
required
string
url_uuid
required
string
url
required
string
enabled
required
boolean
expires_at
required
string <date-time>
500

A 500 response

4xx

A 4xx response

get/v1/preview/sharing/{test_id}
Request samples
Response samples
application/json
{
  • "expires_at": "0001-01-01 00:00:00 +0000 UTC",
  • "enabled": true,
  • "test_id": "some-test-id",
  • "url": "share.mailgun.com/email-previews/some-uuid",
  • "url_uuid": "some-uuid"
}

Update PreviewShare

Updates PreviewShare record enabled field.

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to update

query Parameters
url_uuid
required
string

UUID to update

Responses
200

A 200 response

Response Schema: application/json
message
required
string
500

A 500 response

4xx

A 4xx response

put/v1/preview/sharing/{test_id}
Request samples
Response samples
application/json
{
  • "message": "record updated"
}

Delete PreviewShare

Delete PreviewShare record by TID.

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to delete

query Parameters
url_uuid
required
string

UUID to delete

Responses
200

A 200 response

Response Schema: application/json
message
required
string
500

A 500 response

4xx

A 4xx response

delete/v1/preview/sharing/{test_id}
Request samples
Response samples
application/json
{
  • "message": "record deleted"
}

Rotate PreviewShare

Re-generates the uuid and share url, and resets the expiration.

SecuritybasicAuth
Request
path Parameters
test_id
required
string

Test to rotate

query Parameters
url_uuid
required
string

UUID to rotate

Responses
200

A 200 response

Response Schema: application/json
test_id
required
string
url_uuid
required
string
url
required
string
enabled
required
boolean
expires_at
required
string <date-time>
500

A 500 response

4xx

A 4xx response

post/v1/preview/sharing/{test_id}/rotate
Request samples
Response samples
application/json
{
  • "enabled": true,
  • "url_uuid": "some-new-uuid",
  • "url": "share.mailgun.com/email-previews/some-new-uuid",
  • "expires_at": "0001-01-01 00:00:00 +0000 UTC",
  • "test_id": "some-test-id"
}

Returns PreviewShare record by UUID.

SecuritybasicAuth
Request
path Parameters
id
required
string

UUID to get

Responses
200

A 200 response

Response Schema: application/json
subject
required
string
date
required
integer <int32>
required
Array of objects
500

A 500 response

4xx

A 4xx response

get/v1/preview/sharing/public/{id}
Request samples
Response samples
application/json
{
  • "date": 1,
  • "results": [ ],
  • "subject": "some test"
}