# Batch get cached MIME structures

Returns cached MIME envelope and body structure metadata for multiple messages without downloading raw blobs.

## `POST /api/v1/mailboxes/{mailboxId}/messages/mime`

### Path parameters

- `mailboxId` (string, required) — Mailbox ULID identifier

### Request body (required)

`application/json`

- `ids` (string[], required, min 1 items, max 200 items) — Array of message IDs

### Responses

**200** — Map of message ID to parsed MIME envelope and body structures

`application/json` → MimeBatch

- `mime` (object, required) — Map of message ID to parsed MIME structures

**400** — validation_failed

`application/json` → ErrorOrValidation

**401** — unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge

`application/json` → ErrorBody

**404** — Mailbox not found or not accessible

`application/json` → ErrorBody

**413** — too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing

`application/json` → ErrorBody

**503** — temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description)

`application/json` → ErrorBody

### Example request

```bash
curl -X POST 'https://api.open.email/api/v1/mailboxes/{mailboxId}/messages/mime' \
  -H 'Authorization: Bearer oek_…' \
  -H 'Content-Type: application/json' \
  -d '{
    "ids": [
      "string"
    ]
  }'
```

## TypeScript SDK

[`openemail.messages.getMimeStructures`](/docs/sdks/typescript/messages/get-mime-structures)

```ts
const mimeBatch = await openemail.messages.getMimeStructures(mailboxId, { ids: ['…'] })
```
