mail.tm API

Email / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

mail.tm is a temporary email service API that creates persistent (but disposable) email accounts accessible via a REST interface using JWT authentication. Unlike single-session throwaway services, mail.tm accounts persist until manually deleted, making it suitable for multi-step testing workflows. It follows a JSON-LD / Hydra API convention and supports full message read, delete, and account management.

💡

Beginner Tip

mail.tm works in three steps: check available domains (GET /domains), create an account (POST /accounts) on one of those domains, then authenticate (POST /token) to get a JWT for inbox access. Save the JWT — you need it for every inbox request.

Available Data

email delivery status
message ID
bounce/complaint data
open/click tracking
Use case: Integrate temporary email service data into web and mobile applications

Example Response

JSON Response
{
  "message_id": "msg_abc123def456",
  "status": "delivered",
  "to": "[email protected]",
  "subject": "Welcome!",
  "timestamp": "2025-01-15T10:30:00Z"
}

Field Reference

@context JSON-LD context URL indicating mail.tm uses Hydra API conventions for collection responses
hydra:member The actual array of resource objects (domains, messages, or accounts) in a collection response
id Unique resource identifier, typically in the form /resource-type/uuid
address The full temporary email address (e.g., [email protected]) for a created account
token JWT bearer token returned from POST /token, required in Authorization header for inbox access
intro Plain-text preview of the email message body shown in the message list

Implementation Example

const url = "https://docs.mail.tm/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

404 on GET /domains with empty results mail.tm occasionally rotates domain availability; hardcoding a domain name without checking will cause failures
Always start by calling GET /domains to get the current list of active domains before creating an account
JSON parse error — response is JSON-LD format mail.tm uses Hydra/JSON-LD conventions, wrapping arrays in @context and hydra:member keys
Access messages via response["hydra:member"] rather than treating the response as a plain array
Account creation returns 422 with "address: This value is already used" The randomly chosen username is already taken on the mail.tm service
Generate a longer random prefix (12+ characters) or add a timestamp to the username to minimize collisions

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 55ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Email
Difficulty Beginner
Verified: 2026-04-04

Alternatives to mail.tm

Technical alternatives for different use cases.

Temporary email with REST API and custom domain support

Better For

Email address longevity and reliability

Trade-off

Disposable email with API-first design

Similar APIs

View All →