Whats91
Developers

Retrieve paginated messages inside one conversation.

Conversation Messages

Summary

Retrieve paginated messages inside one conversation.

Prerequisites

  • Authorization: Bearer w91_live_xxx
  • Content-Type: application/json for JSON requests

Endpoint: GET /api/v2/reports/conversations/{conversationId}/messages. Use this endpoint to retrieve paginated messages inside one conversation.

GET/api/v2/reports/conversations/{conversationId}/messages
ParameterTypeRequiredDescription
AuthorizationheaderRequiredBearer w91_live_xxxxxxxxxxxxxxxxx.
conversationIdnumberRequiredExisting numeric conversation id.
senderIdstringOptionalWhatsApp sender phone number.
directionstringOptionalinbound or outbound.
messageTypestringOptionaltext, image, video, document, interactive, etc.
statusstringOptionalpending, sent, delivered, read, failed, or all.
searchstringOptionalMatches message text.
pagenumberOptionalPositive integer. Default 1.
limitnumberOptionalPositive integer. Default 50, max 200.
sortBystringOptionaltimestamp, created_at, or updated_at.
sortOrderstringOptionalASC or DESC.
Conversation messages
curl "https://graph.whats91.com/api/v2/reports/conversations/194977/messages?senderId=919999999999&direction=inbound&page=1&limit=50" \
  -H "Authorization: Bearer w91_live_xxx"
Messages response
{
  "success": true,
  "message": "Conversation messages retrieved",
  "data": {
    "conversationId": 194977,
    "messages": [
      {
        "messageId": "wamid.xxxxx",
        "fromPhone": "919343841961",
        "toPhone": "919999999999",
        "direction": "inbound",
        "messageType": "text",
        "messageContent": "hi",
        "mediaUrl": null,
        "mediaMimeType": null,
        "mediaFilename": null,
        "mediaCaption": null,
        "status": "read",
        "isRead": true,
        "isPinned": false,
        "isStarred": false,
        "timestamp": "2026-06-05T06:08:48.000Z",
        "errorMessage": null,
        "interactiveData": null,
        "locationData": null,
        "contactData": null
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 50,
      "total": 1,
      "totalPages": 1,
      "count": 1,
      "hasMore": false
    }
  }
}

Raw inbound/outbound payload dumps, internal database user IDs, encrypted values, and access tokens are never returned.

Error Responses

HTTPError codeMeaning
401MISSING_AUTH_TOKENNo public token was supplied.
401INVALID_AUTH_TOKENToken is invalid, expired, revoked, or not tied to an active customer.
403SENDER_NOT_ALLOWEDNumber-scoped token requested another sender.
403FEATURE_NOT_AVAILABLEThe customer does not have message reports access.
400WHATSAPP_SETUP_INCOMPLETESender context could not resolve a usable WhatsApp number.
400VALIDATION_FAILEDInvalid date range, pagination, boolean, status, sort field, label mode, conversation id, or mobile number.
404CONVERSATION_NOT_FOUNDConversation id does not belong to the authenticated customer and sender.
Validation error example
{
  "success": false,
  "message": "sortBy is not supported for conversations",
  "error_code": "VALIDATION_FAILED",
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}

SDK Examples

Use these examples as starting points for server-side implementations.

cURL
curl -X GET "https://graph.whats91.com/api/v2/reports/conversations/{conversationId}/messages" \
  -H "Authorization: Bearer w91_live_xxx"
Node.js
const response = await fetch("https://graph.whats91.com/api/v2/reports/conversations/{conversationId}/messages", {
  method: "GET",
  headers: {
    "Authorization": "Bearer w91_live_xxx",
    "Content-Type": "application/json"
  }
});

const data = await response.json();
console.log(data);
PHP
$ch = curl_init("https://graph.whats91.com/api/v2/reports/conversations/{conversationId}/messages");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer w91_live_xxx",
    "Content-Type: application/json"
  ]
]);

$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests

response = requests.request(
    "GET",
    "https://graph.whats91.com/api/v2/reports/conversations/{conversationId}/messages",
    headers={
        "Authorization": "Bearer w91_live_xxx",
        "Content-Type": "application/json",
    }
)

print(response.json())
C#
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer w91_live_xxx");

var request = new HttpRequestMessage(HttpMethod.Get, "https://graph.whats91.com/api/v2/reports/conversations/{conversationId}/messages");

var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());

Related APIs