curl --request POST \
--url https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai', 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/{conversation_id}/resume-ai",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/{conversation_id}/resume-ai"
req, _ := http.NewRequest("POST", 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.post("https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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>"
}{
"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>"
}
}{
"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>"
}
}Hand a conversation back to the AI agent
An AI agent configured on the conversation’s queue takes it back, chosen by the queue’s split between its agents. It replies the next time the contact writes. This call sends nothing itself, even if the contact’s last message is still unanswered.
Do not rely on it to restart follow-ups: whether any are scheduled again depends on the agent’s follow-up settings and on what happened while people had the conversation.
Answers 409 conversation_already_with_ai when the agent already has it, and 409 no_agent_available when its queue has no active AI agent with a share of its work.
curl --request POST \
--url https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai', 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/{conversation_id}/resume-ai",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/{conversation_id}/resume-ai"
req, _ := http.NewRequest("POST", 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.post("https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/conversations/{conversation_id}/resume-ai")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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>"
}{
"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>"
}
}{
"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>.
Headers
A unique value (a UUID works) that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the original response instead of acting twice; the same key with a different body is a 409 idempotency_key_reused.
255Path Parameters
Unique identifier for a conversation.
^conv_[0-9a-f]{32}$"conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
Response
Successful Response
One thread with one contact on one channel.
Unique identifier for a conversation.
^conv_[0-9a-f]{32}$"conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
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 When anything about the conversation last changed, including who handles it and whether it is open.
Platform this thread runs on, e.g. whatsapp.
whatsapp_api, whatsapp, instagram, slack, web_widget, botconversa Unique identifier for a channel.
^chn_[0-9a-f]{32}$"chn_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
Unique identifier for a contact.
^con_[0-9a-f]{32}$"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
Who is handling it now: the AI agent (kind: agent) or a teammate (kind: user). Null while it waits in a queue for a teammate, and once it is closed.
Show child attributes
Show child attributes
Whether a person has been asked for: the AI agent asked for one, or a teammate was assigned or took it over. It does not say who has the conversation — one routed straight to a teammate can read false — so use handler for that. Null once closed.
"conversation"The queue it is in while open.