Developers

Temporary Email API

The Temp-Mail.GG API lets you generate disposable email addresses and read the messages they receive from your own code. It is a JSON REST API, useful for testing sign-up flows, automation, and keeping real addresses out of test data.

Open the interactive API reference

Quick start

  1. Create a free account and open API Keys in your dashboard.
  2. Create a key. It is shown once, so copy it straight away.
  3. Send the key in the X-API-Key header with every request.

Base URL and authentication

Base URL: https://temp-mail.gg/api/v1
Header:   X-API-Key: your_api_key_here

Endpoints

MethodPathWhat it does
POST/emails/generateCreate a new address. Optional body fields: prefix (3 to 64 characters: letters, numbers, dot, dash, underscore) and domain. Without them a random address on the default domain is created.
GET/emailsList the addresses created with your key (up to 20 per page; per_page parameter).
GET/emails/{email}/messagesList the messages received by one of your addresses.
GET/messages/{id}Get one message in full, including its HTML and plain-text bodies.

Example

# 1. Create an address
curl -X POST https://temp-mail.gg/api/v1/emails/generate \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"prefix": "mytest"}'

# 2. List the messages it has received
curl https://temp-mail.gg/api/v1/emails/mytest@your-domain/messages \
  -H "X-API-Key: your_api_key_here"

Things to know

  • Message bodies are base64-encoded. Both the HTML and the plain-text body are returned as base64 strings. Decode them before use.
  • You can only read your own addresses. Requests for an address created by another key's owner are refused.
  • Incoming messages are deleted automatically 24 hours after they arrive, so fetch what you need promptly.

Plans and limits

PlanRequestsQuota resetsPrice
Free100 per monthMonthlyFree
Pro12,000 per monthMonthly$10
Ultra1,500 per day for 30 daysDaily$49.99

Paid plans are activated with a gift card code, redeemed on the API Keys page of your dashboard. Buy a gift card.

Help

Full request and response details are in the interactive API reference. For anything else, email [email protected] or message us on Telegram.