Get Conversation History
Fetch the last 10 messages exchanged with one customer number, oldest first, with time, sender and message text.
Last updated 14 Aug 2026
Endpoint
GET /conversation-history.php
Requires the Authorization: Bearer header described in Authentication.
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
to | string | yes | The customer's phone number, digits only after stripping non-digit characters. |
Example request
curl "https://your-riffre-domain.com/api/v1/conversation-history.php?to=919876543210" \
-H "Authorization: Bearer rf_live_YOUR_API_KEY"
Success response
200 OK:
{
"to": "919876543210",
"messages": [
{
"time": "2026-08-14 12:40:11",
"direction": "inbound",
"sender": "Asha Rao",
"type": "text",
"message": "Is my order still on the way?"
},
{
"time": "2026-08-14 12:42:03",
"direction": "outbound",
"sender": "Agent · Priya Nair",
"type": "text",
"message": "Yes! It left our warehouse this morning and should arrive tomorrow."
}
]
}
| Field | Description |
|---|---|
time | When the message was sent or received. |
direction | inbound (from the customer) or outbound (from your account). |
sender | The contact's name for inbound messages; "Agent · <name>" or "Client" for outbound messages, matching who actually sent it. |
type | The WhatsApp message type (text, image, template, interactive, etc). |
message | Human-readable message text - the rendered template body for template messages, the caption or a type label for media. |
Returns up to the last 10 messages, oldest first.
Errors specific to this endpoint
error slug | HTTP status | Cause |
|---|---|---|
a_valid_to_number_is_required | 422 | to is missing, or is not 8-15 digits after stripping non-digit characters. |
no_conversation_was_found_with_that_number | 404 | No conversation exists with to on this WhatsApp number. |
For the full error shape and general status codes, see Errors.