---
title: "Batch Get Messages"
method: POST
path: "/v0/inboxes/{inbox_id}/messages/batch-get"
tags: ["InboxesMessages"]
---

# Batch Get Messages

`POST /v0/inboxes/{inbox_id}/messages/batch-get`

Fetch metadata for up to 500 messages in one request. Missing or
restricted IDs are silently omitted; compare `count` against `limit`
to detect misses.

**CLI:**
```bash
agentmail inboxes:messages batch-get --inbox-id <inbox_id> --message-id <id1> --message-id <id2>
```

## Path parameters

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

## Request body

- BatchGetMessagesRequest
  - `message_ids` MessageId[], required — IDs of messages to fetch. Maximum 500 ids per request. Duplicates are rejected with a validation error. IDs not found in the inbox (including cross-inbox or permission-restricted) are silently omitted from the response; callers detect misses by comparing `count` against `limit`.

## Response `200`

- BatchGetMessagesResponse
  - `limit` integer, required — Limit of number of items returned.
  - `count` integer, required — Number of items returned.
  - `messages` Message[], required — Found messages. Order matches `message_ids` in the request. Body fields (`text`, `html`, `extracted_text`, `extracted_html`) are never populated; use the single-message endpoint to retrieve bodies.
    - `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>`.
    - `reply_to` string[], nullable — Reply-to addresses. 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.
    - `text` string — Plain text body of message.
    - `html` string — HTML body of message.
    - `extracted_text` string, nullable — Extracted new text content.
    - `extracted_html` string, nullable — Extracted new HTML content.
    - `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

- `400`

---

[API](https://skmtc.net/agentmail-to/apis/api.md) · [All operations](https://skmtc.net/agentmail-to/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agentmail-to/api/revisions/394ddcdd9c29/schema)
