Public API
API Documentation
The public read API needs no token. For paid domains or your own domain, use the paid API page inside your account.
Base URL
https://tempmail.twFormat
JSON. Errors return {"error":"…"}
Rate limit
2000 requests/minute per IP
Login and registration endpoints are stricter: 10 requests/minute per IP.
Inbox
List mail, paginate, and check for new arrivals.
/api/inbox/demo%40example.com?limit=50&offset=0/api/inbox/{email}?limit=50&offset=0List messages
Returns message summaries, shaped for rendering a list.
/api/inbox/{email}/headCheck for new mail
A light endpoint that only returns the newest message id — poll this instead of the whole inbox.
curl 'https://tempmail.tw/api/inbox/demo%40example.com?limit=50&offset=0'Realtime
LiveInstead of polling you can open an SSE stream and get an event the moment mail lands.
/api/inbox/{email}/streamLive mail stream (SSE)
Keeps the connection open and pushes one JSON event whenever the inbox receives mail.
Each event looks like data: {"id":"…","ts":1700000000}. Reconnect yourself if the stream drops.
curl -N 'https://tempmail.tw/api/inbox/demo@example.com/stream'Messages
Read content, mark read, annotate and delete mail.
/api/message/{id}?mark_read=falseRead one message
Returns text/html bodies, attachment metadata and parsed headers. The message is marked read unless you pass mark_read=false.
/api/message/{id}/readMark read / unread
Send isRead=true to mark as read, false to move it back to unread.
Request body
{ "isRead": true }/api/message/{id}/noteUpdate the note
Notes are capped at 2000 characters and come back in both the message and the inbox summary.
Request body
{ "note": "facebook login code" }/api/message/{id}Delete a message
Permanently deletes one message by id.
/api/inbox/{email}/message/{id}Delete inside one inbox
Same as above, but verifies the message belongs to that inbox first.
curl -X PATCH 'https://tempmail.tw/api/message/{id}/note' \
-H 'Content-Type: application/json' \
-d '{"note":"facebook login code"}'The old GET endpoints are deprecated
These four operations used to be callable over GET (/message/{id}/delete, /message/{id}/read, /message/{id}/note, /inbox/{email}/message/{id}/delete). A GET must not change state — a prefetcher, a crawler or an <img> tag can fire one. They still work for now but will be removed; move to DELETE / POST / PATCH.
Domains
The public endpoint only returns free domains.
/api/domainsList free domains
Domains anyone can use, no sign-in required.
/api/account/domainsDomains for your account
Returns plan system domains plus verified custom domains. Requires an API token.
curl 'https://tempmail.tw/api/domains'Errors
Every error is JSON with a single error field.
400Invalid parameter401Missing or invalid token403No access to this inbox404Message not found429Rate limit exceeded