---
title: "search messages"
method: POST
path: "/instances/{id}/client/action/search-messages"
tags: ["message"]
---

# search messages

`POST /instances/{id}/client/action/search-messages`

Search for messages across all chats or within a specific chat. Returns paginated results with message details.

## Path parameters

- `id` integer, required

## Request body

- object
  - `query` string, required — Text to search for in messages
  - `options` object
    - `chatId` string — Optional chat ID to limit search scope
    - `page` integer — Page number for pagination
    - `limit` integer — Number of results per page

## Response `200`

Successfully retrieved search results

- object
  - `status` 'success' | 'error'
  - `instanceId` string
  - `data` object
    - `messages` object[]
      - `id` object
        - `fromMe` boolean
        - `remote` string
        - `id` string
        - `participant` object
          - `server` string
          - `user` string
          - `_serialized` string
        - `_serialized` string
      - `ack` integer — Message acknowledgment status
      - `hasMedia` boolean
      - `body` string
      - `type` string
      - `timestamp` integer
      - `from` string
      - `to` string
      - `deviceType` string
      - `isForwarded` boolean
      - `forwardingScore` integer
      - `isStatus` boolean
      - `isStarred` boolean
      - `fromMe` boolean
      - `hasQuotedMsg` boolean
      - `hasReaction` boolean
      - `vCards` string[]
      - `mentionedIds` string[]
      - `groupMentions` string[]
      - `isGif` boolean
      - `isViewOnce` boolean — Whether the message is a view-once message
      - `links` string[]
    - `pagination` object
      - `page` integer
      - `limit` integer

## Other responses

- `401` — Unauthorized — invalid or missing bearer token
- `403` — Forbidden — insufficient permissions or account blocked
- `404` — Not found — instance does not exist or does not belong to you
- `409` — Conflict — instance is not ready
- `422` — Validation error — invalid or missing request parameters
- `429` — Too many requests — rate limit exceeded

---

[API](https://skmtc.net/waapi/apis/waapi-api.md) · [All operations](https://skmtc.net/waapi/apis/waapi-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/waapi/waapi-api/revisions/1e2cc7c12090/schema)
