---
title: "Get a message"
method: GET
path: "/v1/inboxes/{id}/messages/{messageId}"
tags: ["Messages"]
---

# Get a message

`GET /v1/inboxes/{id}/messages/{messageId}`

## Request

- Base URL: `https://anjal.app`
- URL: `https://anjal.app/v1/inboxes/{id}/messages/{messageId}`
- Auth: API key in header `X-API-Key`

Returns full bodies plus attachment metadata. Also marks the message as read.

Some mail clients paste a screenshot straight into the HTML as a `data:`
URI, which can be hundreds of KB inside `htmlBody`. Pass
`inlineImages=refs` to get each one replaced by `attachment:<id>`, the
id of the attachment holding the same image, and that attachment marked
`inline: true`. Fetch it from the attachments endpoint. The response then
also carries `inlineImages: { replaced, unmatched }`; `unmatched` counts
images that had no matching attachment and were removed with no pointer.
Without the parameter `htmlBody` is returned exactly as received.

## Query parameters

- `inlineImages` 'refs'

## Response `200`

OK

- Message
  - `id` string, uuid
  - `direction` 'inbound' | 'outbound'
  - `from` string
  - `to` string
  - `subject` string
  - `plainBody` string, nullable
  - `htmlBody` string, nullable
  - `isRead` boolean
  - `threadId` string, uuid, nullable
  - `messageIdHeader` string, nullable
  - `inReplyTo` string, nullable
  - `receivedAt` string, date-time
  - `labels` string[]: Lowercase labels on this message.
  - `isSpam` boolean: Flagged by the spam filter. Spam is left out of lists unless `includeSpam=true`.
  - `deliveryStatus` 'delivered' | 'bounced' | 'complained' | 'rejected' | 'null', nullable: Outbound only. `delivered` means the recipient's mail server accepted it (not a guarantee of inbox placement). Null until known.
  - `deliveredAt` string, date-time, nullable: When the recipient's mail server accepted the message (outbound only).
  - `firstOpenedAt` string, date-time, nullable: Time of the first open (outbound sends with `trackOpens: true` only). NULL until the first open. Opens are a hint, not proof: Apple Mail Privacy Protection fetches images on delivery, and clients that block images never report an open.
  - `lastOpenedAt` string, date-time, nullable: Most recent open event. Updates on every open.
  - `openCount` integer: Total opens. Subject to the same caveats as the timestamps.
  - `firstClickedAt` string, date-time, nullable: Timestamp of the first recipient link-click. Reliable signal of engagement (unlike opens, click events are not Apple-MPP-poisoned). NULL until the first click.
  - `lastClickedAt` string, date-time, nullable
  - `clickCount` integer
  - `attachments` AttachmentMeta[]
    - `id` string, uuid
    - `filename` string
    - `contentType` string
    - `sizeBytes` integer
    - `inline` boolean: Present and true when `htmlBody` embedded this attachment as an inline image and `?inlineImages=refs` replaced it with `attachment:<id>`.

---

[API](https://skmtc.dev/anjal/apis/anjal-api.md) · [All operations](https://skmtc.dev/anjal/apis/anjal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anjal/apis/anjal-api/revisions/a4044778e294?raw)
