# mailslurp

MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more.

# Resources

This Dart package is automatically generated by the OpenAPI Generator (opens new window) project:

  • API version: 6.5.2
  • Build package: org.openapitools.codegen.languages.DartClientCodegen

# Requirements

Dart 2.0 or later

# Installation & Usage

# Github

If this Dart package is published to Github, add the following dependency to your pubspec.yaml

    git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git

# Local

To use the package in your local drive, add the following dependency to your pubspec.yaml

    path: /path/to/mailslurp

# Tests


# Getting Started

Please follow the installation procedure and then run the following:

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = AliasControllerApi();
var createAliasOptions = CreateAliasOptions(); // CreateAliasOptions | createAliasOptions
try {
    var result = api_instance.createAlias(createAliasOptions);
} catch (e) {
    print("Exception when calling AliasControllerApi->createAlias: $e\n");

# Documentation for API Endpoints

All URIs are relative to https://api.mailslurp.com

Class Method HTTP request Description
AliasControllerApi createAlias POST /aliases Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
AliasControllerApi deleteAlias DELETE /aliases/{aliasId} Delete an email alias
AliasControllerApi getAlias GET /aliases/{aliasId} Get an email alias
AliasControllerApi getAliasEmails GET /aliases/{aliasId}/emails Get emails for an alias
AliasControllerApi getAliasThreads GET /aliases/{aliasId}/threads Get threads created for an alias
AliasControllerApi getAliases GET /aliases Get all email aliases you have created
AliasControllerApi replyToAliasEmail PUT /aliases/{aliasId}/emails/{emailId} Reply to an email
AliasControllerApi sendAliasEmail POST /aliases/{aliasId}/emails Send an email from an alias inbox
AliasControllerApi updateAlias PUT /aliases/{aliasId} Update an email alias
AttachmentControllerApi uploadAttachment POST /attachments Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
AttachmentControllerApi uploadAttachmentBytes POST /attachments/bytes Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
AttachmentControllerApi uploadMultipartForm POST /attachments/multipart Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
BulkActionsControllerApi bulkCreateInboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
BulkActionsControllerApi bulkDeleteInboxes DELETE /bulk/inboxes Bulk Delete Inboxes
BulkActionsControllerApi bulkSendEmails POST /bulk/send Bulk Send Emails
CommonActionsControllerApi createNewEmailAddress POST /createInbox Create new random inbox
CommonActionsControllerApi createNewEmailAddress1 POST /newEmailAddress Create new random inbox
CommonActionsControllerApi emptyInbox DELETE /emptyInbox Delete all emails in an inbox
CommonActionsControllerApi sendEmailSimple POST /sendEmail Send an email
ContactControllerApi createContact POST /contacts Create a contact
ContactControllerApi deleteContact DELETE /contacts/{contactId} Delete contact
ContactControllerApi getAllContacts GET /contacts/paginated Get all contacts
ContactControllerApi getContact GET /contacts/{contactId} Get contact
ContactControllerApi getContacts GET /contacts Get all contacts
DomainControllerApi addDomainWildcardCatchAll POST /domains/{id}/wildcard Add catch all wild card inbox to domain
DomainControllerApi createDomain POST /domains Create Domain
DomainControllerApi deleteDomain DELETE /domains/{id} Delete a domain
DomainControllerApi getDomain GET /domains/{id} Get a domain
DomainControllerApi getDomains GET /domains Get domains
DomainControllerApi updateDomain PUT /domains/{id} Update a domain
EmailControllerApi deleteAllEmails DELETE /emails Delete all emails
EmailControllerApi deleteEmail DELETE /emails/{emailId} Delete an email
EmailControllerApi downloadAttachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
EmailControllerApi downloadAttachmentBase64 GET /emails/{emailId}/attachments/{attachmentId}/base64 Get email attachment as base64 encoded string (alternative to binary responses)
EmailControllerApi forwardEmail POST /emails/{emailId}/forward Forward email
EmailControllerApi getAttachmentMetaData GET /emails/{emailId}/attachments/{attachmentId}/metadata Get email attachment metadata
EmailControllerApi getAttachments GET /emails/{emailId}/attachments Get all email attachment metadata
EmailControllerApi getEmail GET /emails/{emailId} Get email content
EmailControllerApi getEmailContentMatch POST /emails/{emailId}/contentMatch Get email content regex pattern match results. Runs regex against email body and returns match groups.
EmailControllerApi getEmailHTML GET /emails/{emailId}/html Get email content as HTML
EmailControllerApi getEmailHTMLQuery GET /emails/{emailId}/htmlQuery Parse and return text from an email, stripping HTML and decoding encoded characters
EmailControllerApi getEmailTextLines GET /emails/{emailId}/textLines Parse and return text from an email, stripping HTML and decoding encoded characters
EmailControllerApi getEmailsPaginated GET /emails Get all emails
EmailControllerApi getLatestEmail GET /emails/latest Get latest email
EmailControllerApi getLatestEmailInInbox GET /emails/latestIn Get latest email
EmailControllerApi getRawEmailContents GET /emails/{emailId}/raw Get raw email string
EmailControllerApi getRawEmailJson GET /emails/{emailId}/raw/json Get raw email in JSON
EmailControllerApi getUnreadEmailCount GET /emails/unreadCount Get unread email count
EmailControllerApi replyToEmail PUT /emails/{emailId} Reply to an email
EmailControllerApi validateEmail POST /emails/{emailId}/validate Validate email
ExpiredControllerApi getExpirationDefaults GET /expired/defaults Get default expiration settings
ExpiredControllerApi getExpiredInboxByInboxId GET /expired/inbox/{inboxId} Get expired inbox record for a previously existing inbox
ExpiredControllerApi getExpiredInboxRecord GET /expired/{expiredId} Get an expired inbox record
ExpiredControllerApi getExpiredInboxes GET /expired List records of expired inboxes
FormControllerApi submitForm POST /forms Submit a form to be parsed and sent as an email to an address determined by the form fields
GroupControllerApi addContactsToGroup PUT /groups/{groupId}/contacts Add contacts to a group
GroupControllerApi createGroup POST /groups Create a group
GroupControllerApi deleteGroup DELETE /groups/{groupId} Delete group
GroupControllerApi getAllGroups GET /groups/paginated Get all Contact Groups in paginated format
GroupControllerApi getGroup GET /groups/{groupId} Get group
GroupControllerApi getGroupWithContacts GET /groups/{groupId}/contacts Get group and contacts belonging to it
GroupControllerApi getGroupWithContactsPaginated GET /groups/{groupId}/contacts-paginated Get group and paginated contacts belonging to it
GroupControllerApi getGroups GET /groups Get all groups
GroupControllerApi removeContactsFromGroup DELETE /groups/{groupId}/contacts Remove contacts from a group
InboxControllerApi createInbox POST /inboxes Create an Inbox (email address)
InboxControllerApi createInboxWithOptions POST /inboxes/withOptions Create an inbox with additional options
InboxControllerApi deleteAllInboxes DELETE /inboxes Delete all inboxes
InboxControllerApi deleteInbox DELETE /inboxes/{inboxId} Delete inbox
InboxControllerApi getAllInboxes GET /inboxes/paginated List All Inboxes Paginated
InboxControllerApi getEmails GET /inboxes/{inboxId}/emails Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.
InboxControllerApi getInbox GET /inboxes/{inboxId} Get Inbox
InboxControllerApi getInboxEmailsPaginated GET /inboxes/{inboxId}/emails/paginated Get inbox emails paginated
InboxControllerApi getInboxSentEmails GET /inboxes/{inboxId}/sent Get Inbox Sent Emails
InboxControllerApi getInboxTags GET /inboxes/tags Get inbox tags
InboxControllerApi getInboxes GET /inboxes List Inboxes / Email Addresses
InboxControllerApi sendEmail POST /inboxes/{inboxId} Send Email
InboxControllerApi sendEmailAndConfirm POST /inboxes/{inboxId}/confirm Send email and return sent confirmation
InboxControllerApi setInboxFavourited PUT /inboxes/{inboxId}/favourite Set inbox favourited state
InboxControllerApi updateInbox PATCH /inboxes/{inboxId} Update Inbox
MailServerControllerApi describeMailServerDomain POST /mail-server/describe/domain Get DNS Mail Server records for a domain
MailServerControllerApi getDnsLookup POST /mail-server/describe/dns-lookup Lookup DNS records for a domain
MailServerControllerApi getIpAddress POST /mail-server/describe/ip-address Get IP address for a domain
MailServerControllerApi verifyEmailAddress POST /mail-server/verify/email-address Verify the existence of an email address at a given mail server.
SentEmailsControllerApi getSentEmail GET /sent/{id} Get sent email receipt
SentEmailsControllerApi getSentEmails GET /sent Get all sent emails in paginated form
TemplateControllerApi createTemplate POST /templates Create a Template
TemplateControllerApi deleteTemplate DELETE /templates/{TemplateId} Delete Template
TemplateControllerApi getAllTemplates GET /templates/paginated Get all Templates in paginated format
TemplateControllerApi getTemplate GET /templates/{TemplateId} Get Template
TemplateControllerApi getTemplates GET /templates Get all Templates
WaitForControllerApi waitFor POST /waitFor Wait for conditions to be met
WaitForControllerApi waitForEmailCount GET /waitForEmailCount Wait for and return count number of emails
WaitForControllerApi waitForLatestEmail GET /waitForLatestEmail Fetch inbox's latest email or if empty wait for an email to arrive
WaitForControllerApi waitForMatchingEmail POST /waitForMatchingEmails Wait or return list of emails that match simple matching patterns
WaitForControllerApi waitForMatchingFirstEmail POST /waitForMatchingFirstEmail Wait for or return the first email that matches proved MatchOptions array
WaitForControllerApi waitForNthEmail GET /waitForNthEmail Wait for or fetch the email with a given index in the inbox specified
WebhookControllerApi createWebhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
WebhookControllerApi deleteWebhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a Webhook for an Inbox
WebhookControllerApi getAllWebhooks GET /webhooks/paginated List Webhooks Paginated
WebhookControllerApi getWebhook GET /webhooks/{webhookId} Get a webhook for an Inbox
WebhookControllerApi getWebhooks GET /inboxes/{inboxId}/webhooks Get all Webhooks for an Inbox
WebhookControllerApi sendTestData POST /webhooks/{webhookId}/test Send webhook test data

# Documentation For Models

# Documentation For Authorization


  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

# Author