Skip to main content
POST
https://mtxbiyilvgwhbdptysex.supabase.co/functions/v1
/
list-messages
curl -X POST https://mtxbiyilvgwhbdptysex.supabase.co/functions/v1/list-messages \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "limit": 20,
    "phone_number": "+14155551234"
  }'
{
  "messages": [
    {
      "id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01",
      "thread_id": "9f5a0b11-d4e5-7f6a-2b3c-901234def012",
      "from_number": "+16045551234",
      "to_number": "+14155551234",
      "body": "Your appointment is confirmed for tomorrow at 2pm.",
      "direction": "outbound",
      "status": "delivered",
      "is_ai_generated": false,
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": "7d3e8b00-b2c3-5d4e-0a1b-789012bcde01",
      "thread_id": "9f5a0b11-d4e5-7f6a-2b3c-901234def012",
      "from_number": "+14155551234",
      "to_number": "+16045551234",
      "body": "Thank you! I'll be there.",
      "direction": "inbound",
      "status": "delivered",
      "is_ai_generated": false,
      "created_at": "2024-01-15T10:35:00Z"
    }
  ],
  "total": 42,
  "has_more": true
}
Retrieve a paginated list of messages for your account. Supports filtering by thread, direction, and date range.

Request Body

limit
integer
default:50
Maximum number of messages to return. Max: 100.
offset
integer
default:0
Number of messages to skip for pagination.
thread_id
string
Filter by specific conversation thread.
direction
string
Filter by message direction: inbound or outbound.
phone_number
string
Filter by phone number (either from or to).
from_date
string
Filter messages after this ISO 8601 date.
to_date
string
Filter messages before this ISO 8601 date.

Response

messages
array
Array of message objects.
total
integer
Total number of messages matching the filters.
has_more
boolean
Whether there are more messages to paginate through.
curl -X POST https://mtxbiyilvgwhbdptysex.supabase.co/functions/v1/list-messages \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "limit": 20,
    "phone_number": "+14155551234"
  }'
{
  "messages": [
    {
      "id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01",
      "thread_id": "9f5a0b11-d4e5-7f6a-2b3c-901234def012",
      "from_number": "+16045551234",
      "to_number": "+14155551234",
      "body": "Your appointment is confirmed for tomorrow at 2pm.",
      "direction": "outbound",
      "status": "delivered",
      "is_ai_generated": false,
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": "7d3e8b00-b2c3-5d4e-0a1b-789012bcde01",
      "thread_id": "9f5a0b11-d4e5-7f6a-2b3c-901234def012",
      "from_number": "+14155551234",
      "to_number": "+16045551234",
      "body": "Thank you! I'll be there.",
      "direction": "inbound",
      "status": "delivered",
      "is_ai_generated": false,
      "created_at": "2024-01-15T10:35:00Z"
    }
  ],
  "total": 42,
  "has_more": true
}