Appearance
List messages
Returns a conversation's messages, newest first, paginated. Covers every message in the thread: the contact's messages (role = user), the AI agent's replies and manual sends (role = assistant).
Use it to read the AI reply after sending a test message, since the reply is generated asynchronously.
GET/api/user/{conversation}/messages
Required scope:
conversations:readPath parameters
integer
Query parameters
integer
integer
curl -X GET "https://loopx-console.test/api/user/89328/messages?per_page=10&page=1" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"<?php
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://loopx-console.test/api/user/89328/messages?per_page=10&page=1', [
'headers' => [
'Authorization' => 'Bearer $TOKEN',
'Accept' => 'application/json',
]
]);
$data = json_decode($response->getBody(), true);const res = await fetch('https://loopx-console.test/api/user/89328/messages?per_page=10&page=1', {
method: 'GET',
headers: {
Authorization: 'Bearer $TOKEN',
Accept: 'application/json'
}
});
const data = await res.json();Example response
{
"status": true,
"code": 200,
"validation": [],
"message": "Messages List",
"data": {
"current_page": 1,
"data": [
{
"_id": "68e0f4b9c2b1a9f0d3e5a7c4",
"role": "assistant",
"status": "sent_to_user",
"message": "Hi Ali! Our Pro plan is 499 EGP per month. Would you like a quick demo?",
"cost_for_user": 0.42,
"conversation_id": 89328,
"opportunity_id": 98314,
"contact_id": 44016,
"channel_id": 512,
"stage_id": 189,
"pipeline_id": 17,
"call_type": "chat",
"files": [],
"stage": {
"id": 189,
"name": "Qualification",
"order": 1,
"nature": "neutral"
},
"created_at": "2026-11-24T10:22:47.000000Z",
"updated_at": "2026-11-24T10:22:48.000000Z"
},
{
"_id": "68e0f4a3c2b1a9f0d3e5a7b2",
"role": "user",
"status": "sent_to_agent",
"is_test": true,
"message": "How much is the Pro plan?",
"conversation_id": 89328,
"opportunity_id": 98314,
"contact_id": 44016,
"channel_id": 512,
"stage_id": 189,
"pipeline_id": 17,
"call_type": "chat",
"stage": {
"id": 189,
"name": "Qualification",
"order": 1,
"nature": "neutral"
},
"created_at": "2026-11-24T10:22:41.000000Z",
"updated_at": "2026-11-24T10:22:41.000000Z"
}
],
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 2,
"total": 2
}
}Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
conversation | integer | yes | Conversation id. Must belong to your workspace (or a workspace you manage) |
Query parameters
| Name | Type | Description |
|---|---|---|
per_page | integer | Messages per page. Default 10 |
page | integer | Page number. Default 1. Page 1 holds the newest messages |
Response
data is a paginated list (current_page, per_page, last_page, total, …). Each entry in data.data is a message:
| Field | Type | Description |
|---|---|---|
_id | string | Message id |
role | string | user for the contact's messages, assistant for AI replies and manual sends |
status | enum | received, sent_to_agent, responded_by_agent, sent_to_user, created_manually, stopped, failed |
message | string | null | Message text |
is_test | boolean | true on messages sent through Send a test message |
files | object[] | Attachments: path, full_path (signed download URL, valid for 10 minutes), mimetype, type, size |
cost_for_user | number | Credits charged for this message (AI replies) |
stage | object | null | The stage the opportunity was in when the message was saved: id, name, order, nature |
conversation_id, opportunity_id, contact_id, channel_id, stage_id, pipeline_id | integer | Relational context |
created_at | string | ISO-8601 timestamp |
Errors
| Code | When |
|---|---|
403 | Token missing conversations:read scope, or the conversation belongs to a different workspace |
404 | Conversation not found |