Public REST API

Build automation against MailTempo without parsing the UI. The v1 API is read-only, CORS-enabled, and returns JSON. No auth required — every inbox is public and rate limits apply per IP.

Quick start

# 1. Generate a fresh local-part
curl -X POST https://mailtempo.com/api/v1/generate
# {"localPart":"k8d2a91zxq"}

# 2. Use it as an email address (k8d2a91zxq@<domain>) in a signup form.

# 3. Poll the inbox
curl https://mailtempo.com/api/v1/inboxes/<domain>/k8d2a91zxq
# {"address":"k8d2a91zxq@<domain>","messages":[{"id":"...","otp":"123456",...}]}

Endpoints

  • GET/api/v1/domains

    List active catchall domains.

    curl https://mailtempo.com/api/v1/domains
  • POST/api/v1/generate

    Return a freshly generated random local-part.

    curl -X POST https://mailtempo.com/api/v1/generate
  • GET/api/v1/inboxes/{domain}/{localPart}

    List the latest 100 messages for an inbox. Each message includes a detected `otp` when present.

    curl https://mailtempo.com/api/v1/inboxes/example.com/jdoe
  • GET/api/v1/inboxes/{domain}/{localPart}/messages/{id}

    Fetch a single message — sanitized HTML, plain text, headers, attachments, and OTP.

    curl https://mailtempo.com/api/v1/inboxes/example.com/jdoe/messages/abc123def456
  • GET/api/v1/inboxes/{domain}/{localPart}/messages/{id}/raw

    Fetch the raw RFC 822 source. Append `?download=1` to force a .eml file download.

    curl https://mailtempo.com/api/v1/inboxes/example.com/jdoe/messages/abc123def456/raw

Notes

  • All inboxes are public. Anyone with the address can read the contents. Pick long random local-parts for practical privacy.
  • Mail history is retained for 60 days; older messages are pruned automatically.
  • Polling guidance: the Gmail backend is synced once a minute, so polling more often than every 10–15 seconds doesn't reveal newer mail.
  • The detected otp field is a best-effort heuristic (numeric and alphanumeric verification codes). Always cross-check against the full message body for high-stakes flows.
  • Rate limits are per IP. A 429 response includes a Retry-After header in seconds.