API quick start
Sign up, get your private test address and an API key, and read your first mail with one API call.
Your test address
- Sign up with your work email, and open the link Mayfly mails you to finish.
- Find your private test domain on Overview, under Test domains, or on Settings → Domains. It looks like
a1b2c3d4e5f60718.qa.aravaltech.info. - Any address on it works the moment mail arrives, such as
signup-1@orrun42.user7@. There's nothing to create, and its mail is your workspace's alone.
An API key
An admin creates keys on Settings → API keys, with Create key. A key is shown once, so keep it in your CI's secrets. Scripts send it as Authorization: Bearer and the key.
export MAYFLY=https://mayfly.aravaltech.com
export MAYFLY_API_KEY="<your API key>"
export ADDRESS="hello-1@<your-name>.qa.aravaltech.info"Read your first mail
Run this, then make your app send a mail to that address. The call holds until the mail has arrived and Mayfly has read it, for up to 30 seconds.
curl -sS -G "$MAYFLY/api/v1/wait" \
-H "Authorization: Bearer $MAYFLY_API_KEY" \
--data-urlencode "to=$ADDRESS" \
-d timeout=30The answer is the mail, with the code and links Mayfly found in it. If nothing arrives in time, it's a 404 with the code wait_timeout.
{
"id": "0b6d7e52-3c1f-4a8e-9f2d-5c4b3a291e10",
"to": "hello-1@<your-name>.qa.aravaltech.info",
"subject": "Your verification code",
"receivedAt": "2026-11-14T09:30:12.418Z",
"parseStatus": "parsed",
"otp": { "value": "482910", "confidence": "high" },
"links": ["https://app.example.test/verify?token=made-up"],
"text": "Your verification code is 482910."
}Without since, a wait looks back 60 seconds. A test should pass since, read from Mayfly's clock before the app sends anything, so it can never pick up an older mail: every guide that follows does.
Next steps
- Playwright or Cypress: a test that types in the code.
- Any language: curl, Python and Node.
- Your own domain, webhooks and single sign-on.
- Troubleshooting, and the wait in the API reference.