Email REST API Documentation

Test email account generation API for MailSlurp. Rest API documentation for HTTP email clients. Get a free API Key.

MailSlurp is an email platform for developers, social teams and QA testers. Use MailSlurp's APIs with REST, SMTP, and GraphQL to create email addresses on demand and send and receive emails.

REST API resources

MailSlurp API features

MailSlurp is an email platform for developers and QA testers. IT lets you send and receive emails in a wide range of protocols and programming languages including GraphQL, SMTP, C#, Java, NodeJS, PHP, Ruby, and more.

Example use cases

You can use MailSlurp with any language using the REST API or the recommend Javascript client.

To setup the SDK create an account the run npm install --save mailslurp-client

// import mailslurp-client
const MailSlurp = require('mailslurp-client').default;
// OR import { MailSlurp } from "mailslurp-client"

// create a client
const apiKey = process.env.API_KEY ?? 'your-api-key';
const mailslurp = new MailSlurp({ apiKey });

// create an inbox
const inbox = await mailslurp.inboxController.createInbox({});

Test applications end-to-end with disposable email addresses

Send transactional email campaigns

Receive and respond to inbound SMS and emails

To wait for expected emails to arrive and read their contents use the WaitFor controller endpoints.

// first wait for an email
const email = await mailslurp.waitController.waitForLatestEmail({
  inboxId: inboxId,
  timeout: 30000,
  unreadOnly: true,

// check has attachments

// download with email controller as base64 string
const attachmentDto =
  await mailslurp.emailController.downloadAttachmentBase64({
    attachmentId: email.attachments[0]!!,

// can access content
const fileContent = new Buffer(

// can access size etc