Lumbox Docs

Emails

Read emails, wait for new ones, extract OTPs.

Emails

List Emails

GET /v1/inboxes/:id/emails

Returns all emails in an inbox, newest first.

{
  "emails": [
    {
      "id": "eml_xyz789",
      "inbox_id": "inb_abc123",
      "from": "noreply@github.com",
      "to": ["github-bot@lumbox.co"],
      "subject": "Your verification code",
      "text_body": "Your code is 847291",
      "parsed": {
        "otp_codes": ["847291"],
        "verification_links": [],
        "category": "verification"
      },
      "received_at": "2025-01-01T00:01:00.000Z"
    }
  ]
}

Wait for Email

GET /v1/inboxes/:id/wait?timeout=60

Long-polls until a new email arrives or timeout (in seconds). No polling loops needed — one request, one response.

ParamTypeDefaultDescription
timeoutnumber30Max seconds to wait
fromstringFilter by sender
subjectstringFilter by subject keyword

Get OTP

GET /v1/inboxes/:id/otp?timeout=60

Waits for an email containing an OTP code and returns just the code. The simplest way to get a verification code.

ParamTypeDefaultDescription
timeoutnumber30Max seconds to wait
fromstringFilter by sender
{
  "otp": "847291",
  "email_id": "eml_xyz789",
  "from": "noreply@github.com",
  "subject": "Your verification code"
}

Get Email

GET /v1/emails/:id

Delete Email

DELETE /v1/emails/:id

Search Emails

GET /v1/emails/search?q=github&inbox_id=inb_abc123

Search across emails by keyword, sender, or category.