Skip to main content
Retrieve messages from a specific chat conversation with filtering and pagination options.
Messages are returned in reverse chronological order (newest first) by default.

Request

chat_jid
string
required
Chat JID identifier:Example: [email protected]
X-Device-Id
string
Device identifier for multi-device support. Required when multiple devices are registered. If only one device is registered, it will be used as the default.
limit
integer
default:"50"
Maximum number of messages to return per page (max: 100)
offset
integer
default:"0"
Number of messages to skip for pagination
start_time
string
Filter messages from this timestamp (ISO 8601 format)Example: 2024-01-01T00:00:00Z
end_time
string
Filter messages until this timestamp (ISO 8601 format)
media_only
boolean
default:"false"
Only return messages with media content (images, videos, audio, documents)
is_from_me
boolean
Filter messages by sender:
  • true: Messages sent by you
  • false: Messages received from others
  • Omit parameter: All messages
Note: When media_only=true and is_from_me=false, media_only takes precedence
Search messages by text content

Response

code
string
Response code (e.g., SUCCESS)
message
string
Response message describing the result
results
object
data
array
Array of message objects
pagination
object
limit
integer
Number of items per page
offset
integer
Current offset
total
integer
Total number of messages
chat_info
object
Information about the chat (same structure as chat object in list endpoint)
curl -X GET \
  'https://your-api-domain.com/chat/[email protected]/messages?limit=50&offset=0&media_only=false' \
  -H 'X-Device-Id: my-device' \
  -u 'username:password'
{
  "code": "SUCCESS",
  "message": "Success get chat messages",
  "results": {
    "data": [
      {
        "id": "3EB0B430B6F8F1D0E053AC120E0A9E5C",
        "chat_jid": "[email protected]",
        "sender_jid": "[email protected]",
        "content": "Hello, how are you?",
        "timestamp": "2024-01-15T10:30:00Z",
        "is_from_me": false,
        "media_type": null,
        "filename": null,
        "url": null,
        "file_length": null,
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
      }
    ],
    "pagination": {
      "limit": 50,
      "offset": 0,
      "total": 1250
    },
    "chat_info": {
      "jid": "[email protected]",
      "name": "John Doe",
      "last_message_time": "2024-01-15T10:30:00Z",
      "ephemeral_expiration": 0,
      "created_at": "2024-01-10T08:00:00Z",
      "updated_at": "2024-01-15T10:30:00Z",
      "archived": false
    }
  }
}

Build docs developers (and LLMs) love