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_idstringNoFilter to a specific session.
directionstringNoin for received, out for sent.
statusstringNoaccepted, 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
{
  "data": [
    {
      "id": "msg_01H8...QP",
      "session_id": "sess_01H8BKF...Z2T",
      "direction": "out",
      "to": "+447700900000",
      "type": "text",
      "content": { "body": "Hello! How can our support team assist you today?" },
      "status": "delivered",
      "delivered_at": "2026-03-09T14:30:22Z",
      "created_at": "2026-03-09T14:30:00Z"
    }
  ],
  "meta": {
    "total": 1402,
    "page": 1,
    "per_page": 25,
    "last_page": 57
  }
}

Get a Single Message

GET /v1/whatsapp/messages/{id}

Returns the full details of a single message, including content and delivery timeline.

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

Response

json
{
  "id": "msg_01H8...QP",
  "session_id": "sess_01H8BKF...Z2T",
  "direction": "out",
  "to": "+447700900000",
  "type": "text",
  "content": { "body": "Hello! How can our support team assist you today?" },
  "status": "read",
  "external_id": "wamid.HBgNNDQ3...",
  "cost": null,
  "timeline": {
    "accepted_at": "2026-03-09T14:30:00Z",
    "sent_at": "2026-03-09T14:30:01Z",
    "delivered_at": "2026-03-09T14:30:22Z",
    "read_at": "2026-03-09T14:31:05Z"
  },
  "created_at": "2026-03-09T14:30:00Z"
}

Message Statuses

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

Released under the MIT License.