temp-mail.agency
Developer API · 8 min read

Free Temp Mail REST API: endpoints & QA guide.

Complete guide to the free zero-key temp-mail.agency REST API (/api/v1): endpoints, .com/.org.uk/.edu.pl pools, auto OTP extraction & Playwright/Python code.

Why zero-key REST endpoints beat tiered QA mail walls

Automated authentication tests break constantly when teams share one static Gmail account across parallel CI jobs. Yet many disposable email providers lock even basic JSON polling behind RapidAPI subscriptions, rigid monthly credit tiers, or opaque per-request pricing.

temp-mail.agency REST API strips away that friction. Any CI runner, Playwright test, or Python script can call https://temp-mail.agency/api/v1 directly — generating isolated mailboxes per test case, pulling structured OTP JSON in one GET call, and burning mailboxes cleanly on teardown.

Complete /api/v1 endpoint reference

Method & PathRequest Payload / ParamsResponse Highlights
GET /api/v1/domainsOptional ?provider=tempmail|orgmail|edumailLive .com, .org.uk & .edu.pl pools
POST /api/v1/inboxes{ provider, alias?, domain_id?, ttl? }Returns address, inbox_id & recovery_token
POST /api/v1/inboxes/restore{ recovery_token }Reopens an existing signed tma_v1 mailbox
PATCH /api/v1/inboxes/:id/ttl{ ttl: "10m"|"1h"|"24h"|"7d"|"never" }Extends inbox expiration cleanly
GET /api/v1/inboxes/:id/messagesSigned :idFull text, HTML, attachments, OTPs & security audit
GET /api/v1/inboxes/:id/codeSigned :idNewest 4–8 digit OTP code & confirmation URL
DELETE /api/v1/inboxes/:idSigned :idDeletes the mailbox immediately

Machine-readable service discovery is also published at /.well-known/api-catalog following RFC 9727 linkset conventions.

Quickstart in cURL and Python

quickstart.sh
# 1. Provision a fresh isolated inbox
INBOX=$(curl -s -X POST https://temp-mail.agency/api/v1/inboxes   -H "Content-Type: application/json"   -d '{"provider":"tempmail","ttl":"10m"}')
echo "$INBOX"

# 2. Extract the newest OTP code or verification link
curl -s "https://temp-mail.agency/api/v1/inboxes/YOUR_INBOX_ID/code"

# 3. Tear down after test completes
curl -s -X DELETE "https://temp-mail.agency/api/v1/inboxes/YOUR_INBOX_ID"

Need full Playwright TypeScript and Python pytest polling fixtures with exponential backoff? Follow our step-by-step Playwright & Python Email Testing Tutorial.

temp-mail.agency REST API vs. paid tiered providers

  • No credit card or RapidAPI gate: Start sending requests immediately from GitHub Actions, GitLab CI, or local scripts.
  • Built-in OTP & magic-link extraction: Skip brittle HTML regex scraping — /code filters out CSS hex codes, table widths, and copyright years automatically.
  • Three live domain pools: Test how your own signup validator handles .com, organization .org.uk, and academic .edu.pl addresses via the provider field.
  • Responsible polling etiquette: Poll every 3–5 seconds with a sensible 45–60 second timeout rather than tight sub-second loops, and always call DELETE on teardown.
Interactive testing: Try every /api/v1 endpoint directly in your browser without writing a single line of code inside our live API Playground.

REST API vs. MCP Server: choosing the right interface

Use the REST API (/api/v1) inside deterministic CI suites (Playwright, Cypress, pytest, Go, Postman) where your test code controls every HTTP call. Use our hosted MCP Server (/mcp) when autonomous AI agents (Claude Code, Cursor, ChatGPT, Gemini, Grok Bot) decide dynamically when to spin up a test inbox and extract a code.

Key Takeaway

The temp-mail.agency REST API (/api/v1) provides zero-signup, receive-only disposable inboxes with built-in OTP extraction, attachment normalization, and tracker analysis across live .com, .org.uk, and .edu.pl domains. Unlike tiered competitor APIs that paywall basic polling or custom handles, /api/v1 is open immediately for QA automation.

Continue reading

Related engineering guides

Questions

Frequently asked

Is an API key required for /api/v1 endpoints?

No. The public /api/v1 REST endpoints work immediately without signup for QA and testing workflows. Google sign-in at /signup is only required for the hosted AI MCP server (/mcp).

Can I pick a custom username or specific domain via the REST API?

Yes. First call GET /api/v1/domains to retrieve live domain IDs across tempmail (.com), orgmail (.org.uk), and edumail (.edu.pl), then pass alias and domain_id to POST /api/v1/inboxes.

Does GET /api/v1/inboxes/:id/messages return attachments and security scores?

Yes. Every message object includes cleaned plain text, raw HTML, normalized attachments, extracted OTP details, and tracker/phishing security risk metadata.

How often should automated CI tests poll for incoming emails?

Poll every 3 to 5 seconds up to a 60-second ceiling, and call DELETE /api/v1/inboxes/:id in a finally block when your test finishes.

Need more answers? Browse all 30 topics in the Complete temp-mail.agency FAQ.