Python Documentation

Create real email addresses in Python. Send and receive emails in Django, Flask, or any Python context.


For documentation see developer guide. Create an account in the MailSlurp Dashboard to view your API Key. For all bugs, feature requests, or help please see support.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.1-alpha
  • Package version: 5.2.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit


Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+

(you may need to run pip with root permission: sudo pip install git+

Then import the package:

import mailslurp_client 


Install via Setuptools.

python install --user

(or sudo python install to install the package for all users)

Then import the package:

import mailslurp_client

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import mailslurp_client
from import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.CommonOperationsApi(mailslurp_client.ApiClient(configuration))

    # Create new email address
    api_response = api_instance.create_new_email_address()
except ApiException as e:
    print("Exception when calling CommonOperationsApi->create_new_email_address: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to

Class Method HTTP request Description
CommonOperationsApi create_new_email_address POST /newEmailAddress Create new email address
CommonOperationsApi delete_email DELETE /deleteEmail Delete an email
CommonOperationsApi delete_email_address DELETE /deleteEmailAddress Delete email address and its emails
CommonOperationsApi empty_inbox DELETE /emptyInbox Delete all emails in an inbox
CommonOperationsApi send_email_simple POST /sendEmail Send an email from a random email address
CommonOperationsApi wait_for_email_count GET /waitForEmailCount Wait for and return count number of emails
CommonOperationsApi wait_for_latest_email GET /waitForLatestEmail Fetch inbox's latest email or if empty wait for email to arrive
CommonOperationsApi wait_for_matching_email POST /waitForMatchingEmails Wait or return list of emails that match simple matching patterns
CommonOperationsApi wait_for_nth_email GET /waitForNthEmail Wait for or fetch the email with a given index in the inbox specified
ExtraOperationsApi bulk_create_inboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
ExtraOperationsApi bulk_delete_inboxes DELETE /bulk/inboxes Bulk Delete Inboxes
ExtraOperationsApi bulk_send_emails POST /bulk/send Bulk Send Emails
ExtraOperationsApi create_domain POST /domains Create Domain
ExtraOperationsApi create_inbox POST /inboxes Create an Inbox (email address)
ExtraOperationsApi create_webhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
ExtraOperationsApi delete_domain DELETE /domains/{id} Delete a domain
ExtraOperationsApi delete_email1 DELETE /emails/{emailId} Delete Email
ExtraOperationsApi delete_inbox DELETE /inboxes/{inboxId} Delete Inbox / Email Address
ExtraOperationsApi delete_webhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a WebHook for an Inbox
ExtraOperationsApi download_attachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment
ExtraOperationsApi forward_email POST /emails/{emailId}/forward Forward Email
ExtraOperationsApi get_domain GET /domains/{id} Get a domain
ExtraOperationsApi get_domains GET /domains Get domains
ExtraOperationsApi get_email GET /emails/{emailId} Get Email Content
ExtraOperationsApi get_emails GET /inboxes/{inboxId}/emails List Emails in an Inbox / EmailAddress
ExtraOperationsApi get_emails_paginated GET /emails Get all emails
ExtraOperationsApi get_inbox GET /inboxes/{inboxId} Get Inbox / EmailAddress
ExtraOperationsApi get_inboxes GET /inboxes List Inboxes / Email Addresses
ExtraOperationsApi get_raw_email_contents GET /emails/{emailId}/raw Get Raw Email Content
ExtraOperationsApi get_webhooks GET /inboxes/{inboxId}/webhooks Get all WebHooks for an Inbox
ExtraOperationsApi send_email POST /inboxes/{inboxId} Send Email
ExtraOperationsApi upload_attachment POST /attachments Upload an attachment for sending
ExtraOperationsApi upload_multipart_form POST /attachments/multipart Upload an attachment for sending using Multipart Form

Documentation For Models

Documentation For Authorization


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