Developer

Build with the TempMail API

Create inboxes and read verification codes over HTTP. Start right away without an account, or create an API key to unlock Pro features.

No login · No API key

Start now, anonymously

The same API that powers the TempMail web app. Every mailbox gets a random address and lives for 24 hours.

  1. 1POST /accounts creates a mailbox with a random address and password.
  2. 2POST /token exchanges the address and password for a tm_box_ mailbox token.
  3. 3GET /messages returns incoming mail with verification codes already extracted.
BASE=https://www.tempmail.ai/api/v1

# 1. Create a mailbox (random address + password)
curl -s -X POST "$BASE/accounts" \
  -H "Content-Type: application/json" -d '{}'
# {"id":"…","address":"k3x9m2q7…@tempmail.ai","password":"…","expires_at":"…"}

# 2. Exchange the credentials for a mailbox token
curl -s -X POST "$BASE/token" \
  -H "Content-Type: application/json" \
  -d '{"address":"ADDRESS","password":"PASSWORD"}'
# {"id":"…","token":"tm_box_…","token_type":"Bearer","expires_at":"…"}

# 3. Read messages – verification codes are already extracted
curl -s "$BASE/messages" -H "Authorization: Bearer TOKEN"
# {"items":[{"from":"[email protected]","subject":"Your verification code","verification_code":"482913",…}],"total":1,…}
Read the full API reference
Pro

API key for Pro features

A tm_live_ API key belongs to your TempMail account. While your account is on Pro, the same key automatically unlocks:

  • Custom addresses: send POST /accounts with your key and an "address" field
  • Higher limits: 20 requests/second and 1000 new mailboxes per day
  • Up to 10 private addresses that don't expire
  • 30-day mail retention and 100 MB of storage

Free accounts can create a key too. It works like the anonymous API until you upgrade, with no code changes needed.