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
- Create a free account and open API Keys in your dashboard.
- Create a key. It is shown once, so copy it straight away.
- Send the key in the
X-API-Keyheader with every request.
Base URL and authentication
Base URL: https://temp-mail.gg/api/v1
Header: X-API-Key: your_api_key_here
Endpoints
| Method | Path | What it does |
|---|---|---|
POST | /emails/generate | Create 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 | /emails | List the addresses created with your key (up to 20 per page; per_page parameter). |
GET | /emails/{email}/messages | List 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
| Plan | Requests | Quota resets | Price |
|---|---|---|---|
| Free | 100 per month | Monthly | Free |
| Pro | 12,000 per month | Monthly | $10 |
| Ultra | 1,500 per day for 30 days | Daily | $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.