🔐 Authentication: Most endpoints do not require authentication. Only /api/all-domains/ requires the X-Domain-Token header.

GET/api/email/{domain}/{user}/

Get a paginated list of a user's emails. List responses contain metadata only (no body / html_body).

ParameterLocationDescription
domainpathEmail domain, e.g. example.com
userpathUsername, e.g. testuser
pagequery, optionalPage number (default 1)
limitquery, optionalItems per page (default 20, maximum 100)
curl -X GET "https://BASE_URL/api/email/example.com/testuser/?page=1&limit=20"
{
  "emails": [
    {
      "id": 123,
      "subject": "Welcome",
      "sender": "[email protected]",
      "date": "2026-09-30T10:30:00.000Z",
      "has_attachments": false,
      "size": 1234
    }
  ],
  "total": 5,
  "page": 1,
  "limit": 20,
  "has_more": false
}

GET/api/email/{domain}/{user}/{email_id}

Get the full details of an email.

curl -X GET "https://BASE_URL/api/email/example.com/testuser/123"

DELETE/api/email/{domain}/{user}/{email_id}

Delete a specific email.

curl -X DELETE "https://BASE_URL/api/email/example.com/testuser/123"
{ "status": "deleted" }

POST/api/add-domain/{domain}

Add a new domain or update an existing domain's online status. The domain must have an MX record pointing to the system's hostname to be accepted (status added, is_online: true).

curl -X POST "https://BASE_URL/api/add-domain/newdomain.com"
// Successfully added
{ "status": "added", "domain": "newdomain.com", "is_online": true }

// Existing domain: update its status
{ "status": "updated", "domain": "newdomain.com", "is_online": false }
⚠️ If the MX record does not point to the correct host, the API returns a 400 error with guidance.

GET/api/all-domains/ & /api/random-domains/

All online domains (private, token required):

curl -X GET "https://BASE_URL/api/all-domains/" \
  -H "X-Domain-Token: YOUR_TOKEN"

Random online domains (public):

curl -X GET "https://BASE_URL/api/random-domains/?limit=10"
{ "domains": ["domain1.com", "domain2.com"], "total": 2 }

GET/api/check-mx/{domain}

Check whether a domain has a valid MX record pointing to the system.

curl -X GET "https://BASE_URL/api/check-mx/example.com"
{ "result": "online" }   // or "offline"

Error handling

CodeMeaning
200Success
400Invalid request (e.g. malformed domain/email)
401Missing or invalid token for a private endpoint
404Email not found
429Rate limit exceeded
{ "detail": "Domain not found" }

Important notes