---
title: "Search messages (full-text, cross-inbox)"
method: GET
path: "/v1/messages/search"
tags: ["Messages"]
---

# Search messages (full-text, cross-inbox)

`GET /v1/messages/search`

## Request

- Base URL: `https://anjal.app`
- URL: `https://anjal.app/v1/messages/search`
- Auth: API key in header `X-API-Key`

Full-text search across every inbox the key can see (tenant-, workspace-,
or inbox-scoped automatically by key tier). Matches subject, plain-text
body, and participant addresses. Returns lightweight hits — ids,
participants, subject, receivedAt, hasAttachments, and a ~200-character
snippet centred on the match — never htmlBody, so results stay small
enough for an agent to consume in one call, then fetch the winning
message/thread in full.

## Query parameters

- `query` string
- `inboxId` string, uuid
- `from` string
- `to` string
- `participant` string
- `direction` 'inbound' | 'outbound'
- `after` string, date-time
- `before` string, date-time
- `hasAttachment` boolean
- `attachmentFilename` string
- `limit` integer
- `offset` integer

## Response `200`

OK

- object
  - `results` object[]
    - `messageId` string, uuid
    - `threadId` string, uuid, nullable
    - `inboxId` string, uuid
    - `inboxUsername` string
    - `inboxDomain` string
    - `direction` 'inbound' | 'outbound'
    - `from` string
    - `to` string
    - `subject` string
    - `receivedAt` string, date-time
    - `hasAttachments` boolean
    - `snippet` string: ~200 chars of plain body centred on the match.
  - `totalCount` integer
  - `nextOffset` integer, nullable

---

[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)
