List Channel Messages
curl --request GET \
--url https://api.example.com/v1/channels/messagesimport requests
url = "https://api.example.com/v1/channels/messages"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/channels/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/channels/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/channels/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/channels/messages")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/channels/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_body{
"data": {
"messages": [
{
"id": "<string>",
"channel": "<string>",
"direction": "<string>",
"sender": "<string>",
"recipient": "<string>",
"body": "<string>",
"attachments": [
{}
],
"contact_id": "<string>",
"deal_id": "<string>",
"sent_at": "<string>"
}
]
},
"meta": {}
}Channels
List Channel Messages
Retrieve recent messages across all connected messaging channels
GET
/
v1
/
channels
/
messages
List Channel Messages
curl --request GET \
--url https://api.example.com/v1/channels/messagesimport requests
url = "https://api.example.com/v1/channels/messages"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/channels/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/channels/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/channels/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/channels/messages")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/channels/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_body{
"data": {
"messages": [
{
"id": "<string>",
"channel": "<string>",
"direction": "<string>",
"sender": "<string>",
"recipient": "<string>",
"body": "<string>",
"attachments": [
{}
],
"contact_id": "<string>",
"deal_id": "<string>",
"sent_at": "<string>"
}
]
},
"meta": {}
}Request
Query Parameters
string
Filter to a single channel:
slack, teams, whatsapp, telegram, or email.string
Filter to messages linked to the given contact.
string
Filter to messages linked to the given deal.
string
inbound or outbound.string
ISO 8601 lower bound on
sent_at.integer
default:"1"
Page number.
integer
default:"25"
Results per page. Maximum 100.
Headers
Authorization: Bearer wbk_your_api_key_here
Response
object
Show properties
Show properties
array
Show Message object
Show Message object
string
Message identifier
string
slack, teams, whatsapp, telegram, or emailstring
inbound or outboundstring
Sender identifier (phone, handle, email, or user ID)
string
Recipient identifier
string
Message text
array
Attachment metadata
string
Linked contact, if resolved
string
Linked deal, if any
string
ISO 8601 timestamp
object
Pagination metadata:
page, per_page, total.X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/channels/messages?channel=slack&per_page=50" \
-H "Authorization: Bearer wbk_your_api_key_here"
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
r = requests.get(
f"{BASE_URL}/v1/channels/messages",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"channel": "slack", "per_page": 50},
)
for m in r.json()["data"]["messages"]:
print(m["sender"], m["body"][:60])
const url = new URL('https://data.leadlex.com/functions/v1/api-gateway/v1/channels/messages');
url.searchParams.set('channel', 'whatsapp');
const res = await fetch(url, { headers: { Authorization: 'Bearer wbk_your_api_key_here' } });
const { data } = await res.json();
console.log(data.messages.length);
Example Response
{
"data": {
"messages": [
{
"id": "1713351031.001200",
"channel": "slack",
"direction": "outbound",
"sender": "U01234567",
"recipient": "C01234567",
"body": "New deal just closed - congrats team!",
"attachments": [],
"contact_id": null,
"deal_id": "deal_01HY1",
"sent_at": "2026-04-17T10:30:31Z"
}
]
},
"meta": { "page": 1, "per_page": 50, "total": 214 }
}
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing read:channels permission |
| 429 | rate_limited | Rate limit exceeded |