API Key (how to configure MailSlurp)

Use your api access token to call the MailSlurp API and control your inboxes remotely.

The MailSlurp email inbox API is free for personal use but requires an API KEY to be used. This page explains to get an API KEY and how to configure HTTP requests or SDK clients to use the MailSlurp API.

Create an account


First create an account or sign into your dashboard.

Find API Key in the dashboard

You will see the API key displayed on the home page once logged in.

api key

Using your API Key

Configure SDK clients to use your API Key so that you can use MailSlurp programmatically via REST API or developer SDKs. For SMTP and IMAP access see the mailserver guide.

Configure HTTP requests

To configure HTTP client pass an x-key header with the value set to your API key.

curl -H x-api-key:YOUR_API_KEY -X POST https://api.mailslurp.com/inboxes

Configure SDK Clients

See the documentation for each client or use the example below to configure the NodeJS package:

const apiKey = process.env.API_KEY ?? 'your-apikey';
const { MailSlurp } = require('mailslurp-client');
const mailslurp = new MailSlurp({ apiKey });