Skip to main content
GET
/
{phone_number_id}
/
messages
List messages
curl --request GET \
  --url https://api.kapso.ai/meta/whatsapp/{phone_number_id}/messages \
  --header 'X-API-Key: <api-key>'
{
"data": [
{
"id": "wamid.HBgNMTU1NTE0OTU5Nzg1FQIAERgSMDhGRjdBMDEyOTcxQzFFQkFBAA==",
"timestamp": "1705328096",
"type": "text",
"from": "15551234567",
"text": {
"body": "Hello! I need help with my order"
},
"kapso": {
"direction": "inbound",
"status": "delivered",
"processing_status": "completed",
"phone_number": "+15551234567",
"has_media": false,
"whatsapp_conversation_id": "123e4567-e89b-12d3-a456-426614174000",
"contact_name": "John Doe",
"content": "Hello! I need help with my order"
}
}
],
"paging": {
"cursors": {
"after": "eyJ2YWx1ZXMiOlsiMjAyNC0wMS0xNVQxMjozNDo1Ni4xMjM0NTZaIiwiMTIzNDUiXSwiY29sdW1ucyI6WyJjcmVhdGVkX2F0IiwiaWQiXX0="
}
}
}

Authorizations

X-API-Key
string
header
required

Project API key for authentication. This is the recommended authentication method.

Get your API key from the Kapso dashboard under Project Settings > API Keys.

Path Parameters

phone_number_id
string
required

WhatsApp Business Phone Number ID

Query Parameters

conversation_id
string

Filter by conversation ID

direction
enum<string>

Filter by message direction

Available options:
inbound,
outbound
status
enum<string>

Filter by message status

Available options:
pending,
sent,
delivered,
read,
failed
since
string<date-time>

Filter messages created on or after this time (ISO 8601)

until
string<date-time>

Filter messages created on or before this time (ISO 8601)

limit
integer
default:20

Maximum number of results per page (default 20, max 100)

Required range: 1 <= x <= 100
before
string

Cursor for previous page (Base64 encoded)

after
string

Cursor for next page (Base64 encoded)

fields
string

Filter response fields. Use kapso() to include Kapso-specific extensions.

Example: fields=kapso(direction,status,processing_status)

Response

Successfully retrieved messages

data
object[]
required
paging
object