WhatsappHistory model, ordered by most recent first.messages:read| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per_page | integer | Items per page (default: 15, max: 100) |
sort | string | Sort field. Allowed: created_at, updated_at. Prefix with - for descending (default: -created_at) |
search | string | Search within message text (partial match) |
q | string | Alias for search |
fields | string | Comma-separated list of fields to return |
filter[field]=value or filter[field][operator]=value.| Filter Field | Type | Description |
|---|---|---|
type | string | Message type (e.g., text, template, image, video, document, audio, interactive) |
status | string | Delivery status (sent, delivered, read, failed) |
interaction_id | integer | Chat interaction ID (filters messages for a specific conversation) |
direction | string | Message direction (inbound, outbound) |
| Operator | Example | Description |
|---|---|---|
| (none) | filter[status]=sent | Exact match |
ne | filter[status][ne]=failed | Not equal |
in | filter[type][in]=text,template | Match any value |
not_in | filter[type][not_in]=audio | Exclude values |
| Field | Type | Description |
|---|---|---|
id | integer | Message record ID |
interaction_id | integer|null | Chat interaction ID |
sender_id | string|null | Sender phone number or ID |
type | string|null | Message type |
message | string|null | Message content |
status | string|null | Delivery status |
message_id | string|null | WhatsApp message ID |
sent_at | string | ISO 8601 timestamp (time_sent or created_at) |
is_read | boolean | Whether message has been read |
| Status | Error Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing API token |
| 403 | INSUFFICIENT_SCOPE | Token missing messages:read scope |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests |
| 500 | INTERNAL_ERROR | Failed to fetch messages |
curl --location -g --request GET '/messages?page=1&per_page=15&sort=-created_at&search=hello&filter[type]=text&filter[status]=sent&filter[interaction_id]=9&filter[direction]=outbound' \
--header 'Authorization: Bearer <token>'{}