message

search messages

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

post/instances/{id}/client/action/search-messages

Request

  • Base URL: https://waapi.app/api/v1
  • URL: https://waapi.app/api/v1/instances/{id}/client/action/search-messages
  • Auth: HTTP bearer

Path parameters

idinteger required

Instance ID

Request body

querystring required

Text to search for in messages

Example request

{
  "query": "hello",
  "options": {
    "chatId": "123456789@c.us",
    "page": 1,
    "limit": 10
  }
}

Response

Request reached the instance. data.status reports whether the action was carried out; on error data carries message and explanation. Payload: Successfully retrieved search results.

status'success' | 'error'

Whether the request reached the instance. success here does not mean the action was carried out — that is reported by data.status, which is the authoritative one. A malformed input arrives as status: success with data.status: error.

Example response

{
  "status": "success",
  "data": {
    "status": "success",
    "data": {
      "messages": [
        {
          "id": {
            "fromMe": true,
            "remote": "120363000000000000@g.us",
            "id": "XXXXXXXXXXXXXXXXXXXX",
            "participant": {
              "server": "c.us",
              "user": "50664083362",
              "_serialized": "50664083362@c.us"
            },
            "_serialized": "true_120363000000000000@g.us_XXXXXXXXXXXXXXXXXXXX_10000000000@c.us"
          },
          "ack": 3,
          "body": "Sample message text",
          "type": "chat",
          "timestamp": 1735569237,
          "from": "490000000000@c.us",
          "to": "120363000000000000@g.us",
          "deviceType": "ios",
          "fromMe": true,
          "vCards": [],
          "mentionedIds": [],
          "groupMentions": [],
          "links": []
        }
      ],
      "pagination": {
        "page": 1,
        "limit": 10
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.