Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tempinbox.dev/llms.txt

Use this file to discover all available pages before exploring further.

List emails

GET /api/mails?limit=20&offset=0 Returns emails for the authenticated address, newest first.
ParameterTypeRequiredMaxDescription
limitintegerYes100Number of emails to return
offsetintegerYesPagination offset
curl "https://tempinbox.dev/api/mails?limit=20&offset=0" \
  -H "Authorization: Bearer <jwt>"
Response
{
  "results": [
    {
      "id": 42,
      "uuid": "550e8400-e29b-41d4-a716-446655440000",
      "source": "[email protected]",
      "address": "[email protected]",
      "metadata": "{\"subject\":\"Your verification code is 847291\"}",
      "created_at": "2026-05-28T10:00:00Z",
      "message_id": "<[email protected]>"
    }
  ],
  "count": 1
}
For polling, call GET /api/mails?limit=1&offset=0 repeatedly until count > 0. Add a delay of 2–5 seconds between polls to avoid rate limiting.

Get a single email

GET /api/mail/:uuid Returns the full email including the raw RFC 2822 body. Parse raw client-side to extract subject, body HTML, and attachments.
curl "https://tempinbox.dev/api/mail/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer <jwt>"
Response
{
  "id": 42,
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "source": "[email protected]",
  "address": "[email protected]",
  "raw": "From: [email protected]\r\nTo: [email protected]\r\nSubject: Your code\r\n\r\n847291",
  "metadata": "{\"subject\":\"Your code\"}",
  "created_at": "2026-05-28T10:00:00Z",
  "message_id": "<[email protected]>"
}

Extracting a verification code

const mail = await getMail(uuid);
const code = mail.raw.match(/\b\d{6}\b/)?.[0]; // extract 6-digit OTP

Delete an email

DELETE /api/mails/:uuid Soft-deletes a single email. Returns immediately.
curl -X DELETE \
  "https://tempinbox.dev/api/mails/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer <jwt>"

Clear inbox

DELETE /api/clear_inbox Deletes all emails in the inbox at once.
curl -X DELETE https://tempinbox.dev/api/clear_inbox \
  -H "Authorization: Bearer <jwt>"
Response
{ "success": true }