Developer API

REST API

Integrate temporary mailboxes into your app. Public endpoints require no API key (rate-limited per IP). All responses are JSON. Passwordless mailboxes need only the address; add the password parameter for password-protected mailboxes.

Base URLhttps://dphuoc.com/api/v1FormatJSONAuthnone (rate-limited)
GET/api/v1/domains

List of active domains.

curl "https://dphuoc.com/api/v1/domains"

{ "domains": ["dphuoc.com"] }
POST/api/v1/mailbox

Create a mailbox. Leave localPart empty to randomize; omit password for a passwordless mailbox (temp-mail).

ParameterTypeDescription
localPartstring?Local part before @ (empty → random)
domainstring?Domain (defaults to the default domain)
randomDomainbool?Pick randomly among active domains
passwordstring?≥10 chars → password-protected mailbox
curl -X POST "https://dphuoc.com/api/v1/mailbox" \
  -H "Content-Type: application/json" \
  -d '{"randomDomain":true}'

{ "address": "ab12cd34ef@dphuoc.com", "domain": "dphuoc.com", "passwordless": true }
GET/api/v1/messages

List an address's messages (paginated). Includes pre-extracted code / loginUrl.

ParameterTypeDescription
addressstringMailbox address
passwordstring?Required if the mailbox has a password
pageint?Page, default 1
limitint?Messages per page, default 20, max 100
curl "https://dphuoc.com/api/v1/messages?address=ab12cd34ef@dphuoc.com&limit=20"

{
  "messages": [{
    "id": "…", "from": "no-reply@service.com", "subject": "Your code",
    "preview": "Your verification code is 123456",
    "code": "123456", "loginUrl": null,
    "attachments": 0, "receivedAt": "2026-08-10T10:30:00.000Z"
  }],
  "total": 1, "page": 1, "limit": 20, "pages": 1
}
GET/api/v1/messages/:id

Full content of a message (html/text, attachments, code).

ParameterTypeDescription
addressstringMailbox address
passwordstring?Required if the mailbox has a password
curl "https://dphuoc.com/api/v1/messages/MSG_ID?address=ab12cd34ef@dphuoc.com"

{ "id":"…","from":"…","subject":"…","html":"<p>…</p>","text":"…","code":"123456","attachments":[] }
DELETE/api/v1/messages/:id

Delete a message by id.

ParameterTypeDescription
addressstringMailbox address
passwordstring?If the mailbox has a password
curl -X DELETE "https://dphuoc.com/api/v1/messages/MSG_ID?address=ab12cd34ef@dphuoc.com"

{ "deleted": 1 }
DELETE/api/v1/messages

Delete all messages for an address.

ParameterTypeDescription
addressstringMailbox address
passwordstring?If the mailbox has a password
curl -X DELETE "https://dphuoc.com/api/v1/messages?address=ab12cd34ef@dphuoc.com"

{ "deleted": 12 }

Notes

  • No auth for public endpoints; rate-limited per IP.
  • Passwordless mailboxes: anyone who knows the address can read them — for temp-mail. Add password to protect.
  • Fields code and loginUrl are auto-extracted from the message body (OTP / magic-link).
  • Messages auto-delete after an admin-configured period (default 24 hours).