Development / API
8 min read

Disposable Email API for Developers: Automated QA Testing

Ready to stop verifying standard login flows manually? Discover how integrating our Developer API can supercharge your Cypress, Playwright, or Selenium workflows through programmatic email verification.

End-to-end (E2E) testing often hits a wall when it comes to email validation. You're building a user registration flow, and your automated test needs to confirm a magic link or 2FA code. Using static test accounts causes state conflicts, and relying on manual testers scales poorly. What you need is an API that spins up clean inboxes instantly.

Why Devs Need an Email API

Cypress & Playwright Integration

Automate signup flows by calling our API in your test setup. Fetch verification codes seamlessly within your CI/CD pipeline.

Dedicated API Keys

Generate specific sk_live_... keys directly from your dashboard for different testing environments. Revoke them anytime.

Blazing Fast Creation

Issue a POST request and receive a fully functional inbox in milliseconds, removing test bottlenecks.

Programmatic Read Access

Fetch raw HTML or parse JSON to assert that emails are rendering correctly and that links are valid inside your app.

The Programmatic Testing Workflow

Instead of jumping between tabs, the developer journey is now fully contained in your code.

1

Setup Phase: Your test script sends an API request to generate a temporary email address.

2

Execution Phase: Cypress uses the address to sign up via your application's UI.

3

Validation Phase: The test queries the inbox via API, retrieves the verification link, and completes registration.

Real-World Example: Cypress Integration

To illustrate how powerful this is, let's look at a common Cypress test checking a password reset flow. Instead of attempting to log into a real Gmail account (and dealing with CAPTCHAs or 2FA), you simply call the API.

// cypress/e2e/reset-password.cy.js

describe('Password Reset', () => {
  it('should send a reset link to the user', () => {
    // 1. Generate a temporary email from the API
    cy.request({
      method: 'POST',
      url: 'https://tempmail.com.au/api/v1/inboxes',
      headers: { Authorization: `Bearer ${Cypress.env('TEMP_MAIL_API_KEY')}` }
    }).then((response) => {
      const emailAddress = response.body.address;

      // 2. Trigger the reset password flow
      cy.visit('/forgot-password');
      cy.get('input[type="email"]').type(emailAddress);
      cy.get('button[type="submit"]').click();

      // 3. Poll the inbox for the incoming reset email
      cy.wait(3000); // Wait for email delivery
      cy.request({
        method: 'GET',
        url: `https://tempmail.com.au/api/v1/inboxes/${emailAddress}/messages`,
        headers: { Authorization: `Bearer ${Cypress.env('TEMP_MAIL_API_KEY')}` }
      }).then((msgResponse) => {
        expect(msgResponse.body.messages.length).to.be.greaterThan(0);
        
        // 4. Extract verification link and complete test
        const resetLink = extractLinkFromHtml(msgResponse.body.messages[0].html);
        cy.visit(resetLink);
        cy.get('input[name="newPassword"]').type('NewSecurePassword123!');
        cy.get('button[type="submit"]').click();
        
        cy.contains('Password successfully reset');
      });
    });
  });
});

This script executes entirely in the background, creating a new address and checking its messages programmatically. Your test suites run faster, more consistently, and won't suddenly fail due to security heuristics on major email providers.

Quick Start Guide: Interacting with the API

All endpoints are prefixed with /api/v1. Add your API key issued from the dashboard.

1. Create a Temp Inbox

curl -X POST https://tempmail.com.au/api/v1/inboxes \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

2. Check Messages

curl -X GET https://tempmail.com.au/api/v1/inboxes/{address}/messages \
  -H "Authorization: Bearer ${YOUR_API_KEY}"