# Playwright temporary email API: full E2E auth flow testing

Humanless is a temporary email API built for this: one call creates an inbox, your Playwright test signs up with it, and a long-poll wait returns the verification code or magic link as soon as the email lands. One identity can cover the whole auth flow: signup confirmation, login by code or link, password reset, and TOTP 2FA if you add the `totp` channel. Create one identity per test, so parallel workers and retries never share mail, and wrap the test in `withIdentity` so the inbox is deleted even when the test fails. Pay as you go costs $0.06 per identity plus $0.75 per 1,000 emails from prepaid credits (from $10); plans start at $17/month for 10 identities active at once and 10,000 emails a month ([pricing](/pricing.md)). Pay-as-you-go accounts can create 30 identities per hour, so for larger suites reuse an identity across a spec or save the login state.

```ts auth-flow.spec.ts
await withIdentity(hl, { channels: ["email", "totp"] }, async ({ identity_id, email, totp_secret }) => {
  let since = Date.now();
  await signUp(page, email!);                       // your page helper
  const { url } = await hl.waitForLink({ identityId: identity_id, since, timeout: 25 });
  await page.goto(url);
  await enrollTotp(page, totp_secret!);             // if your app accepts a user-supplied key
  since = Date.now();
  await requestPasswordReset(page, email!);
  const reset = await hl.waitForLink({ identityId: identity_id, since, timeout: 25 });
  await page.goto(reset.url);
});
```

## Other options

- **Mail.tm**: a free public temporary-mail API. Fine for experiments, but shared domains and rate limits make it a poor fit for CI.
- **Mailosaur, MailSlurp, testmail.app**: hosted inbox APIs (free tiers or trials, paid plans) with Playwright examples.
- **Mailpit**: free and local, when your app's SMTP can point at it.

> **Use policy:** Only for apps you own or are authorized to test. See the [Terms](/terms).

More: [Humanless Playwright guide](/docs/playwright) · [All answers](/answers/)

Last updated 2026-12-04

Canonical: https://usehumanless.com/answers/playwright-temporary-email-api-full-e2e-auth-flow-testing

---
More: https://usehumanless.com/llms.txt
