An email API built for tests
Give every test run its own fresh inbox. Spin one up, read the OTP your app just sent, and move on — no shared mailboxes, no flaky polling.
Python & JS SDKs
pip install mailflat or npm i @mailflat/sdk — typed clients over a clean REST API.
One inbox per test
Create a fresh address per run so tests never share mailbox state.
OTP in one line
wait_for_otp() polls and returns the code — no manual IMAP wiring.
from mailflat import MailFlat mf = MailFlat(api_key)inbox = mf.create(label="signup-test")app.register(email=inbox.address)otp = inbox.wait_for_otp(timeout=30)assert app.verify(otp)Frequently asked questions
Which languages are supported?
Official Python (pip install mailflat) and JavaScript/TypeScript (npm i @mailflat/sdk) SDKs, plus a plain REST API.
Can each test get its own inbox?
Yes — create a fresh address per test run; messages auto-purge so nothing leaks between runs.
How do I read the verification code?
Call wait_for_otp(); it polls the inbox and returns the code once it arrives.
Related
Ready to try it?
Get an API keyMailFlat — instant email inboxes for testing, automation & AI agents.