eTempMail REST API for Developers

Build with the most reliable disposable email REST API. Create temporary inboxes with premium .EDU domains, fetch OTP messages in JSON, and verify emails programmatically.

Automated Testing

Built for QA engineers. Integrate seamlessly with Selenium, Cypress, Playwright, and Puppeteer.

Deep Message Parsing

Retrieve fully parsed JSON representations of emails including subject, sender, body, and attachments.

High Trust .EDU Domains

Use our premium .EDU and verified domain endpoints to bypass anti-bot and strict spam filters easily.

Blazing Fast Retrieval

Ultra-low latency endpoints optimized for fast polling to deliver verification codes instantly.

Self-Destructing Inbox

Strict privacy retention. All messages are securely and permanently self-destructed automatically.

White-Label Ready

Build your own temp mail service using our API as the backend engine. No mail server setup needed.

Quick Start Guide

Get up and running with the eTempMail API in under 2 minutes.

1

Get Your Free API Key

Sign up at etempmail.org/developer/login, go to your Dashboard, and generate an API key. Copy your key immediately — it is shown only once.

2

Generate a Temporary Email

Make a GET request with your API key in the x-api-key header:

curl -X GET https://etempmail.org/api/v1/generate \
  -H "x-api-key: YOUR_API_KEY"
// Response:
{
  "email": "user8923@bagaji.edu.pl",
  "status": "success",
  "remaining_quota": 999
}
3

Read Incoming Emails

Poll the messages endpoint using the email address you generated:

curl -X GET "https://etempmail.org/api/v1/messages?address=user8923@bagaji.edu.pl" \
  -H "x-api-key: YOUR_API_KEY"

That's it! You now have a working temporary email with OTP retrieval. Read below for the full API reference.

Authentication

Important: All API requests require authentication via the x-api-key HTTP header. Never expose your API key in client-side (frontend) code — always call the API from your server/backend.

ParameterValue
Base URLhttps://etempmail.org
Auth Headerx-api-key: YOUR_API_KEY
Content-Typeapplication/json
CORSEnabled for all origins

API Endpoints Reference

MethodEndpointDescription
GET/api/v1/generateGenerate a new temporary email address with a premium domain
GET/api/v1/messages?address=...Retrieve all messages for a given email address
DELETE/api/v1/delete?id=...Delete a specific message by its unique ID
GET

/api/v1/generate

Generate a new unique temporary email address. The system automatically assigns a premium .EDU domain (e.g. @bagaji.edu.pl). Each call returns a completely unique address.

Request

curl -X GET https://etempmail.org/api/v1/generate \
  -H "x-api-key: YOUR_API_KEY"

Success Response 200 OK

{
  "email": "user8923@bagaji.edu.pl",
  "remaining_quota": 999,
  "status": "success"
}

Response Fields

FieldTypeDescription
emailstringThe generated temporary email address
remaining_quotaintegerRemaining API requests in your current billing period
statusstring"success" on successful generation
GET

/api/v1/messages

Retrieve all messages (OTPs, verification links, etc.) for a given temporary email address. Returns a JSON array of fully parsed email objects. Poll this endpoint every 3–5 seconds to check for new messages.

Query Parameters

ParameterRequiredDescription
addressRequiredThe email address generated in Step 1 (e.g. user8923@bagaji.edu.pl)

Request

curl -X GET "https://etempmail.org/api/v1/messages?address=user8923@bagaji.edu.pl" \
  -H "x-api-key: YOUR_API_KEY"

Success Response 200 OK

[
  {
    "id": "msg_5f3a9b2c",
    "from": "noreply@netflix.com",
    "subject": "Your verification code",
    "body_text": "Your OTP code is: 492011. It expires in 10 minutes.",
    "body_html": "<p>Your OTP code is: <b>492011</b></p>",
    "created_at": "2026-05-26T10:05:00Z"
  },
  {
    "id": "msg_7d2e1a8f",
    "from": "security@github.com",
    "subject": "Confirm your email address",
    "body_text": "Click here to verify: https://github.com/verify/abc123",
    "body_html": "<a href='https://github.com/verify/abc123'>Verify</a>",
    "created_at": "2026-05-26T10:02:00Z"
  }
]

Response Fields (per message)

FieldTypeDescription
idstringUnique message ID (use for deletion)
fromstringSender's email address
subjectstringEmail subject line
body_textstringPlain text body (already decoded, ready to parse)
body_htmlstringHTML body of the email
created_atstringISO 8601 timestamp of when the message was received
DELETE

/api/v1/delete

Delete a specific message by its unique ID. Use this to clean up after reading an OTP or verification link.

Query Parameters

ParameterRequiredDescription
idRequiredThe unique message ID returned from the messages endpoint

Request

curl -X DELETE "https://etempmail.org/api/v1/delete?id=msg_5f3a9b2c" \
  -H "x-api-key: YOUR_API_KEY"

Success Response 200 OK

{
  "success": true,
  "message": "Email deleted successfully"
}

Error Codes Reference

HTTP CodeMeaningWhat To Do
200OK — SuccessRequest was successful. Process the returned JSON data.
400Bad RequestA required parameter is missing (e.g. address or id).
401UnauthorizedYour API key is missing or invalid. Check the x-api-key header.
403Forbidden — Quota ExceededYour monthly API quota is exhausted. Upgrade your plan or wait for the next billing cycle.
500Internal Server ErrorAn unexpected error occurred on our end. Retry with exponential backoff.
Error Response Format:
{
  "error": "Unauthorized: Invalid API Key"
}

Code Examples

Copy-paste ready code snippets for popular languages. You can also give this entire page to an AI assistant (like Cursor, ChatGPT, or Claude) to build your service automatically.

Python
import requests
import time

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://etempmail.org"
HEADERS = {"x-api-key": API_KEY}

# Step 1: Generate a temporary email
resp = requests.get(f"{BASE_URL}/api/v1/generate", headers=HEADERS)
data = resp.json()
email = data["email"]
print(f"Generated email: {email}")
# Example output: user8923@bagaji.edu.pl

# Step 2: Poll for incoming messages (e.g., OTP)
for attempt in range(20):  # Try for ~60 seconds
    msgs = requests.get(
        f"{BASE_URL}/api/v1/messages",
        params={"address": email},
        headers=HEADERS
    ).json()
    
    if len(msgs) > 0:
        print(f"From: {msgs[0]['from']}")
        print(f"Subject: {msgs[0]['subject']}")
        print(f"Body: {msgs[0]['body_text']}")
        
        # Step 3: Delete the message after reading
        requests.delete(
            f"{BASE_URL}/api/v1/delete",
            params={"id": msgs[0]["id"]},
            headers=HEADERS
        )
        print("Message deleted.")
        break
    
    time.sleep(3)  # Wait 3 seconds before next poll
Node.js
const API_KEY = "YOUR_API_KEY";
const BASE_URL = "https://etempmail.org";
const headers = { "x-api-key": API_KEY };

// Step 1: Generate a temporary email
const genRes = await fetch(`${BASE_URL}/api/v1/generate`, { headers });
const { email } = await genRes.json();
console.log("Generated:", email);
// Example output: user8923@bagaji.edu.pl

// Step 2: Poll for incoming messages
async function pollMessages() {
  for (let i = 0; i < 20; i++) {
    const res = await fetch(
      `${BASE_URL}/api/v1/messages?address=${encodeURIComponent(email)}`,
      { headers }
    );
    const messages = await res.json();
    
    if (messages.length > 0) {
      console.log("From:", messages[0].from);
      console.log("Subject:", messages[0].subject);
      console.log("Body:", messages[0].body_text);
      
      // Step 3: Delete after reading
      await fetch(
        `${BASE_URL}/api/v1/delete?id=${messages[0].id}`,
        { method: "DELETE", headers }
      );
      return messages[0];
    }
    
    await new Promise(r => setTimeout(r, 3000)); // Wait 3s
  }
}
await pollMessages();
PHP
<?php
$apiKey = "YOUR_API_KEY";
$baseUrl = "https://etempmail.org";

// Step 1: Generate email
$ch = curl_init("$baseUrl/api/v1/generate");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-api-key: $apiKey"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

$email = $data["email"];
echo "Generated: $email\n";
// Example output: user8923@bagaji.edu.pl

// Step 2: Poll for messages
for ($i = 0; $i < 20; $i++) {
    $url = "$baseUrl/api/v1/messages?address=" . urlencode($email);
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-api-key: $apiKey"]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $messages = json_decode(curl_exec($ch), true);
    curl_close($ch);
    
    if (count($messages) > 0) {
        echo "From: " . $messages[0]["from"] . "\n";
        echo "Subject: " . $messages[0]["subject"] . "\n";
        echo "Body: " . $messages[0]["body_text"] . "\n";
        break;
    }
    sleep(3);
}
?>
React (Frontend UI)

When displaying the body_html in your own web app, the email's CSS can conflict with your website's styling. To prevent this, always render the email HTML inside an isolated <iframe> using the srcDoc attribute.

import React from 'react';

// Example React component to safely display an email message
export function EmailViewer({ message }) {
  if (!message) return <p>No message selected</p>;

  return (
    <div className="email-container">
      <h2>{message.subject}</h2>
      <p>From: {message.from}</p>
      
      {/* 
        IMPORTANT: Use an iframe with srcDoc to isolate the email's CSS.
        This prevents the email's styles from breaking your website's UI!
      */}
      <iframe 
        title="Email Content"
        srcDoc={message.body_html || message.body_text}
        style={{ width: '100%', height: '500px', border: '1px solid #e5e7eb', borderRadius: '0.5rem' }}
        sandbox="allow-same-origin" // Added for security
      />
    </div>
  );
}

Build Your Own Temp Mail Service

Use eTempMail API as your backend engine to create a white-label email service — no mail server setup needed. Whether you are coding manually, or using AI tools (Cursor, ChatGPT, Lovable) or No-Code platforms (Bubble, FlutterFlow), this architecture works for all.

Architecture Overview

┌──────────────────────┐         ┌──────────────────────┐
│   YOUR WEBSITE       │         │  eTempMail API       │
│   (Frontend)         │         │  (Backend Engine)    │
│                      │         │                      │
│  User clicks         │         │                      │
│  "Get New Email" ──────────────►  GET /api/v1/generate│
│                      │  x-api  │                      │
│  Shows email to  ◄───────────────  Returns email      │
│  the user            │   key   │  @bagaji.edu.pl      │
│                      │         │                      │
│  Polls every 5s  ──────────────►  GET /api/v1/messages│
│  for new messages    │         │                      │
│                      │         │                      │
│  Displays OTP    ◄───────────────  Returns JSON emails│
│  to user             │         │                      │
└──────────────────────┘         └──────────────────────┘

How Multiple Users Stay Isolated

Every call to /api/v1/generate returns a completely unique email address. When User A gets user123@bagaji.edu.pl and User B gets user456@bagaji.edu.pl, their inboxes are completely separate. Your server maps each user session to their specific email, so thousands of users will never see each other's messages.

How OTPs Reach the Right User

  1. User A visits your site → your backend calls /api/v1/generate → gets user123@bagaji.edu.pl → you save this in the user's session
  2. User A signs up on Netflix using user123@bagaji.edu.pl
  3. Netflix sends OTP to user123@bagaji.edu.pl → our server receives it
  4. User A's browser polls your backend every 5 seconds → your backend calls /api/v1/messages?address=user123@bagaji.edu.pl
  5. Our API returns the OTP → your backend sends it only to User A's screen (because you mapped the session)

Understanding the Domain Architecture

You might wonder why the API generates emails ending in @bagaji.edu.pl instead of @etempmail.org. This is by design! etempmail.org is our main website and API host, while bagaji.edu.plis our dedicated, high-trust mail receiving server. By separating the web traffic from the mail traffic, we ensure better deliverability and bypass strict anti-spam filters that often block typical "temp mail" domains. Your users get a premium .EDU address that works on 99% of websites.

💡 Revenue Tip: The more users your website gets, the more API calls you make. Start with our free tier, then upgrade as your traffic grows. You charge your users a subscription — we charge you per API call. Your margins grow as you scale.

Frequently Asked Questions

What is the eTempMail API used for?
The eTempMail API allows developers to create temporary, disposable email addresses programmatically. It is perfect for automated software testing, QA workflows, building your own temp mail service, and verifying email deliveries without exposing personal or corporate inboxes.
Can I build my own temp mail website using this API?
Yes! You can use the eTempMail API as a white-label backend engine. Simply build your frontend (using any framework, No-Code tool, or AI assistant), call our API from your server to generate emails and fetch messages, and display results to your users. No mail server configuration is required.
Which automation frameworks does the API support?
Because it is a standard REST API delivering JSON responses, it integrates flawlessly with any modern QA framework. Our users primarily utilize it alongside Selenium, Cypress, Playwright, and Puppeteer to fully automate end-to-end user registration and OTP verification flows.
Do I need to decode Base64 like other temp mail APIs?
No! Unlike other temp mail APIs (such as Privatix on RapidAPI) that return Base64-encoded email bodies, the eTempMail API returns fully decoded, ready-to-use plain text and HTML. You can extract OTPs and links directly from the response without any extra decoding step.
Is the eTempMail disposable email API free to use?
Yes! eTempMail offers a generous free tier explicitly designed so developers can test and integrate our disposable email REST API into their codebases at zero cost. For high-volume enterprise automation needs, we provide scalable premium plans.
How long do messages stay in the eTempMail temporary inbox?
To maintain strict privacy and data security, emails received in your eTempMail temporary inbox are kept for a limited timeframe before being permanently self-destructed from our servers. You also have the ability to programmatically delete them via the API at any time.