Documentation

mailQA captures the email your application sends and lets you read and assert on it — from a test suite, from curl, or from the dashboard. Nothing is ever delivered to a real person.

These pages cover the REST API and the JavaScript/TypeScript client. Start with the quickstart if you are wiring mailQA into a suite for the first time.

The shape of it

Open the same inbox on every run, point your app at it — through your SMTP credentials or over its public address — and wait for the message instead of sleeping.

import { MailQA } from '@mailqa/client';

const mailqa = new MailQA({ apiKey: process.env.MAILQA_API_KEY! });

// Creating is idempotent — the same name is the same inbox, at a
// stable address you can hardcode. `empty` clears what the last
// run left, so the wait below cannot match a stale message.
const inbox = await mailqa.inboxes.create({
  name: 'signup-flow',
  empty: true,
});

await registerUser(inbox.address);

const message = await mailqa.waitForMessage({
  inbox: inbox.id,
  subjectContains: 'Verify your email',
});

expect(message.codes[0]).toMatch(/^\d{6}$/);

The API reference is generated from the same contracts the server validates against, so it cannot drift from what the endpoints actually accept. Every endpoint carries a @mailqa/client sample beside the curl one. If you would rather have the document itself — to generate a client, or to load into Postman — it is at /openapi.json.