mail.tm API

Email / No Auth Required Beginner HTTPS CORS
Free to Use
67 C
Measured Score 0 50 100 Speed 11/30 Consistency 17/20 Security 20/20 Browser access 15/15 Transparency 4/15 TESTED 2026-08-10

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.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.mail.tm/domains
Result
HTTP 200 · application/ld+json · 348 bytes
Response time
309 ms (median of 3) · fastest 294 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Let's Encrypt
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
Caddy
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
@context string /contexts/Domain
@id string /domains
@type string hydra:Collection
hydra:totalItems integer 1
hydra:member array [1 item]

Captured Response

Captured from a real request to https://api.mail.tm/domains on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "@context": "/contexts/Domain",
  "@id": "/domains",
  "@type": "hydra:Collection",
  "hydra:totalItems": 1,
  "hydra:member": [
    {
      "@id": "/domains/6a766046e6e7307e1080ab01",
      "@type": "Domain",
      "id": "6a766046e6e7307e1080ab01",
      "domain": "emalupe.com",
      "isActive": true,
      "isPrivate": false,
      "createdAt": "2026-08-07T00:00:00+00:00",
      "updatedAt": "2026-08-07T00:00:00+00:00"
    }
  ]
}

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

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.mail.tm/domains";
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.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist application/problem+json
{
  "@id": "/errors/404",
  "@type": "hydra:Error",
  "title": "An error occurred",
  "detail": "Not Found",
  "status": 404,
  "type": "/errors/404",
  "hydra:title": "An error occurred",
  "hydra:description": "Not Found"
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 11/30
Consistency 17/20
Security 20/20
Browser access 15/15
Transparency 4/15
Endpoint Response Time 309ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Email
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

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 →