---
title: "Search Messages"
method: POST
path: "/api/v1/app/{app_id}/msg/search"
tags: ["Message"]
---

# Search Messages

`POST /api/v1/app/{app_id}/msg/search`

Search for messages matching the given criteria.

The `before` and `after` parameters let you filter all items created before or after a certain date. These can be
used alongside an iterator to paginate over results within a certain window.

Note that by default this endpoint is limited to retrieving 90 days' worth of data
relative to now or, if an iterator is provided, 90 days before/after the time indicated
by the iterator ID. If you require data beyond those time ranges, you will need to explicitly
set the `before` or `after` parameter as appropriate.

## Path parameters

- `app_id` string, required — The Application's ID or UID.

## Headers

- `idempotency-key` string

## Request body

- MessageSearchIn
  - `limit` integer — Limit the number of returned items
  - `iterator` string, nullable — The iterator returned from a prior invocation
  - `channel` string, nullable — Filter response based on the channel.
  - `before` string, date-time, nullable — Only include items created before a certain date.
  - `after` string, date-time, nullable — Only include items created after a certain date.
  - `with_content` boolean — When `true` message payloads are included in the response.
  - `tag` string, nullable — Filter messages matching the provided tag.
  - `event_types` string[], nullable — Filter response based on the event type

## Response `200`

- ListResponseMessageOut
  - `data` MessageOut[], required
    - `eventId` string, nullable — Optional unique identifier for the message
    - `eventType` string, required — The event type's name
    - `payload` object, required
    - `channels` string[], nullable — List of free-form identifiers that endpoints can filter by
    - `id` string, required — The Message's ID.
    - `timestamp` string, date-time, required
    - `tags` string[], nullable
    - `deliverAt` string, date-time, nullable
  - `iterator` string, nullable, required
  - `prevIterator` string, nullable
  - `done` boolean, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `409` — Conflict
- `422` — Validation Error
- `429` — Too Many Requests

---

[API](https://skmtc.net/svix/apis/svix-api.md) · [All operations](https://skmtc.net/svix/apis/svix-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/svix/svix-api/versions/16dbcc056c48/schema)
