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.
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.
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"{
"email": "user8923@bagaji.edu.pl",
"status": "success",
"remaining_quota": 999
}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.
| Parameter | Value |
|---|---|
| Base URL | https://etempmail.org |
| Auth Header | x-api-key: YOUR_API_KEY |
| Content-Type | application/json |
| CORS | Enabled for all origins |
API Endpoints Reference
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/generate | Generate 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 |
/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
| Field | Type | Description |
|---|---|---|
| string | The generated temporary email address | |
| remaining_quota | integer | Remaining API requests in your current billing period |
| status | string | "success" on successful generation |
/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
| Parameter | Required | Description |
|---|---|---|
| address | Required | The 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)
| Field | Type | Description |
|---|---|---|
| id | string | Unique message ID (use for deletion) |
| from | string | Sender's email address |
| subject | string | Email subject line |
| body_text | string | Plain text body (already decoded, ready to parse) |
| body_html | string | HTML body of the email |
| created_at | string | ISO 8601 timestamp of when the message was received |
/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
| Parameter | Required | Description |
|---|---|---|
| id | Required | The 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 Code | Meaning | What To Do |
|---|---|---|
| 200 | OK — Success | Request was successful. Process the returned JSON data. |
| 400 | Bad Request | A required parameter is missing (e.g. address or id). |
| 401 | Unauthorized | Your API key is missing or invalid. Check the x-api-key header. |
| 403 | Forbidden — Quota Exceeded | Your monthly API quota is exhausted. Upgrade your plan or wait for the next billing cycle. |
| 500 | Internal Server Error | An unexpected error occurred on our end. Retry with exponential backoff. |
{
"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.
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 pollconst 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
$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);
}
?>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
- User A visits your site → your backend calls
/api/v1/generate→ getsuser123@bagaji.edu.pl→ you save this in the user's session - User A signs up on Netflix using
user123@bagaji.edu.pl - Netflix sends OTP to
user123@bagaji.edu.pl→ our server receives it - User A's browser polls your backend every 5 seconds → your backend calls
/api/v1/messages?address=user123@bagaji.edu.pl - 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.