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

# List messages for an address

> Returns mail sent to any @empiricalrun.email address, newest first. Unclaimed addresses are readable by every project. A claimed address is readable only by its project, and only mail received after the claim. This is what `EmailClient.waitForEmail` polls.



## OpenAPI

````yaml /api-reference/openapi.generated.json get /api/inboxes/messages
openapi: 3.1.0
info:
  title: Empirical API
  version: 1.0.0
  description: Programmatic access to Empirical test runs, snoozes, and more.
  contact:
    name: Empirical
    url: https://empirical.run
servers:
  - url: https://api.empirical.run
security:
  - Bearer: []
tags:
  - name: Test Runs
    description: Trigger, list, and inspect end-to-end test runs.
  - name: Test Cases
    description: >-
      Browse the Playwright test cases synced from a project's repository and
      manage their tags.
  - name: Environments
    description: >-
      Named deployment targets (slug + Playwright project filters) a project's
      tests run against.
  - name: Snoozes
    description: Temporarily suppress known test failures for specific Playwright tests.
  - name: KV
    description: >-
      Project-scoped key-value store shared by test runs, shards and agent
      sessions. Every entry expires; conditional writes make it safe for locks.
  - name: Analytics
    description: Aggregated test-run, test-count and test-case analytics for a project.
  - name: Allowed recipients
    description: >-
      Domains and addresses a project's inboxes may send email to, besides
      @empiricalrun.email addresses and people who emailed the inbox. Each one
      is verified in one of two ways. **Email from it**: send an email from the
      domain (any mailbox on it) or from the exact address to the verification
      address, with the verification code in the subject. It must pass DMARC.
      **Emailed code**, for addresses that can't send (e.g.
      `support@acme.zendesk.com`): we email the address a 6-digit code, and you
      enter it from wherever that address delivers. A domain covers exactly that
      domain, not its subdomains; add a subdomain such as `inbound.acme.com` on
      its own, and an email from `@acme.com` verifies it. Public mail providers
      (gmail.com, outlook.com and similar) can't be added as domains; add the
      exact address instead. An address also covers its plus-variants. Domains
      reserved for examples and tests (example.com, example.net, example.org,
      and anything under .test, .example, .invalid or .localhost) can't receive
      email, so codes are never emailed to them.
  - name: Badges
    description: Public README status badge images (SVG) for project environments.
  - name: Files
    description: >-
      Upload files of any type and get a link to use in tasks, sessions and
      messages. Agents should use the `upload_file` tool, which returns a
      project-wide `file@<id>` handle (`<id>` is the file `id` below).
  - name: Inboxes
    description: >-
      Test email addresses on @empiricalrun.email that a project claims. Only
      the claiming project can read an inbox, and only mail received after the
      claim. Typical flow: claim an address, sign up or log in to your app with
      it, then list the inbox's messages. Inboxes can also send mail, e.g. to
      test an app that processes inbound email: to @empiricalrun.email
      addresses, to anyone who emailed the inbox, and to the project's allowed
      recipients. Replies land back in the sending inbox.
  - name: Infra
    description: >-
      Infrastructure details customers configure against, such as static egress
      IPs.
  - name: Reporter Configuration
    description: Reporters a project can use in environment and run reporter configs.
  - name: Webhook Captures
    description: >-
      Throwaway URLs that record every request sent to them, for testing
      webhooks your app sends.
paths:
  /api/inboxes/messages:
    get:
      tags:
        - Inboxes
      summary: List messages for an address
      description: >-
        Returns mail sent to any @empiricalrun.email address, newest first.
        Unclaimed addresses are readable by every project. A claimed address is
        readable only by its project, and only mail received after the claim.
        This is what `EmailClient.waitForEmail` polls.
      operationId: listAddressMessages
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
            description: Maximum messages to return, newest first (max 100).
          required: false
          description: Maximum messages to return, newest first (max 100).
          name: limit
          in: query
        - schema:
            type: string
            format: date-time
            description: >-
              Only messages received at or after this ISO 8601 time. Messages
              from before the claim are never returned.
          required: false
          description: >-
            Only messages received at or after this ISO 8601 time. Messages from
            before the claim are never returned.
          name: received_after
          in: query
        - schema:
            type: string
            minLength: 1
            description: Only messages whose sender contains this text.
          required: false
          description: Only messages whose sender contains this text.
          name: from
          in: query
        - schema:
            type: string
            minLength: 1
            description: Only messages whose subject contains this text.
          required: false
          description: Only messages whose subject contains this text.
          name: subject
          in: query
        - schema:
            type: string
            minLength: 1
            description: Only messages whose text or HTML body contains this text.
          required: false
          description: Only messages whose text or HTML body contains this text.
          name: body
          in: query
        - schema:
            type: string
            minLength: 3
            description: >-
              Recipient address, e.g. `signup-user-k3f9@empiricalrun.email`.
              Case-insensitive.
          required: true
          description: >-
            Recipient address, e.g. `signup-user-k3f9@empiricalrun.email`.
            Case-insensitive.
          name: to
          in: query
      responses:
        '200':
          description: Messages sent to the address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxMessageListResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Another project has claimed this address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: The inbox service is not configured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    InboxMessageListResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            messages:
              type: array
              items:
                $ref: '#/components/schemas/InboxMessage'
              description: Messages, newest first.
          required:
            - messages
          description: Response payload.
      required:
        - data
    ErrorResponse:
      type: object
      properties:
        data:
          nullable: true
          description: Always null for error responses.
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message.
          required:
            - message
          description: Error details.
      required:
        - data
        - error
    InboxMessage:
      type: object
      properties:
        id:
          type: string
          description: Message ID.
        to_address:
          type: string
          description: Recipient address.
        from_address:
          type: string
          description: Sender address.
        subject:
          type: string
          nullable: true
          description: Subject line.
        text_body:
          type: string
          nullable: true
          description: Plain-text body, if the email had one.
        html_body:
          type: string
          nullable: true
          description: HTML body, if the email had one.
        received_at:
          type: string
          description: ISO 8601 time the message arrived.
        message_id:
          type: string
          nullable: true
          description: >-
            The email's Message-ID header. Pass it as `in_reply_to` to reply in
            the same thread.
        header_from_address:
          type: string
          nullable: true
          description: >-
            Address in the email's From header. `from_address` is the envelope
            sender, often a provider's bounce address.
        dmarc:
          type: string
          nullable: true
          enum:
            - pass
            - fail
            - none
          description: >-
            DMARC result Cloudflare recorded on arrival. Null for mail captured
            through the SMTP relay.
        links:
          type: array
          items:
            type: object
            properties:
              href:
                type: string
                description: Link target.
              text:
                type: string
                description: Link text, if any.
            required:
              - href
          description: Links found in the body, such as magic links.
        codes:
          type: array
          items:
            type: string
          description: Likely one-time codes found in the body, such as `482913`.
      required:
        - id
        - to_address
        - from_address
        - subject
        - text_body
        - html_body
        - received_at
        - message_id
        - header_from_address
        - dmarc
        - links
        - codes
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````

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