Skip to content

Message History

GET /v1/whatsapp/messages

Returns a paginated list of all WhatsApp messages (both inbound and outbound) for the authenticated user. You can filter by session, direction, status, and date range.

Authentication

HeaderTypeRequiredDescription
AuthorizationstringYesBearer sk_live_YOUR_API_KEY

Query Parameters

ParameterTypeRequiredDescription
session_idintegerNoFilter to a specific session ID.
directionstringNoin for received, out for sent.
statusstringNoqueued, sent, delivered, read, failed.
from_datestringNoISO 8601 date (e.g., 2026-03-01).
to_datestringNoISO 8601 date (e.g., 2026-03-31).
pageintegerNoPage number (default: 1).
per_pageintegerNoResults per page (default: 25, max: 100).
bash
curl "https://sendapi.co/v1/whatsapp/messages?direction=out&status=delivered&per_page=50" \
  -H "Authorization: Bearer sk_live_123456789"
javascript
const messages = await client.whatsapp.messages.list({
  direction: 'out',
  status: 'delivered',
  per_page: 50
});
python
messages = client.whatsapp.messages.list(
    direction="out",
    status="delivered",
    per_page=50
)

Response

json
{
  "success": true,
  "data": [
    {
      "id": 14,
      "wa_session_id": 8,
      "direction": "out",
      "recipient": "447700900000",
      "type": "text",
      "content": "Hello! How can our support team assist you today?",
      "status": "delivered",
      "external_id": "3EB0C5E64689ED4B8C686E",
      "created_at": "2026-03-09T14:30:00.000000Z",
      "updated_at": "2026-03-09T14:30:22.000000Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 25,
    "total": 1402,
    "last_page": 57
  }
}

Get a Single Message

GET /v1/whatsapp/messages/{id}

Returns the full details of a single message.

bash
curl https://sendapi.co/v1/whatsapp/messages/14 \
  -H "Authorization: Bearer sk_live_123456789"

Response

json
{
  "success": true,
  "data": {
    "id": 14,
    "wa_session_id": 8,
    "direction": "out",
    "recipient": "447700900000",
    "type": "text",
    "content": "Hello! How can our support team assist you today?",
    "status": "read",
    "external_id": "3EB0C5E64689ED4B8C686E",
    "cost": "0.0000",
    "created_at": "2026-03-09T14:30:00.000000Z",
    "updated_at": "2026-03-09T14:31:05.000000Z"
  }
}

Status timeline

The status field reflects the latest known state. SendAPI does not record per-step timestamps for sent/delivered/read on the message — subscribe to webhook events if you need a delivery audit trail.

Message Statuses

StatusDescription
queuedMessage accepted by SendAPI, pending dispatch
sentDelivered to WhatsApp servers
deliveredReceived on recipient's device (double checkmark)
readOpened by recipient (blue checkmark)
failedDelivery failed

Released under the MIT License.