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

# List folder messages

> List the messages in a folder, newest UID first (UID ascending when sinceModseq or sinceUid is set). The same state IMAP clients see: flags, UIDs and moves are shared.



## OpenAPI

````yaml https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/folders/{folder}/messages
openapi: 3.1.0
info:
  title: Inbound Email API
  description: >+

    # Inbound API


    The Inbound API allows you to manage email infrastructure programmatically -
    domains, email addresses, webhooks, and more.


    ## Authentication


    All API requests require a Bearer token in the Authorization header:


    ```bash

    curl -H "Authorization: Bearer YOUR_API_KEY" \
      https://inbound.new/api/e2/domains
    ```


    ## Base URL


    ```

    https://inbound.new/api/e2

    ```


    ## Quick Start


    1. **Create a domain** - Register your domain with Inbound

    2. **Configure DNS** - Add the provided DNS records to your domain

    3. **Create an email address** - Set up addresses to receive emails

    4. **Create an endpoint** - Configure where emails are delivered (webhook,
    forwarding, etc.)

  version: 2.0.0
servers:
  - url: https://inbound.new
    description: Production API server
security:
  - bearerAuth: []
tags:
  - name: Webhooks
    description: Webhooks sent by Inbound to your configured endpoints when events occur.
  - name: Emails
    description: >-
      Send, list, and manage emails. Supports immediate sending, scheduling,
      replies, and retry functionality.
  - name: Mail
    description: >-
      Inbox and thread views for received emails. Filter by domain, address, or
      search.
  - name: Domains
    description: >-
      Manage domains for sending and receiving emails. Domains must be verified
      via DNS before use.
  - name: Endpoints
    description: >-
      Configure where incoming emails are delivered - webhooks, email
      forwarding, or custom handlers.
  - name: Email Addresses
    description: Create and manage email addresses on your verified domains.
  - name: Attachments
    description: Download email attachments using authenticated requests.
paths:
  /api/e2/mailboxes/{id}/folders/{folder}/messages:
    get:
      tags:
        - Mailboxes
      summary: List folder messages
      description: >-
        List the messages in a folder, newest UID first (UID ascending when
        sinceModseq or sinceUid is set). The same state IMAP clients see: flags,
        UIDs and moves are shared.
      operationId: getApiE2MailboxesByIdFoldersByFolderMessages
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: folder
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            description: 1-100, default 25
            type: string
        - name: offset
          in: query
          required: false
          schema:
            description: Default 0
            type: string
        - name: sinceModseq
          in: query
          required: false
          schema:
            description: >-
              Only messages added or changed after this modseq (a previous
              response's highestModseq). Also returns UIDs removed since then in
              `expunged`. Results are ordered by UID ascending.
            type: string
        - name: sinceUid
          in: query
          required: false
          schema:
            description: >-
              Only messages with a greater UID. Results are ordered by UID
              ascending.
            type: string
        - name: unread
          in: query
          required: false
          schema:
            description: '''true'' for messages without \Seen'
            type: string
        - name: flagged
          in: query
          required: false
          schema:
            description: '''true'' for messages with \Flagged'
            type: string
        - name: search
          in: query
          required: false
          schema:
            description: >-
              Match subject, sender or recipients (received mail) or the raw
              header block (appended mail; bodies are not searched)
            type: string
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                type: object
                properties:
                  folder:
                    type: string
                  uidValidity:
                    type: number
                  uidNext:
                    type: number
                  highestModseq:
                    type: number
                  expunged:
                    description: UIDs removed after sinceModseq (empty without sinceModseq)
                    type: array
                    items:
                      type: number
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        uid:
                          type: number
                        folder:
                          type: string
                        source:
                          type: string
                          enum:
                            - received
                            - appended
                        structuredEmailId:
                          nullable: true
                          anyOf:
                            - type: string
                            - type: 'null'
                        flags:
                          type: array
                          items:
                            type: string
                        isRead:
                          type: boolean
                        isFlagged:
                          type: boolean
                        modseq:
                          type: number
                        internalDate:
                          format: date-time
                          type: string
                        size:
                          nullable: true
                          anyOf:
                            - type: number
                            - type: 'null'
                        messageId:
                          nullable: true
                          anyOf:
                            - type: string
                            - type: 'null'
                        threadId:
                          nullable: true
                          anyOf:
                            - type: string
                            - type: 'null'
                        subject:
                          nullable: true
                          anyOf:
                            - type: string
                            - type: 'null'
                        from:
                          type: string
                        to:
                          type: array
                          items:
                            type: string
                        date:
                          nullable: true
                          anyOf:
                            - type: string
                            - type: 'null'
                        preview:
                          nullable: true
                          anyOf:
                            - type: string
                            - type: 'null'
                        hasAttachments:
                          type: boolean
                      required:
                        - uid
                        - folder
                        - source
                        - structuredEmailId
                        - flags
                        - isRead
                        - isFlagged
                        - modseq
                        - internalDate
                        - size
                        - messageId
                        - threadId
                        - subject
                        - from
                        - to
                        - date
                        - preview
                        - hasAttachments
                  pagination:
                    type: object
                    properties:
                      limit:
                        type: number
                      offset:
                        type: number
                      total:
                        type: number
                      hasMore:
                        type: boolean
                    required:
                      - limit
                      - offset
                      - total
                      - hasMore
                required:
                  - folder
                  - uidValidity
                  - uidNext
                  - highestModseq
                  - expunged
                  - data
                  - pagination
        '400':
          description: Response for status 400
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          description: Response for status 401
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '403':
          description: Response for status 403
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Response for status 404
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '409':
          description: Response for status 409
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Inbound API key. Include it in the Authorization header as: Bearer
        <your-api-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.