---
title: "List Messages"
method: GET
path: "/v0/inboxes/{inbox_id}/messages"
tags: ["InboxesMessages"]
---

# List Messages

`GET /v0/inboxes/{inbox_id}/messages`

## Request

- Base URL: `https://api.agentmail.to`
- URL: `https://api.agentmail.to/v0/inboxes/{inbox_id}/messages`
- Auth: HTTP bearer

**CLI:**
```bash
agentmail inboxes:messages list --inbox-id <inbox_id>
```

## Path parameters

- `inbox_id` string, required: The ID of the inbox.

## Query parameters

- `limit` integer: Limit of number of items returned.
- `page_token` string: Page token for pagination.
- `labels` string[]: Labels to filter by.
- `before` string, date-time: Timestamp before which to filter by.
- `after` string, date-time: Timestamp after which to filter by.
- `ascending` boolean: Sort in ascending temporal order.
- `include_spam` boolean: Include spam in results.
- `include_blocked` boolean: Include blocked in results.
- `include_trash` boolean: Include trash in results.

## Response `200`

- ListMessagesResponse
  - `count` integer, required: Number of items returned.
  - `limit` integer: Limit of number of items returned.
  - `next_page_token` string: Page token for pagination.
  - `messages` MessageItem[], required: Ordered by `timestamp` descending.
    - `inbox_id` string, required: The ID of the inbox.
    - `thread_id` string, required: ID of thread.
    - `message_id` string, required: ID of message.
    - `labels` string[], required: Labels of message.
    - `timestamp` string, date-time, required: Time at which message was sent or drafted.
    - `from` string, required: Address of sender. In format `username@domain.com` or `Display Name <username@domain.com>`.
    - `to` string[], required: Addresses of recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
    - `cc` string[]: Addresses of CC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
    - `bcc` string[]: Addresses of BCC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
    - `subject` string: Subject of message.
    - `preview` string: Text preview of message.
    - `attachments` Attachment[]: Attachments in message.
      - `attachment_id` string, required: ID of attachment.
      - `filename` string: Filename of attachment.
      - `size` integer, required: Size of attachment in bytes.
      - `content_type` string: Content type of attachment.
      - `content_disposition` 'inline' | 'attachment': Content disposition of attachment.
      - `content_id` string: Content ID of attachment.
    - `in_reply_to` string: ID of message being replied to.
    - `references` string[]: IDs of previous messages in thread.
    - `headers` MessageHeaders: Headers in message.
    - `size` integer, required: Size of message in bytes.
    - `updated_at` string, date-time, required: Time at which message was last updated.
    - `created_at` string, date-time, required: Time at which message was created.

## Other responses

- `404`

---

[API](https://skmtc.dev/agentmail-to/apis/agentmail-cli-speakeasy-api.md) - [All operations](https://skmtc.dev/agentmail-to/apis/agentmail-cli-speakeasy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentmail-to/apis/agentmail-cli-speakeasy-api/revisions/869b7f1c360c?raw)
