v1

latestOpenAPI 3.1.02026-07-1413113265.9 KB
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

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

Successfully retrieved search results

status'success' | 'error'
instanceIdstring

Example response

{
  "status": "success",
  "instanceId": "1",
  "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
    }
  }
}