Update WABA chat
curl --request PATCH \
--url https://app.timelines.ai/integrations/api/waba/chats/{chat_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Doe",
"responsible": "john.doe@acme.com",
"closed": false,
"read": true
}
'import requests
url = "https://app.timelines.ai/integrations/api/waba/chats/{chat_id}"
payload = {
"name": "John Doe",
"responsible": "john.doe@acme.com",
"closed": False,
"read": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'John Doe', responsible: 'john.doe@acme.com', closed: false, read: true})
};
fetch('https://app.timelines.ai/integrations/api/waba/chats/{chat_id}', 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://app.timelines.ai/integrations/api/waba/chats/{chat_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'John Doe',
'responsible' => 'john.doe@acme.com',
'closed' => false,
'read' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.timelines.ai/integrations/api/waba/chats/{chat_id}"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"responsible\": \"john.doe@acme.com\",\n \"closed\": false,\n \"read\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.timelines.ai/integrations/api/waba/chats/{chat_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"responsible\": \"john.doe@acme.com\",\n \"closed\": false,\n \"read\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/integrations/api/waba/chats/{chat_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"responsible\": \"john.doe@acme.com\",\n \"closed\": false,\n \"read\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"id": "1000001",
"name": "John Doe",
"is_group": false,
"closed": false,
"read": true,
"labels": [
"label1",
"label2",
"label3"
],
"chatgpt_autoresponse_enabled": true,
"chat_url": "https://app.timelines.ai/chat/1000001/messages/",
"created_timestamp": "2024-01-08 10:35:18 +0200",
"unattended": false,
"waba_account_id": 4021,
"service_window_is_open": true,
"service_window_expires_at": "2024-01-30 13:55:04 +0200",
"phone": "+15551230000",
"responsible_email": "kate.smitch@acme.com",
"responsible_name": "Kate Smith",
"last_message_uid": "4f43a9a0-b87e-4667-adfd-689674c3326c",
"last_message_timestamp": "2024-01-29 13:55:04 +0200",
"last_message": {
"uid": "de919486-0c93-409d-ae66-c2bbb544faca",
"chat_id": "1000001",
"timestamp": "2023-06-18 15:19:23 +0300",
"received_timestamp": "2023-06-18 14:39:25 +0300",
"sender_phone": "+972540000001",
"sender_name": "John Doe",
"recipient_phone": "+972540000002",
"recipient_name": "Kate Smith",
"from_me": true,
"status": "Read",
"origin": "Public API",
"has_attachment": true,
"message_type": "Note",
"data": {
"key1": "value1",
"key2": "value2"
},
"created_by": "Kate Smith",
"text": "Hello, Kate👍",
"attachment_url": "https://acme.com/logo.png",
"attachment_filename": "logo.png"
},
"group_members": [
{
"name": "John Doe",
"phone": "+972502222222",
"role": "admin",
"chat_id": 123456
}
]
}
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}Chats
Update WABA Chat
Update a WABA chat (assignment, status, and read state).
PATCH
/
waba
/
chats
/
{chat_id}
Update WABA chat
curl --request PATCH \
--url https://app.timelines.ai/integrations/api/waba/chats/{chat_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Doe",
"responsible": "john.doe@acme.com",
"closed": false,
"read": true
}
'import requests
url = "https://app.timelines.ai/integrations/api/waba/chats/{chat_id}"
payload = {
"name": "John Doe",
"responsible": "john.doe@acme.com",
"closed": False,
"read": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'John Doe', responsible: 'john.doe@acme.com', closed: false, read: true})
};
fetch('https://app.timelines.ai/integrations/api/waba/chats/{chat_id}', 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://app.timelines.ai/integrations/api/waba/chats/{chat_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'John Doe',
'responsible' => 'john.doe@acme.com',
'closed' => false,
'read' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.timelines.ai/integrations/api/waba/chats/{chat_id}"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"responsible\": \"john.doe@acme.com\",\n \"closed\": false,\n \"read\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.timelines.ai/integrations/api/waba/chats/{chat_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"responsible\": \"john.doe@acme.com\",\n \"closed\": false,\n \"read\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/integrations/api/waba/chats/{chat_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"responsible\": \"john.doe@acme.com\",\n \"closed\": false,\n \"read\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"id": "1000001",
"name": "John Doe",
"is_group": false,
"closed": false,
"read": true,
"labels": [
"label1",
"label2",
"label3"
],
"chatgpt_autoresponse_enabled": true,
"chat_url": "https://app.timelines.ai/chat/1000001/messages/",
"created_timestamp": "2024-01-08 10:35:18 +0200",
"unattended": false,
"waba_account_id": 4021,
"service_window_is_open": true,
"service_window_expires_at": "2024-01-30 13:55:04 +0200",
"phone": "+15551230000",
"responsible_email": "kate.smitch@acme.com",
"responsible_name": "Kate Smith",
"last_message_uid": "4f43a9a0-b87e-4667-adfd-689674c3326c",
"last_message_timestamp": "2024-01-29 13:55:04 +0200",
"last_message": {
"uid": "de919486-0c93-409d-ae66-c2bbb544faca",
"chat_id": "1000001",
"timestamp": "2023-06-18 15:19:23 +0300",
"received_timestamp": "2023-06-18 14:39:25 +0300",
"sender_phone": "+972540000001",
"sender_name": "John Doe",
"recipient_phone": "+972540000002",
"recipient_name": "Kate Smith",
"from_me": true,
"status": "Read",
"origin": "Public API",
"has_attachment": true,
"message_type": "Note",
"data": {
"key1": "value1",
"key2": "value2"
},
"created_by": "Kate Smith",
"text": "Hello, Kate👍",
"attachment_url": "https://acme.com/logo.png",
"attachment_filename": "logo.png"
},
"group_members": [
{
"name": "John Doe",
"phone": "+972502222222",
"role": "admin",
"chat_id": 123456
}
]
}
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
an id of the chat as appears in TimelinesAI (can be found in the URL of the chat page, or in the payload of outbound webhook). Supports sending messages to a group.
Body
application/json
Chat's name (must be unique in workspace)
Maximum string length:
256Example:
"John Doe"
Assign team member as responsible (specified by registration email in TimelinesAI) or unassign a chat from responsible by supplying an empty string ("").
Example:
"john.doe@acme.com"
Is the chart closed (true) or open (false)
Example:
false
Is the chat read (true) or unread (false)
Example:
true
⌘I

