Skip to main content
GET
/
v1
/
messages
List Messages
curl --request GET \
  --url https://api.zavu.dev/v1/messages \
  --header 'Authorization: Bearer <token>'
{
  "items": [
    {
      "id": "msg_abc123",
      "to": "+56912345678",
      "channel": "sms",
      "status": "delivered",
      "text": "Hello from Zavu!",
      "metadata": {},
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:05.000Z"
    },
    {
      "id": "msg_def456",
      "to": "+56987654321",
      "channel": "whatsapp",
      "status": "queued",
      "text": "Your order is ready!",
      "metadata": {
        "orderId": "12345"
      },
      "createdAt": "2024-01-15T10:25:00.000Z",
      "updatedAt": "2024-01-15T10:25:00.000Z"
    }
  ],
  "nextCursor": "xyz789"
}
Retrieve a list of messages for your project. Results are ordered by creation date (newest first).

Query Parameters

status
string
Filter by status: queued, sending, delivered, failed
to
string
Filter by recipient phone number (E.164 format)
channel
string
Filter by channel: sms, whatsapp, telegram, rcs, email
limit
integer
default:"50"
Number of items to return (max: 100)
cursor
string
Pagination cursor from previous response

Response

items
array
Array of message objects
nextCursor
string
Cursor for the next page of results. null if no more results.
{
  "items": [
    {
      "id": "msg_abc123",
      "to": "+56912345678",
      "channel": "sms",
      "status": "delivered",
      "text": "Hello from Zavu!",
      "metadata": {},
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:05.000Z"
    },
    {
      "id": "msg_def456",
      "to": "+56987654321",
      "channel": "whatsapp",
      "status": "queued",
      "text": "Your order is ready!",
      "metadata": {
        "orderId": "12345"
      },
      "createdAt": "2024-01-15T10:25:00.000Z",
      "updatedAt": "2024-01-15T10:25:00.000Z"
    }
  ],
  "nextCursor": "xyz789"
}

Examples

List all messages

curl https://api.zavu.dev/v1/messages \
  -H "Authorization: Bearer zv_live_xxx"

Filter by status

curl "https://api.zavu.dev/v1/messages?status=delivered" \
  -H "Authorization: Bearer zv_live_xxx"

Filter by recipient

curl "https://api.zavu.dev/v1/messages?to=%2B56912345678" \
  -H "Authorization: Bearer zv_live_xxx"

Pagination

curl "https://api.zavu.dev/v1/messages?limit=20&cursor=xyz789" \
  -H "Authorization: Bearer zv_live_xxx"