List SMS Messages
curl --request GET \
--url https://api.example.com/v1/sms-messagesimport requests
url = "https://api.example.com/v1/sms-messages"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/sms-messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/sms-messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sms-messages"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/sms-messages")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sms-messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodySMS
List SMS Messages
Returns a paginated list of SMS messages (sent and received) with optional filters.
GET
/
v1
/
sms-messages
List SMS Messages
curl --request GET \
--url https://api.example.com/v1/sms-messagesimport requests
url = "https://api.example.com/v1/sms-messages"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/sms-messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/sms-messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sms-messages"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/sms-messages")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sms-messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyList SMS Messages
Returns a paginated list of SMS messages (sent and received) with optional filters. Default sort:created_at DESC.
Request
GET /v1/sms-messages
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number (default: 1) |
per_page | integer | No | Results per page, max 100 (default: 25) |
lead_id | uuid | No | Filter by lead ID |
direction | string | No | Filter by direction: inbound or outbound |
status | string | No | Filter by delivery status: queued, sent, delivered, failed, received, undelivered |
phone | string | No | Filter by phone number (matches from_number or to_number) in E.164 format |
date_from | string | No | Filter messages created after this ISO 8601 timestamp |
date_to | string | No | Filter messages created before this ISO 8601 timestamp |
include | string | No | Set to "lead" to embed lead details (first_name, last_name, email, phone, company_name, title) in each message object. |
workspace_id | uuid | No | Filter by workspace ID. Use the List Workspaces endpoint to get available IDs. Omit to return messages from all workspaces. |
Example
curl -X GET \
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/sms-messages?lead_id=a1b2c3d4-...&direction=outbound&per_page=25" \
-H "Authorization: Bearer rchd_live_xxxxxxxxxxxx"
const params = new URLSearchParams({
lead_id: "a1b2c3d4-...",
direction: "outbound",
per_page: "25"
});
const response = await fetch(
`https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/sms-messages?${params}`,
{ headers: { "Authorization": "Bearer rchd_live_xxxxxxxxxxxx" } }
);
const { data, meta } = await response.json();
import requests
response = requests.get(
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/sms-messages",
headers={"Authorization": "Bearer rchd_live_xxxxxxxxxxxx"},
params={"lead_id": "a1b2c3d4-...", "direction": "outbound", "per_page": 25}
)
result = response.json()
Embed lead details
curl -X GET \
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/sms-messages?include=lead&per_page=25" \
-H "Authorization: Bearer rchd_live_xxxxxxxxxxxx"
const response = await fetch(
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/sms-messages?include=lead&per_page=25",
{ headers: { "Authorization": "Bearer rchd_live_xxxxxxxxxxxx" } }
);
const { data } = await response.json();
// Each message now includes a "lead" object with first_name, last_name, email, phone, company_name, title
Response
{
"data": [
{
"id": "msg-uuid-1",
"lead_id": "a1b2c3d4-...",
"from_number": "+33140000000",
"to_number": "+33612345678",
"body": "Hi John, following up on our call last week. Are you available for a quick chat tomorrow?",
"direction": "outbound",
"status": "delivered",
"segment_count": 2,
"twilio_message_sid": "SMxxxxxxx",
"read_at": null,
"created_at": "2026-09-14T10:00:00.000Z"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | uuid | Message unique identifier |
lead_id | uuid | Associated lead ID (if linked) |
from_number | string | Sender phone number |
to_number | string | Recipient phone number |
body | string | Message content |
direction | string | inbound (received) or outbound (sent) |
status | string | Delivery status: queued, sent, delivered, failed, received, undelivered |
segment_count | integer | Number of SMS segments used |
twilio_message_sid | string | Twilio message SID (if applicable) |
read_at | datetime | Timestamp when the message was marked as read (if applicable) |
created_at | datetime | Message creation timestamp |
workspace_id | uuid | Workspace ID the message belongs to (null = default workspace) |
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=967f00940a17d1d8cc11bd8995dc98d0)
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=5072033d90dfd5e7cc9349712ea4e145)