Mailtrap
App · 20 actions
Manage email sandboxes and projects; inspect captured messages and delivery diagnostics.
Actions
| Action | What it does |
|---|---|
| Analyze message html | Check a test email's HTML for parts that email clients don't support, returning each problem found and which clients it affects. |
| Clean sandbox | Delete every test email in a sandbox, leaving the sandbox itself in place. |
| Create project | Create a new Email Sandbox project with the given name in an account. |
| Create sandbox | Create a new email sandbox with the given name in a project. |
| Delete message | Delete one test email from a sandbox by its ID. |
| Delete project | Delete a sandbox project from an account by its ID. |
| Delete sandbox | Delete an email sandbox by its ID, along with all the test emails in it. |
| Get message | Get one test email in a sandbox by its ID, returning its sender, recipients, subject, sent time, size and links to its body. |
| Get message headers | Get the full email headers of a test email in a sandbox, such as its sender, recipients, date and message ID. |
| Get project | Get one sandbox project by its ID, returning its name and the sandboxes in it. |
| Get sandbox | Get one email sandbox by its ID, returning its name, email address, SMTP settings and message counts. |
| Get spam report | Get the spam analysis of a test email, returning its overall spam score and the rules it triggered. |
| List accounts | List the Mailtrap accounts the API token can reach, returning each account's ID, name and your access level. |
| List messages | List the test emails caught in a sandbox, optionally matching a search term. |
| List projects | List the Email Sandbox projects in an account, returning each project with its ID, name and sandboxes. |
| List sandboxes | List the email sandboxes (test inboxes) in an account, returning each one's ID, name, email address and message counts. |
| Send test email | Capture a test email in a Mailtrap sandbox. |
| Update message | Mark a test email in a sandbox as read or unread. |
| Update project | Rename a sandbox project by its ID. |
| Update sandbox | Change an email sandbox's name or the username part of its email address. |
Analyze message html
Check a test email's HTML for parts that email clients don't support, returning each problem found and which clients it affects.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Message ID
message_idnumberRequired - Message ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {
"errors": [],
"status": "example"
}
}Clean sandbox
Delete every test email in a sandbox, leaving the sandbox itself in place. Returns the emptied sandbox.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {}
}Create project
Create a new Email Sandbox project with the given name in an account. Returns the new project and its ID.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Name
nametextRequired - Name.
Outputs
dataobject- Response.
Example output
{
"data": {
"id": 1,
"inboxes": [],
"name": "example"
}
}Create sandbox
Create a new email sandbox with the given name in a project. Returns the new sandbox with its ID and SMTP settings.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Project
project_idnumberRequired - Project ID.At least 1.
- Name
nametextRequired - Name.
Outputs
dataobject- Response.
Example output
{
"data": {
"id": 1,
"name": "example",
"project_id": 1
}
}Delete message
Delete one test email from a sandbox by its ID.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Message ID
message_idnumberRequired - Message ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {}
}Delete project
Delete a sandbox project from an account by its ID.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Project
project_idnumberRequired - Project ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {}
}Delete sandbox
Delete an email sandbox by its ID, along with all the test emails in it.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {}
}Get message
Get one test email in a sandbox by its ID, returning its sender, recipients, subject, sent time, size and links to its body.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Message ID
message_idnumberRequired - Message ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {
"created_at": "example",
"id": 1,
"inbox_id": 1,
"is_read": false,
"sent_at": "example",
"subject": "example"
}
}Get message headers
Get the full email headers of a test email in a sandbox, such as its sender, recipients, date and message ID.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Message ID
message_idnumberRequired - Message ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {
"headers": {}
}
}Get project
Get one sandbox project by its ID, returning its name and the sandboxes in it.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Project
project_idnumberRequired - Project ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {
"id": 1,
"inboxes": [],
"name": "example"
}
}Get sandbox
Get one email sandbox by its ID, returning its name, email address, SMTP settings and message counts.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {
"id": 1,
"name": "example",
"project_id": 1
}
}Get spam report
Get the spam analysis of a test email, returning its overall spam score and the rules it triggered.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Message ID
message_idnumberRequired - Message ID.At least 1.
Outputs
dataobject- Response.
Example output
{
"data": {
"Details": [],
"Score": 1.0,
"Spam": false
}
}List accounts
List the Mailtrap accounts the API token can reach, returning each account's ID, name and your access level.
Inputs
None.
Outputs
datalist- Response.
Example output
{
"data": []
}List messages
List the test emails caught in a sandbox, optionally matching a search term. Returns one page; pass the last message ID for the next page.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Last ID
last_idnumber - Last ID.At least 1.
- Search
searchtext - Search.
Outputs
datalist- Response.
Example output
{
"data": []
}List projects
List the Email Sandbox projects in an account, returning each project with its ID, name and sandboxes.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
Outputs
datalist- Response.
Example output
{
"data": []
}List sandboxes
List the email sandboxes (test inboxes) in an account, returning each one's ID, name, email address and message counts.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
Outputs
datalist- Response.
Example output
{
"data": []
}Send test email
Capture a test email in a Mailtrap sandbox. No email is delivered to real recipients.
Inputs
- Account
account_idnumberRequired - Account id.At least 1.
- Inbox
inbox_idnumberRequired - Inbox id.At least 1.
- Sender email
sender_emailtextRequired - Sender email.
- Recipient emails
recipient_emailslistRequired - Recipient emails.
- Subject
subjecttextRequired - Subject.
- Text
texttextRequired - Text.
- Html
htmltext - Html.
Outputs
dataobject- Response.
Example output
{
"data": {
"message_ids": [],
"success": false
}
}Update message
Mark a test email in a sandbox as read or unread. Returns the updated message.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Message ID
message_idnumberRequired - Message ID.At least 1.
- Is read
is_readtrue/falseRequired - Is read.
Outputs
dataobject- Response.
Example output
{
"data": {
"created_at": "example",
"id": 1,
"inbox_id": 1,
"is_read": false,
"sent_at": "example",
"subject": "example"
}
}Update project
Rename a sandbox project by its ID. Returns the updated project.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Project
project_idnumberRequired - Project ID.At least 1.
- Name
nametextRequired - Name.
Outputs
dataobject- Response.
Example output
{
"data": {
"id": 1,
"inboxes": [],
"name": "example"
}
}Update sandbox
Change an email sandbox's name or the username part of its email address. Returns the updated sandbox.
Inputs
- Account
account_idnumberRequired - Account ID.At least 1.
- Inbox
inbox_idnumberRequired - Inbox ID.At least 1.
- Name
nametext - Name.
- Email username
email_usernametext - Email username.
Outputs
dataobject- Response.
Example output
{
"data": {
"id": 1,
"name": "example",
"project_id": 1
}
}