MailSlurp REST API
API documentation.
Swagger UISetup​
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
- Operation
- Request
- Response
get/aliases/{aliasId}
updateAlias​
- Operation
- Request
- Response
put/aliases/{aliasId}
deleteAlias​
- Operation
- Request
- Response
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
.
- Operation
- Request
- Response
put/aliases/{aliasId}/emails/{emailId}
getAliases​
Get all email aliases in paginated form
- Operation
- Request
- Response
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
- Operation
- Request
- Response
post/aliases
getAliasEmails​
Get paginated emails for an alias by ID
- Operation
- Request
- Response
get/aliases/{aliasId}/emails
sendAliasEmail​
Send an email from an alias. Replies to the email will be forwarded to the alias masked email address
- Operation
- Request
- Response
post/aliases/{aliasId}/emails
getAliasThreads​
Returns threads created for an email alias in paginated form
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
get/attachments
uploadAttachment​
- Operation
- Request
- Response
post/attachments
deleteAllAttachments​
- Operation
- Request
- Response
delete/attachments
uploadMultipartForm​
- Operation
- Request
- Response
post/attachments/multipart
uploadAttachmentBytes​
- Operation
- Request
- Response
post/attachments/bytes
getAttachment​
- Operation
- Request
- Response
get/attachments/{attachmentId}
deleteAttachment​
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
get/bounce/recipients
getBouncedRecipient​
Bounced emails are email you have sent that were rejected by a recipient
- Operation
- Request
- Response
get/bounce/recipients/{id}
getListUnsubscribeRecipients​
Unsubscribed recipient have unsubscribed from a mailing list for a user or domain and cannot be contacted again.
- Operation
- Request
- Response
get/bounce/list-unsubscribe-recipients
getBouncedEmails​
Bounced emails are email you have sent that were rejected by a recipient
- Operation
- Request
- Response
get/bounce/emails
getBouncedEmail​
Bounced emails are email you have sent that were rejected by a recipient
- Operation
- Request
- Response
get/bounce/emails/{id}
getComplaints​
SMTP complaints made against your account
- Operation
- Request
- Response
get/bounce/complaints
BulkActionsController​
Other endpoints including advanced receive options
bulkSendEmails​
- Operation
- Request
- Response
post/bulk/send
bulkCreateInboxes​
- Operation
- Request
- Response
post/bulk/inboxes
bulkDeleteInboxes​
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/sendEmail
createNewEmailAddress​
Returns an Inbox with an id
and an emailAddress
- Operation
- Request
- Response
post/newEmailAddress
createRandomInbox​
Returns an Inbox with an id
and an emailAddress
- Operation
- Request
- Response
post/createInbox
emptyInbox​
Deletes all emails
- Operation
- Request
- Response
delete/emptyInbox
deleteEmailAddress​
Deletes inbox email address
- Operation
- Request
- Response
delete/deleteEmailAddress
ContactController​
Endpoints for managing contacts. Contacts can be used for sending emails to individuals and groups.
getContacts​
- Operation
- Request
- Response
get/contacts
createContact​
- Operation
- Request
- Response
post/contacts
getContact​
- Operation
- Request
- Response
get/contacts/{contactId}
deleteContact​
- Operation
- Request
- Response
delete/contacts/{contactId}
getContactVCard​
- Operation
- Request
- Response
get/contacts/{contactId}/download
getAllContacts​
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
put/domains/{id}
deleteDomain​
Delete a domain. This will disable any existing inboxes that use this domain.
- Operation
- Request
- Response
delete/domains/{id}
getDomains​
List all custom domains you have created
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/domains
getDomainWildcardCatchAllInbox​
Get the catch all inbox for a domain for missed emails
- Operation
- Request
- Response
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
- Operation
- Request
- Response
post/domains/{id}/wildcard
getDomainIssues​
List domain issues for domains you have created
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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
.
- Operation
- Request
- Response
put/emails/{emailId}
deleteEmail​
Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/emails
deleteAllEmails​
Deletes all emails in your account. Be careful as emails cannot be recovered
- Operation
- Request
- Response
delete/emails
validateEmail​
Validate the HTML content of email if HTML is found. Considered valid if no HTML is present.
- Operation
- Request
- Response
post/emails/{emailId}/validate
applyImapFlagOperation​
Apply RFC3501 section-2.3.2 IMAP flag operations on an email
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/emails/{emailId}/raw/json
getEmailLinks​
HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
get/emails/{emailId}/html/json
downloadBody​
Returns the specified email body for a given email as a string
- Operation
- Request
- Response
get/emails/{emailId}/body
downloadBodyBytes​
Returns the specified email body for a given email as a stream / array of bytes.
- Operation
- Request
- Response
get/emails/{emailId}/body-bytes
getEmailAttachments​
Returns an array of attachment metadata such as name and content-type for a given email if present.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
get/emails/{emailId}/attachments/{attachmentId}
getAttachmentMetaData​
Returns the metadata such as name and content-type for a given attachment and email.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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
- Operation
- Request
- 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
- Operation
- Request
- Response
get/emails/organization
getLatestEmail​
Get the newest email in all inboxes or in a passed set of inbox IDs
- Operation
- Request
- Response
get/emails/latest
getLatestEmailInInbox_1​
Get the newest email in all inboxes or in a passed set of inbox IDs
- Operation
- Request
- Response
get/emails/latestIn
getGravatarUrlForEmailAddress​
Get gravatar url for email address
- Operation
- Request
- Response
get/emails/gravatarFor
getEmailCount​
- Operation
- Request
- Response
get/emails/emails/count
EmailVerificationController​
validateEmailAddressList​
- Operation
- Request
- Response
post/email-verification/email-address-list
getValidationRequests​
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/expired/inbox/{inboxId}
getExpirationDefaults​
Return default times used for inbox expiration
- Operation
- Request
- Response
get/expired/defaults
ExportController​
Endpoints for exporting user data to CSV, XML and other formats.
exportEntities​
- Operation
- Request
- Response
get/export
getExportLink​
- Operation
- Request
- Response
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">
.
- Operation
- Request
- Response
post/forms
GroupController​
Endpoints for managing groups. Groups can be used for sending emails to individuals and groups.
getGroupWithContacts​
- Operation
- Request
- Response
get/groups/{groupId}/contacts
addContactsToGroup​
- Operation
- Request
- Response
put/groups/{groupId}/contacts
removeContactsFromGroup​
- Operation
- Request
- Response
delete/groups/{groupId}/contacts
getGroups​
- Operation
- Request
- Response
get/groups
createGroup​
- Operation
- Request
- Response
post/groups
getGroup​
- Operation
- Request
- Response
get/groups/{groupId}
deleteGroup​
- Operation
- Request
- Response
delete/groups/{groupId}
getGroupWithContactsPaginated​
Get group and paginated contacts belonging to it
- Operation
- Request
- Response
get/groups/{groupId}/contacts-paginated
getAllGroups​
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
delete/inboxes
getInbox​
Returns an inbox's properties, including its email address and ID.
- Operation
- Request
- Response
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
.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
delete/inboxes/{inboxId}
updateInbox​
Update editable fields on an inbox
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/inboxes/{inboxId}/with-queue
sendSmtpEnvelope​
Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY.
- Operation
- Request
- Response
post/inboxes/{inboxId}/smtp-envelope
sendTestEmail​
Send an inbox a test email to test email receiving is working
- Operation
- Request
- Response
post/inboxes/{inboxId}/send-test-email
listInboxRulesets​
List all rulesets attached to an inbox
- Operation
- Request
- Response
get/inboxes/{inboxId}/rulesets
createInboxRuleset​
Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/inboxes/withOptions
createInboxWithDefaults​
- Operation
- Request
- Response
post/inboxes/withDefaults
listInboxTrackingPixels​
List all tracking pixels sent from an inbox
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
get/inboxes/{inboxId}/sent
getScheduledJobsByInboxId​
Schedule sending of emails using scheduled jobs.
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/inboxes/{inboxId}/emails
getInboxEmailsPaginated​
Get a paginated list of emails in an inbox. Does not hold connections open.
- Operation
- Request
- Response
get/inboxes/{inboxId}/emails/paginated
getInboxEmailCount​
- Operation
- Request
- Response
get/inboxes/{inboxId}/emails/count
getDeliveryStatusesByInboxId​
Get all email delivery statuses for an inbox
- Operation
- Request
- Response
get/inboxes/{inboxId}/delivery-status
getInboxTags​
Get all inbox tags
- Operation
- Request
- Response
get/inboxes/tags
getAllScheduledJobs​
Schedule sending of emails using scheduled jobs. These can be inbox or account level.
- Operation
- Request
- Response
get/inboxes/scheduled-jobs
getScheduledJob​
Get a scheduled email job details.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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).
- Operation
- Request
- Response
get/inboxes/organization
getImapSmtpAccess​
Get IMAP and SMTP access usernames and passwords
- Operation
- Request
- Response
get/inboxes/imap-smtp-access
getInboxIds​
Get list of inbox IDs
- Operation
- Request
- Response
get/inboxes/ids
getLatestEmailInInbox​
Get the newest email in an inbox or wait for one to arrive
- Operation
- Request
- Response
get/inboxes/getLatestEmail
doesInboxExist​
Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses
- Operation
- Request
- Response
get/inboxes/exists
getInboxCount​
- Operation
- Request
- Response
get/inboxes/count
getInboxByName​
Get a inbox result by name
- Operation
- Request
- Response
get/inboxes/byName
getInboxByEmailAddress​
Get a inbox result by email address
- Operation
- Request
- Response
get/inboxes/byEmailAddress
deleteAllInboxEmails​
Deletes all emails in an inbox. Be careful as emails cannot be recovered
- Operation
- Request
- Response
delete/inboxes/{inboxId}/deleteAllInboxEmails
flushExpired​
Remove any expired inboxes for your account (instead of waiting for scheduled removal on server)
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/forwarders
testInboxForwardersForInbox​
Test inbox forwarders for inbox
- Operation
- Request
- Response
put/forwarders
createNewInboxForwarder​
Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
- Operation
- Request
- Response
post/forwarders
deleteInboxForwarders​
Delete inbox forwarders. Accepts optional inboxId filter.
- Operation
- Request
- Response
delete/forwarders
testNewInboxForwarder​
Test new inbox forwarder
- Operation
- Request
- Response
patch/forwarders
getInboxForwarder​
Get inbox ruleset
- Operation
- Request
- Response
get/forwarders/{id}
updateInboxForwarder​
Update inbox ruleset
- Operation
- Request
- Response
put/forwarders/{id}
deleteInboxForwarder​
Delete inbox forwarder
- Operation
- Request
- Response
delete/forwarders/{id}
testInboxForwarder​
Test an inbox forwarder
- Operation
- Request
- Response
post/forwarders/{id}/test
getInboxForwarderEvents​
Get inbox ruleset events
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/repliers/{id}
updateInboxReplier​
Update inbox ruleset
- Operation
- Request
- Response
put/repliers/{id}
deleteInboxReplier​
Delete inbox replier
- Operation
- Request
- Response
delete/repliers/{id}
getInboxRepliers​
List all repliers attached to an inbox
- Operation
- Request
- Response
get/repliers
createNewInboxReplier​
Create a new inbox rule for reply toing, blocking, and allowing emails when sending and receiving
- Operation
- Request
- Response
post/repliers
deleteInboxRepliers​
Delete inbox repliers. Accepts optional inboxId filter.
- Operation
- Request
- Response
delete/repliers
getInboxReplierEvents​
Get inbox ruleset events
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/rulesets
testInboxRulesetsForInbox​
Test inbox rulesets for inbox
- Operation
- Request
- Response
put/rulesets
createNewInboxRuleset​
Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
- Operation
- Request
- Response
post/rulesets
deleteInboxRulesets​
Delete inbox rulesets. Accepts optional inboxId filter.
- Operation
- Request
- Response
delete/rulesets
testNewInboxRuleset​
Test new inbox ruleset
- Operation
- Request
- Response
patch/rulesets
testInboxRuleset​
Test an inbox ruleset
- Operation
- Request
- Response
post/rulesets/{id}/test
getInboxRuleset​
Get inbox ruleset
- Operation
- Request
- Response
get/rulesets/{id}
deleteInboxRuleset​
Delete inbox ruleset
- Operation
- Request
- Response
delete/rulesets/{id}
MailServerController​
verifyEmailAddress​
- Operation
- Request
- Response
post/mail-server/verify/email-address
getIpAddress​
- Operation
- Request
- Response
post/mail-server/describe/ip-address
describeMailServerDomain​
- Operation
- Request
- Response
post/mail-server/describe/domain
getDnsLookup​
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/missed-emails/restore
getAllMissedEmails​
- Operation
- Request
- Response
get/missed-emails
getMissedEmail​
List emails that were missed due to plan limits.
- Operation
- Request
- Response
get/missed-emails/{missedEmailId}
waitForNthMissedEmail​
Wait for 0 based index missed email
- Operation
- Request
- Response
get/missed-emails/waitForNthMissedEmail
getAllUnknownMissedEmails​
Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox.
- Operation
- Request
- Response
get/missed-emails/unknown
PhoneController​
Endpoints for managing phone numbers and addresses
testPhoneNumberSendSms​
- Operation
- Request
- Response
post/phone/numbers/{phoneNumberId}/test
getEmergencyAddresses​
- Operation
- Request
- Response
get/phone/emergency-addresses
createEmergencyAddress​
- Operation
- Request
- Response
post/phone/emergency-addresses
getPhonePlans​
- Operation
- Request
- Response
get/phone/plans
getPhoneNumbers​
- Operation
- Request
- Response
get/phone/numbers
getPhoneNumber​
- Operation
- Request
- Response
get/phone/numbers/{phoneNumberId}
deletePhoneNumber​
- Operation
- Request
- Response
delete/phone/numbers/{phoneNumberId}
getEmergencyAddress​
- Operation
- Request
- Response
get/phone/emergency-addresses/{addressId}
deleteEmergencyAddress​
- Operation
- Request
- Response
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​
- Operation
- Request
- Response
get/sent
deleteAllSentEmails​
- Operation
- Request
- Response
delete/sent
getSentDeliveryStatusesBySentId​
Get all sent email delivery statuses
- Operation
- Request
- Response
get/sent/{sentId}/delivery-status
getSentEmail​
- Operation
- Request
- Response
get/sent/{id}
deleteSentEmail​
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
get/sent/{id}/urls
getSentEmailTrackingPixels​
Get all tracking pixels for a sent email in paginated form
- Operation
- Request
- Response
get/sent/{id}/tracking-pixels
getSentEmailHTMLContent​
- Operation
- Request
- Response
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
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/sent/{emailId}/raw/json
getAllSentTrackingPixels​
Get all sent email tracking pixels in paginated form
- Operation
- Request
- Response
get/sent/tracking-pixels
getSentEmailsWithQueueResults​
- Operation
- Request
- Response
get/sent/queue-results
getSentOrganizationEmails​
Get all sent organization emails in paginated form
- Operation
- Request
- Response
get/sent/organization
getSentDeliveryStatuses​
Get all sent email delivery statuses
- Operation
- Request
- Response
get/sent/delivery-status
getSentDeliveryStatus​
Get a sent email delivery status
- Operation
- Request
- Response
get/sent/delivery-status/{deliveryId}
waitForDeliveryStatuses​
Wait for delivery statuses
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/sms
deleteSmsMessages​
Delete all SMS messages or all messages for a given phone number
- Operation
- Request
- Response
delete/sms
getSmsMessage​
Returns a SMS summary object with content.
- Operation
- Request
- Response
get/sms/{smsId}
deleteSmsMessage​
Delete an SMS message
- Operation
- Request
- Response
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
- Operation
- Request
- Response
get/templates/{templateId}
updateTemplate​
Update email template
- Operation
- Request
- Response
put/templates/{templateId}
deleteTemplate​
Delete template
- Operation
- Request
- Response
delete/templates/{templateId}
getTemplates​
Get all templates
- Operation
- Request
- Response
get/templates
createTemplate​
Create an email template with variables for use with templated transactional emails.
- Operation
- Request
- Response
post/templates
getTemplatePreviewJson​
Get email template preview with passed template variables in JSON format. Pass template variables as query params.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
get/templates/{templateId}/preview/html
getAllTemplates​
Get all templates in paginated format
- Operation
- Request
- Response
get/templates/paginated
TrackingController​
Endpoints for managing tracking entities such as email open and read tracking pixels.
getAllTrackingPixels​
List tracking pixels in paginated form
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/tracking/pixels
getTrackingPixel​
- Operation
- Request
- Response
get/tracking/pixels/{id}
UserController​
getJsonPropertyAsString​
Utility function to extract properties from JSON objects in language where this is cumbersome.
- Operation
- Request
- Response
post/user/json/pluck
getUserInfo​
Get account information for your user
- Operation
- Request
- Response
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
- Operation
- Request
- Response
post/waitFor
waitForSms​
Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/waitForMatchingEmails
waitForLatestSms​
Wait until a phone number meets given conditions or return immediately if already met
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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
.
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
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​
- Operation
- Request
- Response
put/webhooks/{webhookId}/headers
createAccountWebhook​
Get notified of account level events such as bounce and bounce recipient.
- Operation
- Request
- Response
post/webhooks
deleteAllWebhooks​
- Operation
- Request
- Response
delete/webhooks
sendTestData​
- Operation
- Request
- Response
post/webhooks/{webhookId}/test
getJsonSchemaForWebhookPayload​
Get JSON Schema definition for webhook payload
- Operation
- Request
- Response
post/webhooks/{webhookId}/schema
getTestWebhookPayloadForWebhook​
Get example payload for webhook
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/webhooks/verify
getJsonSchemaForWebhookEvent​
Get JSON Schema definition for webhook payload by event
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/webhooks/results/{webhookResultId}/redrive
createWebhookForPhoneNumber​
Get notified whenever a phone number receives an SMS via a WebHook URL.
- Operation
- Request
- Response
post/phone/numbers/{phoneNumberId}/webhooks
getWebhooks​
- Operation
- Request
- Response
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.
- Operation
- Request
- Response
post/inboxes/{inboxId}/webhooks
getWebhook​
- Operation
- Request
- Response
get/webhooks/{webhookId}
deleteWebhookById​
- Operation
- Request
- Response
delete/webhooks/{webhookId}
getWebhookResults​
- Operation
- Request
- Response
get/webhooks/{webhookId}/results
getTestWebhookPayload​
Get test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED
as default.
- Operation
- Request
- Response
get/webhooks/test
getTestWebhookPayloadNewSms​
- Operation
- Request
- Response
get/webhooks/test/new-sms-payload
getTestWebhookPayloadNewEmail​
- Operation
- Request
- Response
get/webhooks/test/new-email-payload
getTestWebhookPayloadNewContact​
- Operation
- Request
- Response
get/webhooks/test/new-contact-payload
getTestWebhookPayloadNewAttachment​
- Operation
- Request
- Response
get/webhooks/test/new-attachment-payload
getTestWebhookPayloadEmailRead​
Get webhook test payload for email opened event
- Operation
- Request
- Response
get/webhooks/test/email-read-payload
getTestWebhookPayloadEmailOpened​
Get webhook test payload for email opened event
- Operation
- Request
- Response
get/webhooks/test/email-opened-payload
getTestWebhookPayloadBounceRecipient​
Get webhook test payload for bounce recipient
- Operation
- Request
- Response
get/webhooks/test/email-bounce-recipient-payload
getTestWebhookPayloadBounce​
Get webhook test payload for bounce
- Operation
- Request
- Response
get/webhooks/test/email-bounce-payload
getTestWebhookPayloadDeliveryStatus​
- Operation
- Request
- Response
get/webhooks/test/delivery-status-payload
getAllWebhookResults​
- Operation
- Request
- Response
get/webhooks/results
getWebhookResult​
- Operation
- Request
- Response
get/webhooks/results/{webhookResultId}
getWebhookResultsUnseenErrorCount​
- Operation
- Request
- Response
get/webhooks/results/unseen-count
getAllWebhooks​
List webhooks in paginated form. Allows for page index, page size, and sort direction.
- Operation
- Request
- Response
get/webhooks/paginated
getAllAccountWebhooks​
List account webhooks in paginated form. Allows for page index, page size, and sort direction.
- Operation
- Request
- Response
get/webhooks/account/paginated
getPhoneNumberWebhooksPaginated​
- Operation
- Request
- Response
get/phone/numbers/{phoneId}/webhooks/paginated
getInboxWebhooksPaginated​
- Operation
- Request
- Response
get/inboxes/{inboxId}/webhooks/paginated
deleteWebhook​
- Operation
- Request
- Response
delete/inboxes/{inboxId}/webhooks/{webhookId}