Skip to main content

MailSlurp REST API

API documentation.

Swagger UI

Setup​

Base URL:

https://api.mailslurp.com

Authentication Header:

x-api-key: your-api-key

Endpoints​

AliasController​

"Endpoints for creating, listing, and deleting email aliases. Aliases must be validated. Email aliases can be used to hide real email addresses behind an alias. If you wish to receive emails with an alias attach an inbox to the alias. Whenever the inbox receives an email the email will be forwarded to the alias email address. See related threads. Threads can be used with aliases to enable replying to a proxied email. This means that when threads are enabled an email alias will create a new email thread for the message and set the replyTo and from headers on the subsequently proxied email to point to the threads unique email address. By replying to this address the thread will forward it to the original emails sender or replyTo and use the same subject and bcc and cc contacts as the email you are replying to. For more advanced email operations using aliases use the inboxId for the given alias.

getAlias​

Get an email alias by ID

get/aliases/{aliasId}

updateAlias​

put/aliases/{aliasId}

deleteAlias​

delete/aliases/{aliasId}

replyToAliasEmail​

Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails to, cc, and bcc.

put/aliases/{aliasId}/emails/{emailId}

getAliases​

Get all email aliases in paginated form

get/aliases

createAlias​

Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached

post/aliases

getAliasEmails​

Get paginated emails for an alias by ID

get/aliases/{aliasId}/emails

sendAliasEmail​

Send an email from an alias. Replies to the email will be forwarded to the alias masked email address

post/aliases/{aliasId}/emails

getAliasThreads​

Returns threads created for an email alias in paginated form

get/aliases/{aliasId}/threads

AttachmentController​

Endpoints for uploading attachments. Attachments can be uploaded in a number of ways: as base64 encoded strings, as byte array octet streams, and as multipart form requests. Each upload method returns an array whose first element is the ID of the attachment. Use this Id to send the attachment with emails. See the EmailController download endpoints for downloading attachments. Attachment downloads are based on the email ID they belong to and can be downloaded using the email controller.

getAttachments​

Get all attachments in paginated response. Each entity contains meta data for the attachment such as name and content-type. Use the attachmentId and the download endpoints to get the file contents.

get/attachments

uploadAttachment​

post/attachments

deleteAllAttachments​

delete/attachments

uploadMultipartForm​

post/attachments/multipart

uploadAttachmentBytes​

post/attachments/bytes

getAttachment​

get/attachments/{attachmentId}

deleteAttachment​

delete/attachments/{attachmentId}

getAttachmentInfo​

Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties name and content-type and content-length in bytes for a given attachment.

get/attachments/{attachmentId}/metadata

downloadAttachmentAsBytes​

Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.

get/attachments/{attachmentId}/bytes

downloadAttachmentAsBase64Encoded​

Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment method but allows some clients to get around issues with binary responses.

get/attachments/{attachmentId}/base64

BounceController​

Endpoints for access bounced emails and bounced recipients

filterBouncedRecipient​

Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints

post/bounce/filter-recipients

getBouncedRecipients​

Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.

get/bounce/recipients

getBouncedRecipient​

Bounced emails are email you have sent that were rejected by a recipient

get/bounce/recipients/{id}

getListUnsubscribeRecipients​

Unsubscribed recipient have unsubscribed from a mailing list for a user or domain and cannot be contacted again.

get/bounce/list-unsubscribe-recipients

getBouncedEmails​

Bounced emails are email you have sent that were rejected by a recipient

get/bounce/emails

getBouncedEmail​

Bounced emails are email you have sent that were rejected by a recipient

get/bounce/emails/{id}

getComplaints​

SMTP complaints made against your account

get/bounce/complaints

BulkActionsController​

Other endpoints including advanced receive options

bulkSendEmails​

post/bulk/send

bulkCreateInboxes​

post/bulk/inboxes

bulkDeleteInboxes​

delete/bulk/inboxes

CommonActionsController​

A collection of common actions. Groups together several controllers behind a facade with convenience methods. Not recommended. It is better in most cases to call the individual controllers directly as they are where many new features are added. The controllers are better documented too. This controller is maintained for backwards compatibility.

sendEmailSimple​

If no senderId or inboxId provided a random email address will be used to send from.

post/sendEmail

createNewEmailAddress​

Returns an Inbox with an id and an emailAddress

post/newEmailAddress

createRandomInbox​

Returns an Inbox with an id and an emailAddress

post/createInbox

emptyInbox​

Deletes all emails

delete/emptyInbox

deleteEmailAddress​

Deletes inbox email address

delete/deleteEmailAddress

ContactController​

Endpoints for managing contacts. Contacts can be used for sending emails to individuals and groups.

getContacts​

get/contacts

createContact​

post/contacts

getContact​

get/contacts/{contactId}

deleteContact​

delete/contacts/{contactId}

getContactVCard​

get/contacts/{contactId}/download

getAllContacts​

get/contacts/paginated

DomainController​

Endpoints for managing custom domains. Once you create a custom domain you must add the returned verification records to your hosting provider. See support or guides for more information.

getDomain​

Returns domain verification status and tokens for a given domain

get/domains/{id}

updateDomain​

Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.

put/domains/{id}

deleteDomain​

Delete a domain. This will disable any existing inboxes that use this domain.

delete/domains/{id}

getDomains​

List all custom domains you have created

get/domains

createDomain​

Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.

post/domains

getDomainWildcardCatchAllInbox​

Get the catch all inbox for a domain for missed emails

get/domains/{id}/wildcard

addDomainWildcardCatchAll​

Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated

post/domains/{id}/wildcard

getDomainIssues​

List domain issues for domains you have created

get/domains/issues

EmailController​

Endpoints for managing email entities. Send and read email using the email API. You can fetch emails and attachments, reply to emails, and send new emails with this controller. Emails belong to inboxes. Each inbox can contain unlimited emails that are either permanent or temporary depending on your setup. Because emails can be quite large when attachments and content are fetched most responses only include a preview of the email and its most important features, like subject, recipients etc and an ID. Many list results are in a paginated form using an index (zero based) and a page size. To receive email decide on either waitFor methods (such as waitForLatestEmail on the WaitForController) to wait for emails to arrive. Use getEmails on EmailController or getInboxEmails on the InboxController to list existing emails. To access the body or attachments of an email you need to use the getEmail and getAttachment endpoints with specific inbox and email IDs. The body is returned on full email entities and contains the parsed body of the email. The email headers (such as recipients, subject etc.) are stored on the email object. You can access the RAW SMTP message via various raw methods. Attachments are treated as separate entities that have an ID and belong to the email. To fetch email attachments first fetch the full email then use a downloadAttachment method for each attachmentID. Attachments are transferred in a number of ways as either application/octect-stream byte arrays or as base64 encoded strings with meta data. You may prefer either depending on the environment you are in but the base64 implementations are typically safer. See the AttachmentController, InboxController, and WaitForController for similar methods.

getEmail​

Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints

get/emails/{emailId}

replyToEmail​

Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails to, cc, and bcc.

put/emails/{emailId}

deleteEmail​

Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.

delete/emails/{emailId}

getEmailsPaginated​

By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages

get/emails

sendEmailSourceOptional​

Alias for InboxController.sendEmail method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email.

post/emails

deleteAllEmails​

Deletes all emails in your account. Be careful as emails cannot be recovered

delete/emails

validateEmail​

Validate the HTML content of email if HTML is found. Considered valid if no HTML is present.

post/emails/{emailId}/validate

applyImapFlagOperation​

Apply RFC3501 section-2.3.2 IMAP flag operations on an email

post/emails/{emailId}/imap-flag-operation

forwardEmail​

Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the from option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints.

post/emails/{emailId}/forward

getEmailContentMatch​

Return the matches for a given Java style regex pattern. Do not include the typical / at start or end of regex in some languages. Given an example your code is: 12345 the pattern to extract match looks like code is: (\d{6}). This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: ['code is: 123456', '123456'] See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.

post/emails/{emailId}/contentMatch

markAsRead​

Marks an email as read or unread. Pass boolean read flag to set value. This is useful if you want to read an email but keep it as unread

patch/emails/{emailId}/read

getEmailPreviewURLs​

Get a list of URLs for email content as text/html or raw SMTP message for viewing the message in a browser.

get/emails/{emailId}/urls

getEmailTextLines​

Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.

get/emails/{emailId}/textLines

getRawEmailContents​

Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint

get/emails/{emailId}/raw

getRawEmailJson​

Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response

get/emails/{emailId}/raw/json

HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes

get/emails/{emailId}/links

getEmailHTML​

Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: ?apiKey=xxx. Returns content-type text/html;charset=utf-8 so you must call expecting that content response not JSON. For JSON response see the getEmailHTMLJson method.

get/emails/{emailId}/html

getEmailHTMLQuery​

Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors

get/emails/{emailId}/htmlQuery

getEmailHTMLJson​

Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type application/json;charset=utf-8 so you must call expecting that content response not JSON.

get/emails/{emailId}/html/json

downloadBody​

Returns the specified email body for a given email as a string

get/emails/{emailId}/body

downloadBodyBytes​

Returns the specified email body for a given email as a stream / array of bytes.

get/emails/{emailId}/body-bytes

getEmailAttachments​

Returns an array of attachment metadata such as name and content-type for a given email if present.

get/emails/{emailId}/attachments

downloadAttachment​

Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.

get/emails/{emailId}/attachments/{attachmentId}

getAttachmentMetaData​

Returns the metadata such as name and content-type for a given attachment and email.

get/emails/{emailId}/attachments/{attachmentId}/metadata

downloadAttachmentBase64​

Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment method but allows some clients to get around issues with binary responses.

get/emails/{emailId}/attachments/{attachmentId}/base64

getUnreadEmailCount​

Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response

get/emails/unreadCount

getOrganizationEmailsPaginated​

By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages

get/emails/organization

getLatestEmail​

Get the newest email in all inboxes or in a passed set of inbox IDs

get/emails/latest

getLatestEmailInInbox_1​

Get the newest email in all inboxes or in a passed set of inbox IDs

get/emails/latestIn

getGravatarUrlForEmailAddress​

Get gravatar url for email address

get/emails/gravatarFor

getEmailCount​

get/emails/emails/count

EmailVerificationController​

validateEmailAddressList​

post/email-verification/email-address-list

getValidationRequests​

get/email-verification/validation-requests

ExpiredController​

View and manage expired inbox records. If an inbox has an expiration date when it is created it will expire at that time and an ExpiredInboxRecord will be created for it listing the email address and inbox ID. You can still view emails belonging to the inbox by using the inbox ID but the inbox can no longer send or receive emails once expired.

getExpiredInboxes​

Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties

get/expired

getExpiredInboxRecord​

Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties

get/expired/{expiredId}

getExpiredInboxByInboxId​

Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId

get/expired/inbox/{inboxId}

getExpirationDefaults​

Return default times used for inbox expiration

get/expired/defaults

ExportController​

Endpoints for exporting user data to CSV, XML and other formats.

exportEntities​

get/export
post/export

FormController​

Form controller for submitting email-able forms

submitForm​

This endpoint allows you to submit HTML forms and receive the field values and files via email.

Parameters​

The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email.

You must provide at-least a _to email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding name attributes or as URL query parameters such as ?_to=test@example.com

The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments.

Submitting​

This endpoint accepts form submission via POST method. It accepts application/x-www-form-urlencoded, and multipart/form-data content-types.

HTML Example​

<form 
action="https://api.mailslurp.com/forms"
method="post"
>
<input name="_to" type="hidden" value="test@example.com"/>
<textarea name="feedback"></textarea>
<button type="submit">Submit</button>
</form>

URL Example​

<form 
action="https://api.mailslurp.com/forms?_to=test@example.com"
method="post"
>
<textarea name="feedback"></textarea>
<button type="submit">Submit</button>
</form>

The email address is specified by a _to field OR is extracted from an email alias specified by a _toAlias field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the enctype attribute, for instance: <form enctype="multipart/form-data">.

post/forms

GroupController​

Endpoints for managing groups. Groups can be used for sending emails to individuals and groups.

getGroupWithContacts​

get/groups/{groupId}/contacts

addContactsToGroup​

put/groups/{groupId}/contacts

removeContactsFromGroup​

delete/groups/{groupId}/contacts

getGroups​

get/groups

createGroup​

post/groups

getGroup​

get/groups/{groupId}

deleteGroup​

delete/groups/{groupId}

getGroupWithContactsPaginated​

Get group and paginated contacts belonging to it

get/groups/{groupId}/contacts-paginated

getAllGroups​

get/groups/paginated

InboxController​

Endpoints for creating and managing inboxes. Also includes endpoints for listing emails within inboxes. Inboxes are a core feature of MailSlurp. Each inbox has a unique ID and emailAddress. Inboxes can be either HTTP or SMTP inboxes. Both are email inboxes but HTTP mailboxes are processed using AWS SES while SMTP inboxes use a custom mail server listening at mx.mailslurp.com. Use HTTP inboxes for testing and SMTP inboxes for public facing inboxes. If your plan allows custom domains you can create inboxes with custom addresses that end in your domain. By default inboxes are assigned a random email address ending in @mailslurp.com. Use the domainPool options to use a randomly selected domain from a pool of available domains. Whenever you create an inbox MailSlurp will register the address and store any emails sent to the address within your inbox. You can use the InboxController endpoints to list the emails in an inbox. To get the contents or attachments of an email use the ID returned from InboxController methods to call the EmailController endpoints."

setInboxFavourited​

Set and return new favourite state for an inbox

put/inboxes/{inboxId}/favourite

getInboxes​

List the inboxes you have created. Note use of the more advanced getAllInboxes is recommended and allows paginated access using a limit and sort parameter.

get/inboxes

createInbox​

Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.

post/inboxes

deleteAllInboxes​

Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.

delete/inboxes

getInbox​

Returns an inbox's properties, including its email address and ID.

get/inboxes/{inboxId}

sendEmail​

Send an email from an inbox's email address. The request body should contain the SendEmailOptions that include recipients, attachments, body etc. See SendEmailOptions for all available properties. Note the inboxId refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method sendEmailAndConfirm.

post/inboxes/{inboxId}

deleteInbox​

Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.

delete/inboxes/{inboxId}

updateInbox​

Update editable fields on an inbox

patch/inboxes/{inboxId}

sendWithSchedule​

Send an email using a delay. Will place the email onto a scheduler that will then be processed and sent. Use delays to schedule email sending.

post/inboxes/{inboxId}/with-schedule

sendEmailWithQueue​

Send an email using a queue. Will place the email onto a queue that will then be processed and sent. Use this queue method to enable any failed email sending to be recovered. This will prevent lost emails when sending if your account encounters a block or payment issue.

post/inboxes/{inboxId}/with-queue

sendSmtpEnvelope​

Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY.

post/inboxes/{inboxId}/smtp-envelope

sendTestEmail​

Send an inbox a test email to test email receiving is working

post/inboxes/{inboxId}/send-test-email

listInboxRulesets​

List all rulesets attached to an inbox

get/inboxes/{inboxId}/rulesets

createInboxRuleset​

Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving

post/inboxes/{inboxId}/rulesets

sendEmailAndConfirm​

Sister method for standard sendEmail method with the benefit of returning a SentEmail entity confirming the successful sending of the email with a link to the sent object created for it.

post/inboxes/{inboxId}/confirm

createInboxWithOptions​

Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.

post/inboxes/withOptions

createInboxWithDefaults​

post/inboxes/withDefaults

listInboxTrackingPixels​

List all tracking pixels sent from an inbox

get/inboxes/{inboxId}/tracking-pixels

getInboxSentEmails​

Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.

get/inboxes/{inboxId}/sent

getScheduledJobsByInboxId​

Schedule sending of emails using scheduled jobs.

get/inboxes/{inboxId}/scheduled-jobs

getEmails​

List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the minCount parameter. The server will retry the inbox database until the minCount is satisfied or the retryTimeout is reached

get/inboxes/{inboxId}/emails

getInboxEmailsPaginated​

Get a paginated list of emails in an inbox. Does not hold connections open.

get/inboxes/{inboxId}/emails/paginated

getInboxEmailCount​

get/inboxes/{inboxId}/emails/count

getDeliveryStatusesByInboxId​

Get all email delivery statuses for an inbox

get/inboxes/{inboxId}/delivery-status

getInboxTags​

Get all inbox tags

get/inboxes/tags

getAllScheduledJobs​

Schedule sending of emails using scheduled jobs. These can be inbox or account level.

get/inboxes/scheduled-jobs

getScheduledJob​

Get a scheduled email job details.

get/inboxes/scheduled-jobs/{jobId}

cancelScheduledJob​

Get a scheduled email job and cancel it. Will fail if status of job is already cancelled, failed, or complete.

delete/inboxes/scheduled-jobs/{jobId}

getAllInboxes​

List inboxes in paginated form. The results are available on the content property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative getInboxes method returns a full list of inboxes but is limited to 100 results.

get/inboxes/paginated

getOrganizationInboxes​

List organization inboxes in paginated form. These are inboxes created with allowTeamAccess flag enabled. Organization inboxes are readOnly for non-admin users. The results are available on the content property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time).

get/inboxes/organization

getImapSmtpAccess​

Get IMAP and SMTP access usernames and passwords

get/inboxes/imap-smtp-access

getInboxIds​

Get list of inbox IDs

get/inboxes/ids

getLatestEmailInInbox​

Get the newest email in an inbox or wait for one to arrive

get/inboxes/getLatestEmail

doesInboxExist​

Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses

get/inboxes/exists

getInboxCount​

get/inboxes/count

getInboxByName​

Get a inbox result by name

get/inboxes/byName

getInboxByEmailAddress​

Get a inbox result by email address

get/inboxes/byEmailAddress

deleteAllInboxEmails​

Deletes all emails in an inbox. Be careful as emails cannot be recovered

delete/inboxes/{inboxId}/deleteAllInboxEmails

flushExpired​

Remove any expired inboxes for your account (instead of waiting for scheduled removal on server)

delete/inboxes/expired

InboxForwarderController​

Endpoints for creating and managing inbox forwarders. Automatically forward emails received by inboxes using rules.

getInboxForwarders​

List all forwarders attached to an inbox

get/forwarders

testInboxForwardersForInbox​

Test inbox forwarders for inbox

put/forwarders

createNewInboxForwarder​

Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving

post/forwarders

deleteInboxForwarders​

Delete inbox forwarders. Accepts optional inboxId filter.

delete/forwarders

testNewInboxForwarder​

Test new inbox forwarder

patch/forwarders

getInboxForwarder​

Get inbox ruleset

get/forwarders/{id}

updateInboxForwarder​

Update inbox ruleset

put/forwarders/{id}

deleteInboxForwarder​

Delete inbox forwarder

delete/forwarders/{id}

testInboxForwarder​

Test an inbox forwarder

post/forwarders/{id}/test

getInboxForwarderEvents​

Get inbox ruleset events

get/forwarders/{id}/events

InboxReplierController​

Endpoints for creating and managing inbox repliers. Repliers can automatically reply to emails received by inboxes using rules.

getInboxReplier​

Get inbox ruleset

get/repliers/{id}

updateInboxReplier​

Update inbox ruleset

put/repliers/{id}

deleteInboxReplier​

Delete inbox replier

delete/repliers/{id}

getInboxRepliers​

List all repliers attached to an inbox

get/repliers

createNewInboxReplier​

Create a new inbox rule for reply toing, blocking, and allowing emails when sending and receiving

post/repliers

deleteInboxRepliers​

Delete inbox repliers. Accepts optional inboxId filter.

delete/repliers

getInboxReplierEvents​

Get inbox ruleset events

get/repliers/{id}/events

InboxRulesetController​

Endpoints for creating and managing inbox rulesets. Inbox rulesets are sets of rules that can be automatically applied to inbound and outbound emails for an inbox. Rulesets can have a scope, action, and target. The scope is receiving or sending emails. The action is to block, allow, or forward an email. The target is pattern or email address depending on the action. The handler can be used to handle rules silently or trigger an exception when they occur. See inbox controller for similar methods.

getInboxRulesets​

List all rulesets attached to an inbox

get/rulesets

testInboxRulesetsForInbox​

Test inbox rulesets for inbox

put/rulesets

createNewInboxRuleset​

Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving

post/rulesets

deleteInboxRulesets​

Delete inbox rulesets. Accepts optional inboxId filter.

delete/rulesets

testNewInboxRuleset​

Test new inbox ruleset

patch/rulesets

testInboxRuleset​

Test an inbox ruleset

post/rulesets/{id}/test

getInboxRuleset​

Get inbox ruleset

get/rulesets/{id}

deleteInboxRuleset​

Delete inbox ruleset

delete/rulesets/{id}

MailServerController​

verifyEmailAddress​

post/mail-server/verify/email-address

getIpAddress​

post/mail-server/describe/ip-address

describeMailServerDomain​

post/mail-server/describe/domain

getDnsLookup​

post/mail-server/describe/dns-lookup

MissedEmailController​

Endpoints for managing MissedEmails. Missed emails are saved whenever your account cannot persist a received email because your plan had exceeded a given usage at the time. Missed emails can be restored with the assistance of the support team.

restoreMissedEmails​

If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method.

post/missed-emails/restore

getAllMissedEmails​

get/missed-emails

getMissedEmail​

List emails that were missed due to plan limits.

get/missed-emails/{missedEmailId}

waitForNthMissedEmail​

Wait for 0 based index missed email

get/missed-emails/waitForNthMissedEmail

getAllUnknownMissedEmails​

Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox.

get/missed-emails/unknown

PhoneController​

Endpoints for managing phone numbers and addresses

testPhoneNumberSendSms​

post/phone/numbers/{phoneNumberId}/test

getEmergencyAddresses​

get/phone/emergency-addresses

createEmergencyAddress​

post/phone/emergency-addresses

getPhonePlans​

get/phone/plans

getPhoneNumbers​

get/phone/numbers

getPhoneNumber​

get/phone/numbers/{phoneNumberId}

deletePhoneNumber​

delete/phone/numbers/{phoneNumberId}

getEmergencyAddress​

get/phone/emergency-addresses/{addressId}

deleteEmergencyAddress​

delete/phone/emergency-addresses/{addressId}

SentEmailsController​

Endpoints for viewing sent email receipts. These can be used to verify that an email has been sent or for historical records. Email content and attachments are stored. For legacy reasons the default send endpoint does not return a sent email. Use the sendEmailAndConfirm methods to receive a sent email receipt after sending.

getSentEmails​

get/sent

deleteAllSentEmails​

delete/sent

getSentDeliveryStatusesBySentId​

Get all sent email delivery statuses

get/sent/{sentId}/delivery-status

getSentEmail​

get/sent/{id}

deleteSentEmail​

delete/sent/{id}

getSentEmailPreviewURLs​

Get a list of URLs for sent email content as text/html or raw SMTP message for viewing the message in a browser.

get/sent/{id}/urls

getSentEmailTrackingPixels​

Get all tracking pixels for a sent email in paginated form

get/sent/{id}/tracking-pixels

getSentEmailHTMLContent​

get/sent/{id}/html

getRawSentEmailContents​

Returns a raw, unparsed, and unprocessed sent email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawSentEmailJson endpoint

get/sent/{emailId}/raw

getRawSentEmailJson​

Returns a raw, unparsed, and unprocessed sent email wrapped in a JSON response object for easier handling when compared with the getRawSentEmail text/plain response

get/sent/{emailId}/raw/json

getAllSentTrackingPixels​

Get all sent email tracking pixels in paginated form

get/sent/tracking-pixels

getSentEmailsWithQueueResults​

get/sent/queue-results

getSentOrganizationEmails​

Get all sent organization emails in paginated form

get/sent/organization

getSentDeliveryStatuses​

Get all sent email delivery statuses

get/sent/delivery-status

getSentDeliveryStatus​

Get a sent email delivery status

get/sent/delivery-status/{deliveryId}

waitForDeliveryStatuses​

Wait for delivery statuses

get/sent/delivery-status/wait-for

SmsController​

Endpoints for managing SMS

getSmsMessagesPaginated​

By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages

get/sms

deleteSmsMessages​

Delete all SMS messages or all messages for a given phone number

delete/sms

getSmsMessage​

Returns a SMS summary object with content.

get/sms/{smsId}

deleteSmsMessage​

Delete an SMS message

delete/sms/{smsId}

TemplateController​

Endpoints for managing Templates. Templates can be used when sending emails and support moustache syntax template variables. Variables can be passed with send email options or implicitly available if Contact Groups are used.

getTemplate​

Get email template

get/templates/{templateId}

updateTemplate​

Update email template

put/templates/{templateId}

deleteTemplate​

Delete template

delete/templates/{templateId}

getTemplates​

Get all templates

get/templates

createTemplate​

Create an email template with variables for use with templated transactional emails.

post/templates

getTemplatePreviewJson​

Get email template preview with passed template variables in JSON format. Pass template variables as query params.

get/templates/{templateId}/preview/json

getTemplatePreviewHtml​

Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.

get/templates/{templateId}/preview/html

getAllTemplates​

Get all templates in paginated format

get/templates/paginated

TrackingController​

Endpoints for managing tracking entities such as email open and read tracking pixels.

getAllTrackingPixels​

List tracking pixels in paginated form

get/tracking/pixels

createTrackingPixel​

Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.

post/tracking/pixels

getTrackingPixel​

get/tracking/pixels/{id}

UserController​

getJsonPropertyAsString​

Utility function to extract properties from JSON objects in language where this is cumbersome.

post/user/json/pluck

getUserInfo​

Get account information for your user

get/user/info

WaitForController​

Endpoints for receiving emails using waitFor methods. The endpoints are perfect for synchronous blocking calls, long-polling, or tests (see webhooks if you need to respond to email events as they happen using HTTP notification). These wait endpoints are all built around a common idea - that you ask for an expected number of emails from an inbox and MailSlurp will either: A) Return the matching emails if they are present; B) Hold a connection open until the matching emails are are received or until a timeout occurs. For test suites we recommend that you create a new inbox for each test run and use the waitForLatestEmail to hold the connection until the email you expect arrives. Note if your inbox is not already empty waitFor methods may return immediately depending on their implementation. See each endpoint for more details.

waitFor​

Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met

post/waitFor

waitForSms​

Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met

post/waitForSms

waitForMatchingFirstEmail​

Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the MatchOptions object for options. An example payload is { matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController getEmailContentMatch method.

post/waitForMatchingFirstEmail

waitForMatchingEmails​

Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the MatchOptions object for options. An example payload is { matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController getEmailContentMatch method.

post/waitForMatchingEmails

waitForLatestSms​

Wait until a phone number meets given conditions or return immediately if already met

post/waitForLatestSms

waitForNthEmail​

If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.

get/waitForNthEmail

waitForLatestEmail​

Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set unreadOnly=true or see the other receive methods such as waitForNthEmail or waitForEmailCount.

get/waitForLatestEmail

waitForEmailCount​

If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.

get/waitForEmailCount

WebhookController​

Endpoint for interacting with webhooks. Webhooks have a URL that points to your server. Useful for email forwarding, email API processing and more. They can be added to inboxes and when an inbox receives an email the email ID and inbox ID will be posted to the URL endpoint at your server. The schema of the webhook payload is available at https://api.mailslurp.com/schemas/webhook-payload or by calling https://api.mailslurp.com/webhooks/test. Use webhooks to react in real-time to inbound emails. Use the webhook payload posted to your server to fetch the full emails or attachments if you need them. Use the event ID as an idempotent record. The ID identifies the webhook payload uniquely. MailSlurp tracks webhook processing. It will try not to send the same event twice but it can happen. If you receive the same event more than once you can ignore it and assume it is the same. It is recommended that you use a store or database to track webhooks you have processed to avoid processing events more than once.

updateWebhookHeaders​

put/webhooks/{webhookId}/headers

createAccountWebhook​

Get notified of account level events such as bounce and bounce recipient.

post/webhooks

deleteAllWebhooks​

delete/webhooks

sendTestData​

post/webhooks/{webhookId}/test

getJsonSchemaForWebhookPayload​

Get JSON Schema definition for webhook payload

post/webhooks/{webhookId}/schema

getTestWebhookPayloadForWebhook​

Get example payload for webhook

post/webhooks/{webhookId}/example

verifyWebhookSignature​

Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.

post/webhooks/verify

getJsonSchemaForWebhookEvent​

Get JSON Schema definition for webhook payload by event

post/webhooks/schema

redriveWebhookResult​

Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.

post/webhooks/results/{webhookResultId}/redrive

createWebhookForPhoneNumber​

Get notified whenever a phone number receives an SMS via a WebHook URL.

post/phone/numbers/{phoneNumberId}/webhooks

getWebhooks​

get/inboxes/{inboxId}/webhooks

createWebhook​

Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

post/inboxes/{inboxId}/webhooks

getWebhook​

get/webhooks/{webhookId}

deleteWebhookById​

delete/webhooks/{webhookId}

getWebhookResults​

get/webhooks/{webhookId}/results

getTestWebhookPayload​

Get test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.

get/webhooks/test

getTestWebhookPayloadNewSms​

get/webhooks/test/new-sms-payload

getTestWebhookPayloadNewEmail​

get/webhooks/test/new-email-payload

getTestWebhookPayloadNewContact​

get/webhooks/test/new-contact-payload

getTestWebhookPayloadNewAttachment​

get/webhooks/test/new-attachment-payload

getTestWebhookPayloadEmailRead​

Get webhook test payload for email opened event

get/webhooks/test/email-read-payload

getTestWebhookPayloadEmailOpened​

Get webhook test payload for email opened event

get/webhooks/test/email-opened-payload

getTestWebhookPayloadBounceRecipient​

Get webhook test payload for bounce recipient

get/webhooks/test/email-bounce-recipient-payload

getTestWebhookPayloadBounce​

Get webhook test payload for bounce

get/webhooks/test/email-bounce-payload

getTestWebhookPayloadDeliveryStatus​

get/webhooks/test/delivery-status-payload

getAllWebhookResults​

get/webhooks/results

getWebhookResult​

get/webhooks/results/{webhookResultId}

getWebhookResultsUnseenErrorCount​

get/webhooks/results/unseen-count

getAllWebhooks​

List webhooks in paginated form. Allows for page index, page size, and sort direction.

get/webhooks/paginated

getAllAccountWebhooks​

List account webhooks in paginated form. Allows for page index, page size, and sort direction.

get/webhooks/account/paginated

getPhoneNumberWebhooksPaginated​

get/phone/numbers/{phoneId}/webhooks/paginated

getInboxWebhooksPaginated​

get/inboxes/{inboxId}/webhooks/paginated

deleteWebhook​

delete/inboxes/{inboxId}/webhooks/{webhookId}