Skip to content
Chatwise
Skip to Content
Developer docs

List or search messages

GET /v1/messages. Lists messages across the workspace, or searches their text.

View as Markdown

GEThttps://api.chatwise.so/v1/messages

Lists messages across the workspace, or searches their text. Deleted and hidden messages are left out, and a search skips WhatsApp authentication templates.

To pull new messages on a schedule, use timeField=ingestedAt and order=asc. To get them as they arrive, use webhooks.

The API key needs the messages:read scope. See authentication and scopes.

Example

curl 'https://api.chatwise.so/v1/messages?limit=25&q=blue&channel=WHATSAPP' \
  -H "Authorization: Bearer $CHATWISE_API_KEY"

Query parameters

NameTypeDescription
limitintegerHow many to return, from 1 to 100. Default: 50.
cursorstringThe previous page's pagination.nextCursor. Repeat the same filters and order with it. At most 512 characters.
fromstringOnly messages at or after this time. ISO 8601 with a time zone, at most milliseconds.
tostringOnly messages before this time, which must be after from. ISO 8601 with a time zone, at most milliseconds.
directionstringinbound from the customer, outbound from the workspace. Leave out for both.
timeFieldstringThe time to filter and sort by: sentAt, or ingestedAt for when Chatwise stored the message. Default: sentAt.
orderstringdesc for newest first, asc for oldest first. Default: desc.
qstringText the message contains, in any case. Every character counts as itself: there are no wildcards. Spaces around it are ignored. Can't be blank, or contain NUL characters or unpaired surrogates. At most 200 characters.
conversationIdstringOnly messages in this conversation.
channelstringOnly messages on this channel. Without it, every channel, Website Chat included. One of WHATSAPP, INSTAGRAM, MESSENGER.

Unknown query parameters are refused with a 400.

Response

200. A page of messages.

{
  "data": [
    {
      "id": "5678",
      "conversationId": "1234",
      "channel": "WHATSAPP",
      "direction": "inbound",
      "type": "text",
      "text": "Is this available in blue?",
      "sentAt": "2026-11-12T09:25:36.000Z",
      "ingestedAt": "2026-11-12T09:25:36.412Z",
      "replyToMessageId": null,
      "attachments": []
    }
  ],
  "pagination": {
    "nextCursor": null
  }
}
FieldTypeDescription
data[].idstringThe message's id.
data[].conversationIdstringThe conversation the message is in.
data[].channelstringThe channel the message is on. One of WHATSAPP, INSTAGRAM, MESSENGER, WEBSITE_CHAT.
data[].directionstringinbound from the customer, outbound from the workspace.
data[].typestringThe message's type, such as text, image, audio, interactive or whatsapp_template.
data[].textstring or nullThe text or caption. For other types, text that Chatwise makes of the message, such as JSON for a location or contacts. Null for WhatsApp authentication templates, so a one-time code is never returned.
data[].sentAtstringWhen the message was sent. ISO 8601, in UTC.
data[].ingestedAtstringWhen Chatwise stored the message. ISO 8601, in UTC.
data[].replyToMessageIdstring or nullThe message this one replies to, if any and still visible.
data[].attachmentsarray of objectsThe message's attachments, at most 10. Always empty on Messenger and Website Chat, and for WhatsApp authentication templates.
data[].attachments[].typestringThe attachment's type, such as image, video, audio or document.
data[].attachments[].mediaIdstring or nullThe channel's id for the media, when Chatwise has it: usually on Instagram only.
pagination.nextCursorstring or nullSend it as cursor for the next page. Null on the last page.

Errors

StatusMessageWhat it means
400Validation failedA parameter or body field is missing, unknown or malformed. errors lists each one.
400Invalid cursor or cursor does not match this requestThe cursor isn't one this route returned, or the filters or order changed since.
401A valid Bearer API key is requiredThe Authorization header is missing or isn't Bearer <API key>.
401Invalid or revoked API keyThe key doesn't exist, was revoked, or has expired.
401Invalid API keyChatwise couldn't check the key. Try again.
403API key does not have the required scope: messages:readThe key lacks the route's scope. Create a key that has it.
404Conversation not foundNo conversation with this id in the key's workspace.
429API key rate limit exceededWait the number of seconds in the Retry-After header.
500Internal server errorSomething failed in Chatwise. Retry reads with backoff.

The body of an error is described in errors.

On this page