API Documentation
TempMail API v1 Reference
Base URL
https://mail.taohuaxin.topAuthentication
All endpoints except /config require authentication.
Add the following header to all requests:
x-api-key: tm_your_token_hereGet your token in: Dashboard → Settings → API Keys
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/config | Server configuration (public — no auth required) |
| GET | /api/v1/me | Fetch emails across all your mailboxes (long-poll) |
| GET | /api/v1/inbox/:address | Fetch emails for a single mailbox (long-poll) |
| DELETE | /api/v1/inbox/:address | Clear all emails in a mailbox |
| GET | /api/v1/email/:id | Get full parsed email (text + html + attachments) |
| GET | /api/v1/email/:id/rendered | Get rendered plain-text email |
| GET | /api/v1/email/:id/attachments/:attachmentId | Download one attachment by ID |
| DELETE | /api/v1/email/:id | Delete a single email |
| GET | /api/v1/domains | List your custom domains |
| POST | /api/v1/domains | Add a custom domain |
| DELETE | /api/v1/domains/:id | Remove a custom domain |
docs.examples
/api/v1/configServer configuration (public — no auth required)
curl https://mail.taohuaxin.top/api/v1/configdocs.response
{
"domains": ["taohuaxin.top"],
"smtpPort": 25,
"smtpsPort": 465,
"mxPort": 25,
"version": "1.0.0"
}/api/v1/meFetch emails across all your mailboxes (long-poll)
curl -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/me?count=1&limit=20"docs.response
{
"emails": [
{
"id": "cmcg2a1b40001xyz",
"fromAddress": "[email protected]",
"subject": "Your verification code",
"isRead": false,
"receivedAt": "2026-07-10T08:30:00.000Z",
"mailbox": { "address": "alice", "domain": "taohuaxin.top" }
}
],
"nextSince": "cmcg2a1b40001xyz"
}/api/v1/inbox/:addressFetch emails for a single mailbox (long-poll)
curl -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/inbox/[email protected]?since=cmcg2a1b40001xyz&count=1"docs.response
{
"emails": [
{
"id": "cmcg9f2c80002abc",
"fromAddress": "[email protected]",
"subject": "Welcome!",
"isRead": false,
"receivedAt": "2026-07-10T09:00:00.000Z"
}
],
"nextSince": "cmcg9f2c80002abc"
}/api/v1/inbox/:addressClear all emails in a mailbox
curl -X DELETE -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/inbox/[email protected]"docs.response
{ "success": true }/api/v1/email/:idGet full parsed email (text + html + attachments)
curl -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz"docs.response
{
"id": "cmcg2a1b40001xyz",
"fromAddress": "[email protected]",
"toAddress": "[email protected]",
"subject": "Your verification code",
"bodyHtml": "<p>Your code is <b>123456</b></p>",
"bodyText": "Your code is 123456",
"isRead": true,
"receivedAt": "2026-07-10T08:30:00.000Z",
"attachments": [
{ "id": "att_01", "filename": "invoice.pdf", "mimeType": "application/pdf", "size": 24580 }
]
}/api/v1/email/:id/renderedGet rendered plain-text email
curl -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz/rendered"docs.response
From: [email protected]
To: [email protected]
Subject: Your verification code
Date: Fri, 10 Jul 2026 08:30:00 GMT
<p>Your code is <b>123456</b></p>/api/v1/email/:id/attachments/:attachmentIdDownload one attachment by ID
curl -OJ -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz/attachments/att_01"docs.response
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="invoice.pdf"
Content-Length: 24580
<binary file stream>/api/v1/email/:idDelete a single email
curl -X DELETE -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz"docs.response
{ "success": true }/api/v1/domainsList your custom domains
curl -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/domains"docs.response
[
{
"id": "dom_01",
"domain": "mail.example.com",
"verified": true,
"receiveMode": "inherit",
"createdAt": "2026-07-01T00:00:00.000Z"
}
]/api/v1/domainsAdd a custom domain
curl -X POST -H "x-api-key: tm_your_token_here" \
-H "Content-Type: application/json" \
-d '{"domain":"mail.example.com","receiveMode":"inherit"}' \
"https://mail.taohuaxin.top/api/v1/domains"docs.response
{
"id": "dom_02",
"domain": "mail.example.com",
"verified": false,
"receiveMode": "inherit",
"createdAt": "2026-07-10T10:00:00.000Z"
}/api/v1/domains/:idRemove a custom domain
curl -X DELETE -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/domains/dom_02"docs.response
{ "success": true }Long Poll
The inbox endpoints support long-polling. Call once and the server blocks until mail arrives (up to 25s). Returns 204 if no mail arrives before timeout.
Query Parameters
| Parameter | Description |
|---|---|
| since | Cursor from the previous response; only mail after this is returned |
| count | Return once N new emails have arrived (default 1, max 50) |
| limit | Maximum emails per response body (default 20, max 50) |
| from | Filter — only return mail whose From contains this substring |
| subject | Filter — only return mail whose Subject contains this substring |
Delete Behavior
All DELETE operations are soft deletes: deleted items are hidden from users but remain accessible to administrators for audit purposes.