API guide
Temp Mail API Tutorial
Suavite exposes a REST API for automated tests, signup verification, and internal tools. This walkthrough covers the minimum flow: create a mailbox, receive mail, and extract a verification code.
Prepare an API key
Sign in and create a key on the API Keys page. Each account can keep at most 3 active keys. The key is shown once at creation; store it in a server-side environment variable or secret manager.
Never put the key in frontend code, a public repository, or a screenshot. Send requests from your server and use the Authorization: Bearer or X-API-Key header.
Create a temp mailbox
localPart is optional; omit it to get a random address. expiresIn is in seconds and must be between 60 and 86400. The response's data.id is the mailbox ID for later reads, and data.address is the actual address.
Create a separate mailbox per task. Reusing one address across flows mixes unrelated messages and makes parsing unreliable.
curl -X POST "https://suavite.de/api/v1/mailboxes" \
-H "Authorization: Bearer $SUAVITE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"localPart":"signup-demo","expiresIn":600}'Poll messages and extract the code
The list endpoint returns summaries and cursor pagination; the detail endpoint returns the full message. The server attempts to extract verificationCode and verificationLink, but templates vary widely, so keep a regex or manual fallback in production.
Do not replace polling with a fixed sleep. Start at 5–10 second intervals, stop as soon as mail arrives, and slow down after several empty checks.
curl "https://suavite.de/api/v1/mailboxes/MAILBOX_ID/messages?limit=20" \
-H "Authorization: Bearer $SUAVITE_API_KEY"
curl "https://suavite.de/api/v1/mailboxes/MAILBOX_ID/messages/MESSAGE_ID" \
-H "Authorization: Bearer $SUAVITE_API_KEY"Limits and error handling
- Defaults are 30 API requests per minute and 1,000 per day; check your account page and /api/config for current values.
- On 429, read Retry-After and wait before retrying.
- On 503, use exponential backoff and check service status; failed requests may still consume quota.
- Each account can keep up to 100 active mailboxes. Delete messages you no longer need or let the mailbox expire.
Pre-launch checklist
- Keys live only on the server and are never printed in full in logs.
- Set limits for creation, polling, and total timeout so jobs cannot hang forever.
- Record the message ID and template pattern when extraction fails.
- Follow the target site's terms and do not use the API for bulk abuse or bypassing risk controls.