curl --request GET \
--url https://api.chatsailer.com/v1/conversations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chatsailer.com/v1/conversations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chatsailer.com/v1/conversations', 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.chatsailer.com/v1/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.chatsailer.com/v1/conversations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.chatsailer.com/v1/conversations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"created_at": "2023-11-07T05:31:56Z",
"id": "conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"status": "waiting",
"updated_at": "2023-11-07T05:31:56Z",
"channel": "whatsapp_api",
"channel_id": "chn_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"contact_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"handler": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"last_message_at": "2023-11-07T05:31:56Z",
"needs_human": true,
"object": "conversation",
"queue_name": "<string>"
}
],
"links": {
"next": "<string>"
},
"meta": {
"has_more": true,
"limit": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}List conversations
Conversations in this workspace, most recently active first.
Filters combine: repeating one parameter matches any of its values, and different parameters must all match. For example ?status=waiting&status=active&handler=user&handler=none is every open conversation the AI agent is not handling.
Sandbox and simulator threads are excluded: they are tests with nobody on the other end.
curl --request GET \
--url https://api.chatsailer.com/v1/conversations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chatsailer.com/v1/conversations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chatsailer.com/v1/conversations', 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.chatsailer.com/v1/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.chatsailer.com/v1/conversations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.chatsailer.com/v1/conversations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"created_at": "2023-11-07T05:31:56Z",
"id": "conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"status": "waiting",
"updated_at": "2023-11-07T05:31:56Z",
"channel": "whatsapp_api",
"channel_id": "chn_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"contact_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"handler": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"last_message_at": "2023-11-07T05:31:56Z",
"needs_human": true,
"object": "conversation",
"queue_name": "<string>"
}
],
"links": {
"next": "<string>"
},
"meta": {
"has_more": true,
"limit": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Authorizations
A workspace API token (sk_live_...) or an OAuth access token (oat_live_...). Create workspace tokens in Settings > API. Send either as Authorization: Bearer <token>.
Query Parameters
Only conversations in this status. Repeat to match any of several.
Where a conversation stands.
waiting: open, and nobody has picked it up yet — it is in a queue, or
assigned to a teammate who has not accepted it. active: open and being
handled, by the AI agent or by a teammate. closed: finished.
waiting, active, closed Only conversations on this platform. Repeat to match any of several.
The messaging platform a channel runs on.
whatsapp_api is the official WhatsApp Business Platform, the only one that
supports message templates. whatsapp is a number connected through the
WhatsApp app. botconversa is a channel fed by an external chatbot
integration.
whatsapp_api, whatsapp, instagram, slack, web_widget, botconversa Only conversations on this channel. Repeat to match any of several.
Unique identifier for a channel.
^chn_[0-9a-f]{32}$Only conversations with this contact. Repeat to match any of several.
Unique identifier for a contact.
^con_[0-9a-f]{32}$Only conversations this campaign started. Repeat to match any of several.
Unique identifier for a campaign.
^camp_[0-9a-f]{32}$Only open conversations where needs_human has this value. To find conversations by who handles them, use handler.
Only conversations whose handler is of this kind: agent (the AI agent), user (a teammate) or none (nobody: waiting in a queue, or closed). Repeat to match any of several.
Who handles a conversation: the AI agent, a teammate, or nobody.
agent, user, none Only conversations whose updated_at is at or after this instant. Must include a timezone offset.
Ordering key, - prefix for descending. One of: last_message_at, created_at. Default -last_message_at; conversations with no messages sort last either way.
"-last_message_at"
Items per page (max 200).
1 <= x <= 200Opaque cursor from a previous response's links.next.