Quickstart
Send, retrieve, and inspect a message in just a few requests.
1. Create or route a message
For a quick local test, create a message directly through the API:
curl -X POST https://api.mailtestapi.com/v1/emails \
-H "Authorization: Bearer $MAILTEST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipient": "signup-check@mailtestapi.com",
"sender": "sender@example.com",
"subject": "Welcome aboard",
"text": "Hello from MailtestAPI"
}'In production-style testing, send a real email to an address routed through your Cloudflare worker instead.
2. Poll for the message
curl "https://api.mailtestapi.com/v1/emails?recipient=signup-check@mailtestapi.com&limit=10" \
-H "Authorization: Bearer $MAILTEST_API_KEY"3. Fetch full message detail
curl "https://api.mailtestapi.com/v1/emails/<email-id>" \
-H "Authorization: Bearer $MAILTEST_API_KEY"This returns the stored body object with:
- raw source
- parsed text
- parsed HTML
- normalized headers
- attachment metadata
4. Review visually in the dashboard
Open app.mailtestapi.com and inspect the same email record through the dashboard UI.