Replaces the old endpoint /public/ai-message/:aiContactId
| Parameter | Type | Required | Description |
|---|---|---|---|
aiContactId | string (UUID) | Yes | Unique identifier of the contact |
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Page number to retrieve (starts at 1) |
page until you receive an empty array.| Field | Type | Description |
|---|---|---|
messages | array | Array of message objects for this page |
page | number | Current page number |
hasMore | boolean | Whether there are more pages available |
total | number | Total number of messages (optional) |
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Unique message identifier |
body | string | Message content/text |
created_at | string (ISO) | Message timestamp |
direction | string | ”INBOUND” or “OUTBOUND” |
from | string | Sender identifier (phone/username) |
to | string | Recipient identifier |
type | string | Message type (text, image, video, audio, etc.) |
status | string | Delivery status (sent, delivered, read, failed) |
media_url | string | null | URL to media file (if applicable) |
client_id | string (UUID) | Your organization ID |
ai_contact_id | string (UUID) | Associated contact ID |
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid page parameter |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Contact not found |
| 500 | Internal Server Error - Something went wrong |
page parameter is mandatoryhasMore field to determine if more pages exist| Requirement | Use This Endpoint (Messages v2) | Use Conversations |
|---|---|---|
| Need pagination | ✅ Yes | ❌ No |
| Large message history | ✅ Yes | ❌ No |
| Flat message list | ✅ Yes | ❌ No |
| Sequential processing | ✅ Yes | ❌ No |
| Chat UI with threads | ❌ No | ✅ Yes |
| Conversation view | ❌ No | ✅ Yes |
| Human-readable format | ❌ No | ✅ Yes |
| Filter by recent days | Use pagination | ✅ daysBack parameter |