> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerodrop.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch emails for an inbox

> Returns all emails currently stored for the given inbox name. Emails expire after 30 minutes. Returns an empty array if the inbox has no emails or has expired.



## OpenAPI

````yaml /openapi.json get /api/inbox/{name}
openapi: 3.1.0
info:
  title: ZeroDrop API
  version: 1.0.0
  description: >-
    Disposable email inboxes for CI pipelines. No signup. No Docker. No SMTP
    config.


    Base URL: `https://zerodrop.dev`


    The ZeroDrop API is a REST API that allows you to fetch emails from
    disposable inboxes. Inboxes are generated client-side — no API call needed
    to create one. Emails are stored for 30 minutes then automatically deleted.


    For most use cases, use the [zerodrop-client
    SDK](https://npmjs.com/package/zerodrop-client) which handles polling, SSE,
    and OTP extraction automatically.
  contact:
    email: support@zerodrop.dev
    url: https://zerodrop.dev/contact
  license:
    name: MIT
    url: https://github.com/zerodrop-dev/zerodrop-sdk/blob/master/LICENSE
servers:
  - url: https://zerodrop.dev
    description: Production
security: []
tags:
  - name: Inbox
    description: Fetch and stream emails from disposable inboxes.
  - name: Waitlist
    description: Join the Workspaces waitlist.
paths:
  /api/inbox/{name}:
    get:
      tags:
        - Inbox
      summary: Fetch emails for an inbox
      description: >-
        Returns all emails currently stored for the given inbox name. Emails
        expire after 30 minutes. Returns an empty array if the inbox has no
        emails or has expired.
      operationId: getInbox
      parameters:
        - name: name
          in: path
          required: true
          description: >-
            The inbox name (without the domain). Example: `swift-x7k2m` for
            `swift-x7k2m@zerodrop-sandbox.online`
          schema:
            type: string
            example: swift-x7k2m
        - name: source
          in: query
          required: false
          description: >-
            Identifies the client making the request. Use `sdk` for programmatic
            access.
          schema:
            type: string
            enum:
              - browser
              - sdk
            default: browser
      responses:
        '200':
          description: Emails fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxResponse'
              example:
                emails:
                  - id: <CALMkwzNSLxzko58@mail.gmail.com>
                    from: noreply@yourapp.com
                    to: swift-x7k2m@zerodrop-sandbox.online
                    subject: Verify your email
                    body: >-
                      Click here to verify your email:
                      https://yourapp.com/verify?token=abc123
                    rawBody: ...
                    receivedAt: '2026-06-17T10:23:30.356Z'
                    otp: null
                    magicLink: https://yourapp.com/verify?token=abc123
                count: 1
        '429':
          description: >-
            Rate limit exceeded. Free tier allows 20 requests per 10 seconds per
            IP.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Too many requests. Slow down.
components:
  schemas:
    InboxResponse:
      type: object
      properties:
        emails:
          type: array
          items:
            $ref: '#/components/schemas/Email'
          description: Array of emails, sorted by most recent first.
        count:
          type: integer
          description: Total number of emails in the inbox.
          example: 1
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Too many requests. Slow down.
    Email:
      type: object
      properties:
        id:
          type: string
          description: Unique message ID from the email headers (Message-ID).
          example: <CALMkwzNSLxzko58@mail.gmail.com>
        from:
          type: string
          description: Sender email address.
          example: noreply@yourapp.com
        to:
          type: string
          description: Recipient email address (the disposable inbox).
          example: swift-x7k2m@zerodrop-sandbox.online
        subject:
          type: string
          description: Email subject line.
          example: Verify your email
        body:
          type: string
          description: Parsed plain-text body (first 5000 characters).
          example: 'Click here to verify: https://yourapp.com/verify?token=abc123'
        rawBody:
          type: string
          description: Full raw MIME message.
        receivedAt:
          type: string
          format: date-time
          description: UTC timestamp when the email was received.
          example: '2026-06-17T10:23:30.356Z'
        otp:
          type: string
          nullable: true
          description: >-
            Auto-extracted OTP code (4-8 digits). Extracted at the edge before
            the email is stored. null if not detected.
          example: '123456'
        magicLink:
          type: string
          nullable: true
          description: >-
            Auto-extracted verification or reset URL. Detected for URLs
            containing verify, confirm, reset, token, activate, or auth. null if
            not detected.
          example: https://yourapp.com/verify?token=abc123

````