API reference, payload schemas, error responses and examples for creating inboxes, reading messages, long-polling for OTPs and webmail login.
Draxon Mail provides high-throughput inbound email infrastructure for bots, scrapers, automated QA, and testing workflows. Create temporary inboxes on public pool domains or custom domains, poll or wait for incoming messages, and extract verification codes automatically.
1. Mailbox Types & Universal Webmail Login
Every mailbox on DraxonCloud can be managed via API and accessed visually through our universal webmail interface at /mail/login.
- Public Pool Mailboxes: Hosted on shared domains (e.g.
[email protected]). Free, instant, retained for 60 minutes. - Custom Domain Mailboxes: Hosted on your own verified custom domain (e.g.
[email protected]). Retained for 30 days.
Giving an Inbox to a Person / Client
- Create a mailbox via API with
"password": "generate"(or set a password in the dashboard). - Give the recipient the full address (e.g.
[email protected]) and the generated password. - They sign in directly at https://draxon.one/mail/login.
- Strict Isolation: Their session (
dxm_...) lasts 30 days and gives them visual access only to that specific mailbox. They cannot view your developer dashboard, cannot see your API key, cannot access your funds, and cannot see other mailboxes on your domain. - Brute-Force Lockout: 10 failed login attempts locks that specific inbox for 15 minutes (
429 mailbox_locked).
2. API Endpoints Reference
All requests accept Authorization: Bearer drx_... or X-Api-Key: drx_....
1. List Public Pool Domains & Tracked Sites
Check which shared domains are active and whether they are confirmed working or blocked on specific target platforms (e.g. Discord).
GET /api/mail/v1/public/domains HTTP/1.1
Host: draxon.one
Authentication: None required.
Response (200 OK)
{
"domains": [
{
"name": "draxono.in",
"mx_ok": true,
"last_dns_check_at": "2026-10-12T19:38:28Z",
"sites": [
{
"key": "discord-com",
"label": "Discord",
"hostname": "discord.com",
"status": "works",
"note": "",
"updated_at": "2026-10-11T07:59:24Z"
}
]
}
],
"sites": [
{
"key": "discord-com",
"label": "Discord",
"hostname": "discord.com"
}
]
}
How to check site compatibility: Look at
sites[].status. Values are"works","blocked", or"unknown". Usesites[].key(e.g."discord-com") when requesting site-specific inboxes.
cURL
curl -s https://draxon.one/api/mail/v1/public/domains
Python
import requests
res = requests.get("https://draxon.one/api/mail/v1/public/domains")
data = res.json()
for domain in data["domains"]:
status = domain["sites"][0]["status"] if domain["sites"] else "unknown"
print(f"{domain['name']}: Discord status -> {status}")
Node.js / JavaScript
const res = await fetch("https://draxon.one/api/mail/v1/public/domains");
const { domains, sites } = await res.json();
console.log(`Found ${domains.length} active pool domains. Tracked platforms:`, sites);
2. Create Fast Anonymous Inbox (No Auth)
Creates an instant public mailbox on a shared domain known to work for a specific target site.
POST /api/mail/v1/public/random HTTP/1.1
Host: draxon.one
Content-Type: application/json
Authentication: None required.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
site |
string | No | Platform slug from /domains (e.g. "discord" or "discord-com"). If provided, selects a domain where status == "works". |
{
"site": "discord"
}
Response (201 Created)
{
"id": "79fab1c5-9c5d-40bb-b120-b3f486be8e7e",
"address": "[email protected]",
"local": "rltuulmyto5a",
"domain": "draxono.in",
"expires_in_minutes": 60
}
Errors
503 no_domains_available: No domains currently match the requested site filter.
cURL
curl -s -X POST https://draxon.one/api/mail/v1/public/random \
-H "Content-Type: application/json" \
-d '{"site": "discord"}'
Python
import requests
res = requests.post(
"https://draxon.one/api/mail/v1/public/random",
json={"site": "discord"}
)
inbox = res.json()
print(f"Created Anonymous Address: {inbox['address']}")
Node.js / JavaScript
const res = await fetch("https://draxon.one/api/mail/v1/public/random", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ site: "discord" }),
});
const inbox = await res.json();
console.log(`Created Address: ${inbox.address}`);
Endpoint 2: Create Mailboxes
Generate 1 to 500 mailboxes on public pool domains or your registered custom domain.
- Method:
POST - URL:
https://draxon.one/api/mail/v1/mailboxes - Headers:
Authorization: Bearer $DRAXON_KEY,Content-Type: application/json
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
count |
integer | No (Default: 1) | Number of mailboxes to generate (1 to 500). |
domain |
string | No | Specify a public pool domain, or your verified custom domain. If omitted, picks an active pool domain. |
prefix |
string | No | Custom prefix for the local part of the address (e.g. tester). |
password |
string | No (Default: "generate") |
Pass "generate" to create a webmail password for /mail/login, or "none" for headless API-only access. |
label |
string | No | Tag or label for grouping in your dashboard. |
Request Payload Example (Custom Domain)
{
"count": 1,
"domain": "yourdomain.com",
"prefix": "worker",
"password": "generate",
"label": "registration_bot"
}
Request Payload Example (Public Pool)
{
"count": 1,
"password": "generate"
}
Success Response (201 Created)
{
"data": [
{
"id": "df9f303f-137d-4e49-b6b8-2c9b80b59f1d",
"address": "[email protected]",
"password": "pw_8f3a9e1b2c4d"
}
]
}
Note: The generated password is shown once. Save it if delegating to a client for /mail/login.
Error Responses
400 bad_request: Invalid parameters.401 invalid_api_key: Missing or invalid API key.403 scope_denied: The API key does not havemailscope enabled.422 validation_error:countexceeds limits (max 500) ordomainis invalid.
cURL
curl -s -X POST https://draxon.one/api/mail/v1/mailboxes \
-H "Authorization: Bearer $DRAXON_KEY" \
-H "Content-Type: application/json" \
-d '{"count": 1, "domain": "yourdomain.com", "password": "generate"}'
Python
import requests
res = requests.post(
"https://draxon.one/api/mail/v1/mailboxes",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"count": 1, "domain": "yourdomain.com", "password": "generate"}
)
box = res.json()["data"][0]
print(f"Address: {box['address']} | Webmail Password: {box['password']}")
Node.js / JavaScript
const res = await fetch("https://draxon.one/api/mail/v1/mailboxes", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ count: 1, domain: "yourdomain.com", password: "generate" }),
});
const { data } = await res.json();
console.log(`Address: ${data[0].address} | Password: ${data[0].password}`);
Endpoint 3: List Mailbox Messages
Fetch all messages received by a specific address.
- Method:
GET - URL:
https://draxon.one/api/mail/v1/mailboxes/{address}/messages - Note: Always URL-encode the address path parameter (e.g.
worker%40yourdomain.com).
Success Response (200 OK)
{
"data": [
{
"id": "9b1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
"mailbox_id": "df9f303f-137d-4e49-b6b8-2c9b80b59f1d",
"address": "[email protected]",
"from": "Discord <[email protected]>",
"from_address": "[email protected]",
"subject": "Your Discord verification code is 482913",
"preview": "Your security code is 482913...",
"codes": ["482913"],
"links": ["https://discord.com/verify?token=abc123xyz"],
"received_at": "2026-10-12T16:05:00Z",
"expires_at": "2026-11-11T16:05:00Z"
}
],
"next_cursor": null
}
Error Responses
401 invalid_api_key: Unauthorized.404 not_found: Mailbox address does not exist or does not belong to your account.
cURL
curl -s -H "Authorization: Bearer $DRAXON_KEY" \
"https://draxon.one/api/mail/v1/mailboxes/worker%40yourdomain.com/messages"
Python
import requests, urllib.parse
addr = urllib.parse.quote("[email protected]")
res = requests.get(
f"https://draxon.one/api/mail/v1/mailboxes/{addr}/messages",
headers={"Authorization": f"Bearer {API_KEY}"}
)
messages = res.json()["data"]
print(f"Total messages: {len(messages)}")
Node.js / JavaScript
const addr = encodeURIComponent("[email protected]");
const res = await fetch(`https://draxon.one/api/mail/v1/mailboxes/${addr}/messages`, {
headers: { Authorization: `Bearer ${API_KEY}` }
});
const { data } = await res.json();
console.log(`Received ${data.length} messages.`);
Endpoint 4: Wait for Message (Long-Polling)
Hold the HTTP connection open until a new message arrives, or until the timeout expires. Avoids wasteful polling loops.
- Method:
GET - URL:
https://draxon.one/api/mail/v1/mailboxes/{address}/messages/wait - Query Parameters:
timeout: Seconds to wait (0 to 60, default: 30). Set0for immediate non-blocking check.from: Optional sender filter (e.g.discord.com).subject: Optional subject text filter.
Success Response (Message Arrived - 200 OK)
{
"message": {
"id": "9b1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
"mailbox_id": "df9f303f-137d-4e49-b6b8-2c9b80b59f1d",
"address": "[email protected]",
"from": "Service <[email protected]>",
"from_address": "[email protected]",
"subject": "Your verification code is 918234",
"preview": "Welcome! Use code 918234 to complete registration...",
"codes": ["918234"],
"links": ["https://service.com/confirm?id=918234"],
"received_at": "2026-10-12T16:07:22Z"
}
}
Success Response (Timeout - 200 OK)
If no matching message arrives within the specified timeout:
{
"message": null
}
Error Responses
400 bad_request: Invalid timeout value (must be integer between 0 and 60).401 invalid_api_key: Unauthorized.404 not_found: Mailbox does not exist.
cURL
curl -s -H "Authorization: Bearer $DRAXON_KEY" \
"https://draxon.one/api/mail/v1/mailboxes/worker%40yourdomain.com/messages/wait?timeout=60"
Python
import requests, urllib.parse
addr = urllib.parse.quote("[email protected]")
res = requests.get(
f"https://draxon.one/api/mail/v1/mailboxes/{addr}/messages/wait?timeout=60",
headers={"Authorization": f"Bearer {API_KEY}"}
)
data = res.json()
if data.get("message"):
print("OTP:", data["message"]["codes"][0])
else:
print("Timed out.")
Node.js / JavaScript
const addr = encodeURIComponent("[email protected]");
const res = await fetch(`https://draxon.one/api/mail/v1/mailboxes/${addr}/messages/wait?timeout=60`, {
headers: { Authorization: `Bearer ${API_KEY}` }
});
const { message } = await res.json();
if (message) {
console.log("OTP Code:", message.codes[0]);
} else {
console.log("Timeout.");
}
3. Read an Anonymous Inbox (No Auth)
An inbox created with POST /api/mail/v1/public/random has no owner, so it is read through the
public routes and no API key is needed. The routes without public/ (Endpoints 2–4 above)
belong to inboxes owned by your account and always need your key.
| Purpose | Anonymous inbox (no key) | Account inbox (API key) |
|---|---|---|
| Create | POST /api/mail/v1/public/random |
POST /api/mail/v1/mailboxes |
| List messages | GET /api/mail/v1/public/mailboxes/{address}/messages |
GET /api/mail/v1/mailboxes/{address}/messages |
| Wait for a message | GET /api/mail/v1/public/mailboxes/{address}/messages/wait?timeout=30 |
GET /api/mail/v1/mailboxes/{address}/messages/wait?timeout=30 |
Responses have the same shape as the account routes (data, next_cursor; message for wait).
Anonymous inboxes expire after 60 minutes.
ADDR=$(curl -s -X POST https://draxon.one/api/mail/v1/public/random | jq -r .address)
curl -s "https://draxon.one/api/mail/v1/public/mailboxes/$ADDR/messages/wait?timeout=30"
3. Extracted OTP Codes & Verification Links
Every incoming email is automatically parsed by the Draxon ingestion engine:
codes: Arrays of extracted 4 to 8 digit numbers, or alphanumeric PINs located near keywords like “code”, “verify”, “security code”, or “OTP”.links: Array of complete clickable URLs found within HTML or plain text bodies.
4. Full Developer SDK Implementations
Python SDK (Supports Public Pool & Custom Domain)
import os
import requests
import urllib.parse
API_KEY = os.environ.get("DRAXON_KEY")
BASE_URL = "https://draxon.one/api"
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
def create_and_wait(custom_domain: str = None, prefix: str = "bot"):
"""
Creates a mailbox on public pool or custom domain,
prints /mail/login credentials, and waits for incoming OTP.
"""
# 1. Build Creation Payload
payload = {
"count": 1,
"password": "generate",
"prefix": prefix
}
if custom_domain:
payload["domain"] = custom_domain
# 2. Create Mailbox
res = requests.post(f"{BASE_URL}/mail/v1/mailboxes", json=payload, headers=HEADERS)
if res.status_code != 201:
raise RuntimeError(f"Failed to create mailbox: {res.text}")
mailbox_data = res.json()["data"][0]
address = mailbox_data["address"]
password = mailbox_data["password"]
print("=" * 60)
print(f"Created Address: {address}")
print(f"Webmail Access: https://draxon.one/mail/login")
print(f"Webmail Password: {password}")
print("=" * 60)
# 3. Wait for email (long-poll up to 60s)
print("Waiting for incoming email...")
encoded_addr = urllib.parse.quote(address)
wait_url = f"{BASE_URL}/mail/v1/mailboxes/{encoded_addr}/messages/wait?timeout=60"
wait_res = requests.get(wait_url, headers=HEADERS)
wait_res.raise_for_status()
message = wait_res.json().get("message")
if not message:
print("Timeout: No email received within 60 seconds.")
return None
print(f"Received from: {message['from_address']}")
print(f"Subject: {message['subject']}")
print(f"Extracted OTPs: {message['codes']}")
print(f"Verification Links: {message['links']}")
return message["codes"][0] if message["codes"] else None
if __name__ == "__main__":
# Example A: Shared Public Pool Address
otp = create_and_wait()
print("Result OTP:", otp)
# Example B: Custom Domain Address (configured in your dashboard)
# otp_custom = create_and_wait(custom_domain="yourdomain.com", prefix="agent")
Node.js / TypeScript SDK
import urllib from "node:querystring";
const API_KEY = process.env.DRAXON_KEY;
const BASE_URL = "https://draxon.one/api";
const headers = {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
};
interface MailboxItem {
id: string;
address: string;
password: string | null;
}
interface MessageItem {
id: string;
from_address: string;
subject: string;
codes: string[];
links: string[];
}
export async function fetchVerificationCode(customDomain?: string, prefix = "worker"): Promise<string | null> {
// 1. Generate mailbox
const createPayload: Record<string, unknown> = {
count: 1,
password: "generate",
prefix,
};
if (customDomain) {
createPayload.domain = customDomain;
}
const createRes = await fetch(`${BASE_URL}/mail/v1/mailboxes`, {
method: "POST",
headers,
body: JSON.stringify(createPayload),
});
if (!createRes.ok) {
const errText = await createRes.text();
throw new Error(`Mailbox creation failed: ${errText}`);
}
const { data } = (await createRes.json()) as { data: MailboxItem[] };
const { address, password } = data[0];
console.log(`Address: ${address}`);
console.log(`Webmail Login: https://draxon.one/mail/login (Password: ${password})`);
// 2. Wait for incoming message (long-poll 60s)
const encodedAddress = encodeURIComponent(address);
const waitUrl = `${BASE_URL}/mail/v1/mailboxes/${encodedAddress}/messages/wait?timeout=60`;
const waitRes = await fetch(waitUrl, { headers });
if (!waitRes.ok) {
throw new Error(`Wait request failed: ${await waitRes.text()}`);
}
const { message } = (await waitRes.json()) as { message: MessageItem | null };
if (!message) {
console.log("No email received before timeout.");
return null;
}
console.log(`Email Subject: ${message.subject}`);
console.log(`Extracted Codes: ${message.codes.join(", ")}`);
return message.codes[0] ?? null;
}
// fetchVerificationCode(); // Public pool
// fetchVerificationCode("yourdomain.com"); // Custom domain
5. Webhook Alerts
If you run high-volume background pipelines and prefer push notifications over long-polling:
- Navigate to Integrations > Webhooks in your dashboard.
- Add your webhook URL and subscribe to
mail.message.received. - Incoming emails are POSTed directly to your server as soon as they are processed.