[ Use Cases ]

What teams build
with SpawnMail

From autonomous agent sign-ups to CI pipeline testing — every workflow where machines need email.

01

Agent sign-ups &
OTP extraction

Your AI agent needs to create accounts on third-party services. That means email verification, OTP codes, and confirmation links. SpawnMail gives each agent run a fresh inbox, waits for the verification email, and hands back structured data your agent can act on.

  • Fresh inbox per sign-up attempt — no shared state
  • Long-poll /wait blocks until email arrives
  • Structured JSON — parse OTP without regex hacks
  • Auto-destroy after use — zero data residue
Python
import requests

# 1. SpawnMail a disposable inbox
inbox = requests.post("/inboxes",
    headers={"x-api-key": KEY}
).json()

# 2. Use it to sign up
agent.create_account(email=inbox["address"])

# 3. Wait for verification email
email = requests.get(
    f"/inboxes/{inbox['id']}/wait",
    headers={"x-api-key": KEY}
).json()

# 4. Extract OTP and verify
otp = extract_code(email["body_text"])
agent.verify(code=otp)

# 5. Clean up
requests.delete(f"/inboxes/{inbox['id']}",
    headers={"x-api-key": KEY}
)
02

QA & E2E
testing

Every test run gets a fresh inbox. No more shared test@company.com mailboxes with flaky state from previous runs. SpawnMail integrates into your CI pipeline so email-dependent tests are deterministic and parallelizable.

  • One inbox per test — fully isolated, no flakes
  • Parallel test suites with zero inbox contention
  • CLI integration for shell-based CI pipelines
  • TTL auto-cleanup — no orphaned test data
CI Pipeline
# In your test setup
$ INBOX=$(spawnmail create --json | jq -r '.address')

# Run your E2E test
$ playwright test --env TEST_EMAIL=$INBOX

# In the test: wait for password reset email
$ spawnmail wait $INBOX_ID --timeout 30
→ { subject: "Reset your password" }

# Extract the reset link
$ spawnmail read $INBOX_ID --json \
    | jq -r '.body_html' \
    | grep -oP 'href="\K[^"]*reset[^"]*'

# Teardown
$ spawnmail destroy $INBOX_ID
03

Multi-tenant
workflows

Run multiple agents with complete data isolation. Each customer, each workflow, each agent gets its own inbox namespace. No cross-contamination, no shared state, no accidental data leaks between tenants.

  • Per-inbox passwords for tenant isolation
  • Custom domains per customer (Cloud Pro)
  • Cascade-delete purges all tenant data atomically
  • Self-host for full data residency control
Python
# Provision inbox per tenant workflow
def run_agent_for_tenant(tenant_id: str):
    inbox = requests.post("/inboxes",
        json={
            "ttl_seconds": 3600,
            "password": tenant_secrets[tenant_id]
        },
        headers={"x-api-key": KEY}
    ).json()

    # Agent operates with isolated inbox
    result = agent.execute(
        email=inbox["address"],
        tenant=tenant_id
    )

    # TTL auto-cleans, or destroy now
    requests.delete(
        f"/inboxes/{inbox['id']}",
        headers={"x-api-key": KEY}
    )
    return result
04

Notification
processing

Agents that monitor email notifications — order confirmations, shipping updates, security alerts. SpawnMail gives each monitoring agent a dedicated inbox that delivers structured data the moment something arrives.

  • Long-lived inboxes with configurable TTL
  • Webhooks for real-time event-driven processing
  • Full MIME support — text, HTML, attachments
  • Self-host for compliance-sensitive notifications
Python
# Create a long-lived monitoring inbox
inbox = requests.post("/inboxes",
    json={"ttl_seconds": 86400 * 30},
    headers={"x-api-key": KEY}
).json()

# Subscribe to shipping notifications
store.set_notification_email(inbox["address"])

# Poll for new emails
while True:
    email = requests.get(
        f"/inboxes/{inbox['id']}/wait",
        params={"timeout": 120},
        headers={"x-api-key": KEY}
    ).json()

    if "shipped" in email["subject"].lower():
        agent.process_shipment(email)

Ready to give your
agents email?