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.
- 1POST /accounts creates a mailbox with a random address and password.
- 2POST /token exchanges the address and password for a tm_box_ mailbox token.
- 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,…}