Temporary Email API
Zero-setup disposable email API built for AI agents, E2E signup tests, and custom-domain catch-all workflows. No mailbox creation step — mail buffers the instant SMTP accepts it.
https://api.mail.cx/v1x-api-token: tm_live_...Quickstart
Mint keys in Dashboard → Tokens# 1. Discover available system domains (requires Pro API token on api.mail.cx)
TOKEN="tm_live_your_api_key"
curl -s "https://api.mail.cx/v1/config" -H "x-api-token: $TOKEN"
# 2. Pick any valid address — mailboxes are implicit (no create call needed)
ADDR="agent-test-01@uqu.me"
# 3. Wait up to 25 s for a matching message (returns 200 immediately on arrival, 204 on timeout)
curl -s "https://api.mail.cx/v1/inbox/$ADDR?subject=Verify" \
-H "x-api-token: $TOKEN"
# 4. Fetch the full parsed email (text_body, html_body, attachments)
curl -s "https://api.mail.cx/v1/email/<id>" \
-H "x-api-token: $TOKEN"
# Optional: pass ?wait=0 for an instant non-blocking snapshot
curl -s "https://api.mail.cx/v1/inbox/$ADDR?wait=0" \
-H "x-api-token: $TOKEN"Endpoints
Mailboxes & Messages
Mailboxes are implicit — send mail to any valid local-part on a system or verified custom domain and read it directly.
/v1/configList active system domains (including Pro-only domains) and local-part validation rules.
/v1/inbox/:addressLong-poll (default 25 s) or instant snapshot (?wait=0) for a single email address.
/v1/inbox/:addressDelete all messages currently stored at the address.
/v1/email/:idFetch full parsed message: headers, text_body, html_body, and attachment metadata.
/v1/email/:id/rawStream the original RFC 822 .eml message.
/v1/email/:id/attachments/:indexDownload a binary attachment by zero-based index.
/v1/email/:idPermanently delete a single message (204 No Content).
Catch-All & Real-Time Streams
Cross-address feeds (/v1/domain/:domain, /v1/me, /v1/sse/user) stream mail delivered to your verified custom domains.
/v1/domain/:domainCatch-all long-poll (or ?wait=0 snapshot) across every address under your custom domain.
/v1/meUnified long-poll across all verified custom domains on your account (includes `to` & `created_at`).
/v1/sse/addr?address=&token=Server-Sent Events push stream for a single address (`event: email`).
/v1/sse/user?token=Server-Sent Events push stream across all owned custom domains.
Custom Domains & API Keys
/v1/domainsRegister a custom domain (`{"domain":"mail.example.com"}`); returns TXT & MX records.
/v1/domainsList custom domains with `verify_status` (`pending`, `verified`, `failed`) and `mx_configured`.
/v1/domains/:idRemove a custom domain and purge its routing entry.
/v1/tokensMint a new `tm_live_...` API key (`{"name":"ci-suite"}`); plaintext returned once.
/v1/tokensList active API keys (prefix, name, created_at, last_used_at).
/v1/tokens/:idImmediately revoke an API key.
Long-Polling & Query Parameters
/v1/inbox/:address, /v1/domain/:domain, and /v1/me share one unified query interface. By default, requests hold for up to 25 seconds and wake up within milliseconds via NATS as soon as matching mail lands — eliminating client polling loops. Pass ?wait=0 whenever you want an immediate non-blocking snapshot instead.
| Param | Default | Description |
|---|---|---|
| wait | 25 | Hold time in seconds (0–25). Default 25 blocks until mail arrives (200) or returns 204 after 25 s. Pass ?wait=0 for an immediate non-blocking 200 snapshot. |
| since | "" | Opaque cursor from the previous response’s next_since; returns strictly newer messages. |
| count | 1 | Return early only once at least N matching messages have arrived (1–50). |
| limit | 20 | Maximum number of messages returned in a single response (1–50). |
| from | — | Case-insensitive substring match against the From header. |
| subject | — | Case-insensitive substring match against the Subject header. |
200 OK){
"emails": [
{
"id": "019670a4f2c8...",
"to": "agent@uqu.me",
"from_name": "GitHub",
"from_email": "noreply@github.com",
"subject": "Your verification code",
"preview_text": "Use 842910 to verify...",
"size": 4182,
"created_at": "2026-11-26T05:30:12Z"
}
],
"next_since": "1795671012"
}GET /v1/email/:id){
"id": "019670a4f2c8...",
"from": "GitHub <noreply@github.com>",
"from_name": "GitHub",
"from_email": "noreply@github.com",
"to": "agent@uqu.me",
"subject": "Your verification code",
"text_body": "Use 842910 to verify...",
"html_body": "<p>Use <b>842910</b>...</p>",
"attachments": [
{ "index": 0, "filename": "invite.ics", "content_type": "text/calendar", "size": 912 }
],
"created_at": "2026-11-26T05:30:12Z"
}Custom Domain DNS Setup
Connect up to 100 custom domains via POST /v1/domains or the web dashboard, then publish two DNS records:
Background verification runs every 5 minutes; unverified domains expire after 72 hours.
Throughput & Retention
- 10 requests / second sliding-window per API key (no daily or monthly request cap).
- Concurrency: 1 active long-poll wait per API token (use
/v1/meor/v1/domain/:domainto watch unlimited addresses over one connection); up to 10 concurrent waits per address. - Retention: Pro messages stay readable for 72 hours before automatic Redis + blob purge.
Status & Error Codes
All errors return {"error": "<code>"} with standard HTTP status codes (Retry-After is included on 429 responses).
| HTTP | Error Code(s) | Meaning |
|---|---|---|
| 400 | invalid_address · invalid domain format | Malformed address, invalid domain syntax, or negative attachment index. |
| 401 | authentication_required · invalid_token | Missing, revoked, or malformed x-api-token header. |
| 403 | plan_required · quota_exceeded · account_disabled | Active Pro plan required for api.mail.cx, or domain/token cap (100) reached. |
| 404 | not_found · domain_not_found · attachment_not_found | Message expired/missing, or domain is unverified / owned by another account. |
| 409 | domain_already_exists | Custom domain is already registered. |
| 410 | email_expired | Message body TTL expired before download. |
| 429 | rate_limit_exceeded · token_busy · addr_busy | Exceeded 10 req/s per token, 1 concurrent long-poll per token, or 10 per address. |
| 503 | sse_unavailable | Real-time broker temporarily unavailable; retry with backoff. |