---
title: "Search the message log"
method: POST
path: "/v1/messages/search"
tags: ["Messages"]
---

# Search the message log

`POST /v1/messages/search`

## Request

- Base URL: `https://api.sendora.se`
- URL: `https://api.sendora.se/v1/messages/search`
- Auth: HTTP bearer

The messages of the server, newest first, one page at a time. A POST so that an address travels in the body and never in a URL. Messages older than the retention window are gone.

## Request body

- object: Every filter is optional; the page is newest first.
  - `recipient` string, email: Messages to this address, in to, cc or bcc.
  - `streamId` string, uuid: Messages on this stream of the server.
  - `broadcastId` string, uuid: Messages of this broadcast.
  - `tag` string
  - `status` 'queued' | 'delivered' | 'deferred' | 'bounced' | 'expired': Messages with at least one recipient in this state.
  - `from` string, date-time: Submitted at or after this time.
  - `to` string, date-time: Submitted before this time.
  - `limit` integer: Page size, 1 to 100.
  - `after` string, uuid: The `next` value of the previous page.

## Response `200`

A page of the messages that match, newest first.

- object: A page of the messages that match, newest first.
  - `messages` object[], required
    - `messageId` string, uuid, required
    - `streamId` string, uuid, required: The stream the message went on.
    - `broadcastId` string, uuid, nullable, required: The broadcast the message belongs to; null for a message sent on its own.
    - `status` 'accepted' | 'injected' | 'failed', required: `accepted` until handed to the mail server, `injected` after; `failed` if that never worked.
    - `from` string, required
    - `subject` string, required
    - `tag` string, nullable, required
    - `metadata` object, required
    - `submittedAt` string, date-time, required
    - `test` boolean, required: True when the message went through a test server: its events were simulated and nobody received it.
    - `recipients` object[], required
      - `address` string, required
      - `kind` 'to' | 'cc' | 'bcc', required
      - `status` 'queued' | 'delivered' | 'deferred' | 'bounced' | 'expired', required: queued until the receiver answers; deferred while it keeps saying try later.
  - `next` string, uuid, nullable, required: Pass as `after` for the next page; null on the last.

## Other responses

- `400`: The body, the query or a header does not match what the route takes.
- `401`: The key is missing, malformed or revoked.
- `403`: The key is of the other kind, or a connected app may not do this here: it is not for connections, the connection may only read here, or it is for test servers only.

---

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