---
title: "Search chat messages"
method: GET
path: "/chat/threads/{chatId}/search"
tags: ["Chat"]
---

# Search chat messages

`GET /chat/threads/{chatId}/search`

## Request

- Base URL: `https://viral.app/api/v1`
- URL: `https://viral.app/api/v1/chat/threads/{chatId}/search`
- Auth: API key in header `x-api-key`

Searches messages of a conversation by text, newest first. Deleted messages never match.

## Path parameters

- `chatId` string, required

## Query parameters

- `query` string, required
- `limit` integer

## Response `200`

OK

- object
  - `results` object[], required
    - `messageId` string, required
    - `senderType` 'org' | 'creator' | 'system', required
    - `senderDisplayName` string, nullable, required
    - `contentPreview` string, required
    - `createdAt` string, date-time, required

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `404`: 404
- `408`: 408
- `429`: 429
- `500`: 500

---

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