TempMail

API-documentatie

TempMail API v1 Referentie

Basis-URL

https://mail.taohuaxin.top

Authenticatie

Alle endpoints behalve /config vereisen authenticatie.

Voeg de volgende header toe aan alle verzoeken:

x-api-key: tm_your_token_here

Verkrijg je token in: Dashboard → Instellingen → API-sleutels

Endpoints

MethodePadBeschrijving
GET/api/v1/configServerconfiguratie (openbaar — geen authenticatie vereist)
GET/api/v1/meE-mails ophalen uit al je mailboxen (long-poll)
GET/api/v1/inbox/:addressE-mails ophalen voor één mailbox (long-poll)
DELETE/api/v1/inbox/:addressAlle e-mails in een mailbox wissen
GET/api/v1/email/:idVolledig geparste e-mail ophalen (tekst + html + bijlagen)
GET/api/v1/email/:id/renderedGerenderde e-mailtekst ophalen
GET/api/v1/email/:id/attachments/:attachmentIdEén bijlage downloaden op ID
DELETE/api/v1/email/:idEén enkele e-mail verwijderen
GET/api/v1/domainsToon je eigen domeinen
POST/api/v1/domainsEigen domein toevoegen
DELETE/api/v1/domains/:idEigen domein verwijderen

docs.examples

GET/api/v1/config

Serverconfiguratie (openbaar — geen authenticatie vereist)

curl https://mail.taohuaxin.top/api/v1/config

docs.response

{
  "domains": ["taohuaxin.top"],
  "smtpPort": 25,
  "smtpsPort": 465,
  "mxPort": 25,
  "version": "1.0.0"
}
GET/api/v1/me

E-mails ophalen uit al je mailboxen (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"
}
GET/api/v1/inbox/:address

E-mails ophalen voor één 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"
}
DELETE/api/v1/inbox/:address

Alle e-mails in een mailbox wissen

curl -X DELETE -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/inbox/[email protected]"

docs.response

{ "success": true }
GET/api/v1/email/:id

Volledig geparste e-mail ophalen (tekst + html + bijlagen)

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 }
  ]
}
GET/api/v1/email/:id/rendered

Gerenderde e-mailtekst ophalen

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>
GET/api/v1/email/:id/attachments/:attachmentId

Eén bijlage downloaden op 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>
DELETE/api/v1/email/:id

Eén enkele e-mail verwijderen

curl -X DELETE -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz"

docs.response

{ "success": true }
GET/api/v1/domains

Toon je eigen domeinen

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"
  }
]
POST/api/v1/domains

Eigen domein toevoegen

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"
}
DELETE/api/v1/domains/:id

Eigen domein verwijderen

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 polling

De inbox-endpoints ondersteunen long-polling. Roep één keer aan en de server wacht tot er mail binnenkomt (max. 25 s). Retourneert 204 als er geen mail binnenkomt voor de timeout.

Queryparameters

ParameterBeschrijving
sinceCursor uit de vorige respons; alleen mail na dit punt wordt geretourneerd
countRetourneer zodra N nieuwe e-mails zijn binnengekomen (standaard 1, max. 50)
limitMaximaal aantal e-mails per respons (standaard 20, max. 50)
fromFilter — retourneer alleen mail waarvan Van deze substring bevat
subjectFilter — retourneer alleen mail waarvan Onderwerp deze substring bevat

Verwijdergedrag

Alle DELETE-bewerkingen zijn zachte verwijderingen: verwijderde items zijn verborgen voor gebruikers maar blijven toegankelijk voor beheerders voor auditdoeleinden.