. Create an API key under API keys.API reference · Conversations
Inbox
Conversations: chat lists, messages of a chat, read state, labels, notes, pin, archive and close.
List the chats of a device
/v1/sessions/{sessionId}/inboxList chats with last message, unread count, and group flag, newest first. q and filter narrow the list on the server.
Path parameters
sessionIdstringrequired
Query parameters
limitintegeroffsetinteger | nullqstringSearch the chat name and last message; 3+ digits also match the numberfilterstringunread,groups,archived,snoozed,mine(support agents),unassigned,agent:<agentId>orlabel:<name>. Any filter exceptarchivedandsnoozedleaves out archived and snoozed chats.
Responses
- 200Inbox listing
Response fields
inboxarray of objectrequiredinbox[].idstringrequiredinbox[].session_idstringrequiredinbox[].chat_idstringrequiredinbox[].chat_namestring | nullrequiredinbox[].last_messagestring | nullrequiredinbox[].snoozed_untilinteger | nullSnoozed until this time (epoch ms):POST …/inbox/{chatId}/snoozeinbox[].last_message_typestring | nullType of the last customer message (text,image,video,audio,document,sticker): a photo or voice note has no text inlast_messageinbox[].last_message_atintegerrequiredinbox[].unread_countintegerrequiredinbox[].is_groupintegerrequired1 = group chat, 0 = 1-on-1inbox[].agent_idstring | nullrequiredAssigned CS agent, or null for unassignedinbox[].statusstringrequired
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"inbox": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"session_id": "YOUR_DEVICE_ID",
"chat_id": "+447700900123",
"chat_name": "string",
"last_message": "Hi Sam, your order has shipped.",
"snoozed_until": 1767225600000,
"last_message_type": "Hi Sam, your order has shipped.",
"last_message_at": 1767225600000,
"unread_count": 12,
"is_group": 1,
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"status": "active"
}
]
}List chats seen in history
/v1/sessions/{sessionId}/contactsDistinct chat ids found in the stored message history of the session, most recently active first (max 100). Derived from the message log, not from the WhatsApp address book.
Path parameters
sessionIdstringrequiredSession (device) id
Responses
- 200Chats
Response fields
contactsarray of objectrequiredcontacts[].chat_idstringrequiredcontacts[].last_seenintegerrequiredTime of the latest message in the chat (Unix epoch, milliseconds)
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/contacts" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/contacts', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/contacts",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/contacts', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/contacts", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"contacts": [
{
"chat_id": "+447700900123",
"last_seen": 1
}
]
}List the messages of a chat
/v1/sessions/{sessionId}/inbox/{chatId}/messagesMessages of one chat, oldest first within the page. Pass next_cursor as before to load older messages. Rows are returned as stored in the message log (more columns than listed may be present).
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Query parameters
limitintegerPage size; values outside 1-100 are clampedbeforenumbercreated_at(epoch ms) of the oldest message already loaded; non-numeric values are ignored
Responses
- 200A page of messages
Response fields
messagesarray of objectrequiredOldest firstmessages[].idstringrequiredGateway message id (ULID)messages[].directionstringrequiredmessages[].chat_idstringrequiredChat JIDmessages[].message_typestringrequiredtext,image,video,document,audio,sticker,location,poll,contactorreactionmessages[].bodystring | nullrequiredText content, if anymessages[].media_r2_keystring | nullrequiredKey of the stored media file; download it withGET /v1/sessions/{sessionId}/messages/{id}/media. Customer photos, documents, voice notes and videos are kept up to 16 MB each (view-once media and larger files are not)messages[].media_namestring | nullFile name of a document a customer sentmessages[].statusstringrequiredqueued,sent,delivered,read,failed,cancelledordeletedmessages[].created_atintegerrequiredCreation time (Unix epoch, milliseconds)messages[].wa_message_idstring | nullrequiredWhatsApp message id; null until the message was handed to WhatsAppmessages[].sent_atinteger | nullrequiredTime the message was handed to WhatsApp (Unix epoch, milliseconds)messages[].errorstring | nullrequiredFailure reason of a failed messagehas_morebooleanrequiredtruewhen the page is fullnext_cursorinteger | nullrequiredcreated_atof the oldest message in the page (Unix epoch, milliseconds), or null
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/messages" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/messages', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/messages",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/messages', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/messages", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"messages": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"direction": "inbound",
"chat_id": "+447700900123",
"message_type": "Hi Sam, your order has shipped.",
"body": "Hi Sam, your order has shipped.",
"media_r2_key": "uploads/abc123.jpg",
"media_name": "string",
"status": "active",
"created_at": 1767225600000,
"wa_message_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"sent_at": 1767225600000,
"error": "string"
}
],
"has_more": true,
"next_cursor": 1
}List the files of a chat
/v1/sessions/{sessionId}/inbox/{chatId}/mediaPhotos, videos, documents, voice notes and stickers of one chat (sent and received) that have a stored file, newest first. Download each with GET /v1/media/{key}. Page with before = next_before.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Query parameters
limitintegerDefault 60beforeintegernext_beforeof the previous page
Responses
- 200Files
Response fields
mediaarray of objectrequiredmedia[].idstringrequiredmedia[].directionstringrequiredmedia[].message_typestringrequiredmedia[].media_r2_keystringrequiredmedia[].media_namestring | nullrequiredmedia[].bodystring | nullrequiredCaptionmedia[].created_atintegerrequiredSent or received (Unix epoch, milliseconds)next_beforeinteger | nullrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/media" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/media', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/media",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/media', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/media", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"media": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"direction": "string",
"message_type": "Hi Sam, your order has shipped.",
"media_r2_key": "uploads/abc123.jpg",
"media_name": "string",
"body": "Hi Sam, your order has shipped.",
"created_at": 1767225600000
}
],
"next_before": 1767225600000
}Send a message later
/v1/sessions/{sessionId}/inbox/{chatId}/schedule"Send later" from a chat, for the owner and support agents: one text, photo, video, document or audio file (uploaded first) goes to this chat at at (1 minute to 90 days ahead). It appears with the other scheduled messages (GET /v1/sessions/{sessionId}/scheduled), where it can be cancelled. Recorded as message.schedule.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Request body
atintegerrequiredWhen to send (epoch ms)typestringDefaulttextbodystringThe text (typetext)media_r2_keystringAn uploaded file of this business (other types)captionstring
Responses
- 201Scheduled
Response fields
idstringrequiredstatusstringrequiredscheduled_atintegerrequired
- 400
VALIDATION_ERROR - 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/schedule" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"at": 1767225600000,
"type": "text",
"body": "Hi Sam, your order has shipped."
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/schedule', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"at": 1767225600000,
"type": "text",
"body": "Hi Sam, your order has shipped."
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/schedule",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"at": 1767225600000,
"type": "text",
"body": "Hi Sam, your order has shipped.",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/schedule', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'at' => 1767225600000,
'type' => 'text',
'body' => 'Hi Sam, your order has shipped.',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"at": 1767225600000,
"type": "text",
"body": "Hi Sam, your order has shipped."
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/schedule", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"status": "pending",
"scheduled_at": 1767225600000
}Act on several chats
/v1/sessions/{sessionId}/inbox/bulkUp to 200 chats of this device at once: read (unread count to 0), archive, unarchive, resolve (as Close a chat, but no satisfaction survey is sent), assign (agent_id), label / unlabel (label). Chat ids not in the device's inbox are skipped. Resolve and assign are recorded per chat in the activity log.
Path parameters
sessionIdstringrequiredSession (device) id
Request body
chat_idsarray of stringrequiredactionstringrequiredagent_idstringForassignlabelstringForlabelandunlabel
Responses
- 200Done
Response fields
okbooleanrequiredactionstringrequiredchangedintegerrequiredskippedintegerrequiredIds not in this inboxfailedarray of objectrequiredFor example the label limit was reachedfailed[].chat_idstringrequiredfailed[].errorstringrequired
- 400
VALIDATION_ERROR - 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/bulk" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat_ids": [
"+447700900123"
],
"action": "read",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"label": "string"
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/bulk', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"chat_ids": [
"+447700900123"
],
"action": "read",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"label": "string"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/bulk",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"chat_ids": [
"+447700900123",
],
"action": "read",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"label": "string",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/bulk', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'chat_ids' => [
'+447700900123',
],
'action' => 'read',
'agent_id' => '01JA5V6Q8M2H7G4K9P3T0R1S2X',
'label' => 'string',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"chat_ids": [
"+447700900123"
],
"action": "read",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"label": "string"
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/bulk", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true,
"action": "string",
"changed": 1,
"skipped": 1,
"failed": [
{
"chat_id": "+447700900123",
"error": "string"
}
]
}Snooze a chat
/v1/sessions/{sessionId}/inbox/{chatId}/snoozeHides the chat from the inbox list until until (at most 30 days ahead). When the time comes the chat is back on top and whoever snoozed it gets a push reminder (SSE chat.snooze_ended). A new message from the customer ends the snooze at once. until: null wakes the chat now. The inbox list returns snoozed_until per chat; hiding snoozed chats is up to the client.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Request body
untilinteger | nullrequiredEpoch milliseconds, at least 30 seconds ahead;nullto wake the chat
Responses
- 200Snoozed (or woken)
Response fields
okbooleanrequiredsnoozed_untilinteger | nullrequired
- 400
VALIDATION_ERROR: missing, past or too faruntil - 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Chat not in the inbox of this device; unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/snooze" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"until": 1767225600000
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/snooze', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"until": 1767225600000
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/snooze",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"until": 1767225600000,
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/snooze', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'until' => 1767225600000,
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"until": 1767225600000
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/snooze", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true,
"snoozed_until": 1767225600000
}Export a conversation
/v1/sessions/{sessionId}/inbox/{chatId}/transcriptEvery message of one chat on this device, oldest first, including messages already moved to the message archive (up to 20,000, newest kept). Reactions are left out. With notes=1 the team's internal notes are placed between the messages. format=txt returns a plain-text file (times in the business timezone); otherwise JSON. Each export is recorded in the activity log (chat.export).
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Query parameters
formatstringDefaultjsonnotesstring1includes internal notes
Responses
- 200The conversation (JSON;
text/plainattachment withformat=txt)Response fields
chat_idstringrequiredchat_namestring | nullrequiredphonestring | nullrequiredbusiness_namestring | nullrequiredtimezonestringrequiredIANA timezone of the businessgenerated_atintegerrequiredExport time (Unix epoch, milliseconds)countintegerrequiredtruncatedbooleanrequiredtruewhen the chat has more than 20,000 messages (the oldest are left out)entriesarray of objectrequiredentries[].kindstringrequiredentries[].atintegerrequiredTime (Unix epoch, milliseconds)entries[].directionstring | nullrequiredinboundoroutbound;nullfor notesentries[].typestringrequiredMessage type (text,image,document…) ornoteentries[].bodystring | nullrequiredentries[].namestring | nullrequiredDocument file name, or the author of a noteentries[].statusstring | nullrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/transcript" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/transcript', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/transcript",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/transcript', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/transcript", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"chat_id": "+447700900123",
"chat_name": "string",
"phone": "+447700900123",
"business_name": "string",
"timezone": "Asia/Jakarta",
"generated_at": 1767225600000,
"count": 12,
"truncated": true,
"entries": [
{
"kind": "message",
"at": 1767225600000,
"direction": "string",
"type": "string",
"body": "Hi Sam, your order has shipped.",
"name": "Example",
"status": "active"
}
]
}Close a chat
/v1/sessions/{sessionId}/inbox/{chatId}/closeMarks the inbox chat closed and resolves its agent assignment. If the tenant enabled the CSAT survey (setting csat_config), the session is connected and the chat is a one-to-one chat, the survey question is sent and a pending response is recorded.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Responses
- 200Closed
Response fields
okbooleanrequiredstatusstringrequiredcsat_sentbooleanrequiredtruewhen the CSAT survey was sent
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/close" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/close', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/close",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/close', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/close", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true,
"status": "closed",
"csat_sent": true
}Reopen a chat
/v1/sessions/{sessionId}/inbox/{chatId}/reopenOpens a closed or resolved chat again: it shows as open, counts for unanswered-chat alerts and the queue, and its assignment goes back to the agent who had it. A chat also reopens by itself when the customer writes again (not for a 1-5 answer to the satisfaction survey); the live feed then sends chat.reopened. Recorded as chat.reopen when it changed something.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Responses
- 200Open
Response fields
okbooleanrequiredstatusstringrequiredreopenedbooleanrequiredfalsewhen the chat was already open
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404The chat is not in this device's inbox (
NOT_FOUND); unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/reopen" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/reopen', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/reopen",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/reopen', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/reopen", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true,
"status": "open",
"reopened": true
}Reset the unread counter
/v1/sessions/{sessionId}/inbox/{chatId}/readSets the unread counter of the inbox chat to zero. This is local only: no read receipt is sent to WhatsApp (see POST …/messages/{msgId}/read). Answers 200 even when the chat is unknown. For a person's chat it also asks WhatsApp for their presence, so the SSE stream gets chat.presence (typing, recording) while the chat is open.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Responses
- 200Reset
Response fields
okbooleanrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/read" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/read', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/read",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/read', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/read", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true
}List the internal notes of a chat
/v1/sessions/{sessionId}/inbox/{chatId}/notesNotes the team wrote in this chat, oldest first (max 500). Notes are never sent to the customer.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Responses
- 200Notes
Response fields
notesarray of objectrequirednotes[].idstringrequirednotes[].chat_idstringrequirednotes[].authorobjectrequirednotes[].author.typestringrequirednotes[].author.idstring | nullrequiredAgent id (or API key id)notes[].author.namestring | nullrequirednotes[].bodystringrequirednotes[].mentionsarray of stringrequiredMentioned agent ids, andownernotes[].created_atintegerrequiredWhen the note was written (Unix epoch, milliseconds)
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"notes": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"chat_id": "+447700900123",
"author": {
"type": "owner",
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"name": "Example"
},
"body": "Hi Sam, your order has shipped.",
"mentions": [
"string"
],
"created_at": 1767225600000
}
]
}Write an internal note in a chat
/v1/sessions/{sessionId}/inbox/{chatId}/notesAdds a note for the team (1-2 000 characters), never sent to the customer. @Name of an agent, or @owner, mentions them: a push notification to their devices and the SSE event chat.note with mentions.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Request body
bodystringtextstringOlder name ofbody
Responses
- 201Written
Response fields
okbooleanrequirednoteobjectrequirednote.idstringrequirednote.chat_idstringrequirednote.authorobjectrequirednote.author.typestringrequirednote.author.idstring | nullrequiredAgent id (or API key id)note.author.namestring | nullrequirednote.bodystringrequirednote.mentionsarray of stringrequiredMentioned agent ids, andownernote.created_atintegerrequiredWhen the note was written (Unix epoch, milliseconds)notesarray of stringrequiredAll note texts of the chat, newest first (older shape)
- 400Empty or too long (
VALIDATION_FAILED) - 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "Hi Sam, your order has shipped.",
"text": "Hi Sam, your order has shipped."
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"body": "Hi Sam, your order has shipped.",
"text": "Hi Sam, your order has shipped."
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"body": "Hi Sam, your order has shipped.",
"text": "Hi Sam, your order has shipped.",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'body' => 'Hi Sam, your order has shipped.',
'text' => 'Hi Sam, your order has shipped.',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"body": "Hi Sam, your order has shipped.",
"text": "Hi Sam, your order has shipped."
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true,
"note": {
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"chat_id": "+447700900123",
"author": {
"type": "owner",
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"name": "Example"
},
"body": "Hi Sam, your order has shipped.",
"mentions": [
"string"
],
"created_at": 1767225600000
},
"notes": [
"Prefers delivery after 5 pm"
]
}Delete an internal note
/v1/sessions/{sessionId}/inbox/{chatId}/notes/{noteId}The author, or the business owner, deletes a note. Recorded as chat.note_delete.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is appliednoteIdstringrequired
Responses
- 200Deleted
Response fields
okbooleanrequired
- 401Missing or invalid credentials
- 403Not the author or the owner (
FORBIDDEN); the API key is restricted to other sessions - 404Note not found (
NOT_FOUND); unknown session, or a session of another tenant
curl -X DELETE "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes/NOTE_ID" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes/NOTE_ID', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.delete(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes/NOTE_ID",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('DELETE', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes/NOTE_ID', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/notes/NOTE_ID", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true
}Get labels, notes, pin and archive state
/v1/sessions/{sessionId}/inbox/{chatId}/metadataReturns the organisation data of a chat. tags are the chat's labels with their colours: for a chat with a person they are the labels of that person's contact (see GET …/labels). A chat without any stored data returns empty tags and notes with pinned and archived false.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Responses
- 200Chat metadata
Response fields
tagsarray of objectrequiredTags attached to the chattags[].namestringrequiredtags[].colorstringrequirednotesarray of stringrequiredInternal notes, newest firstpinnedbooleanrequiredarchivedbooleanrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"tags": [
{
"name": "Example",
"color": "#0a7350"
}
],
"notes": [
"Prefers delivery after 5 pm"
],
"pinned": true,
"archived": true
}Replace labels, notes, pin and archive state
/v1/sessions/{sessionId}/inbox/{chatId}/metadataReplaces the whole record: notes left out are reset to empty, pinned and archived to false. tags (label names; colours are ignored, they come from the label catalogue) replaces the chat's labels when given and leaves them alone when left out. Prefer PUT …/labels and the dedicated note, pin and archive calls.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Request body
tagsarray of objecttags[].namestringrequiredtags[].colorstringrequirednotesarray of stringpinnedbooleanAny truthy value pinsarchivedbooleanAny truthy value archives
Responses
- 200Saved
Response fields
okbooleanrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X PUT "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tags": [
{
"name": "VIP",
"color": "#0a7350"
}
],
"notes": [
"Prefers delivery after 5 pm"
],
"pinned": true,
"archived": false
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"tags": [
{
"name": "VIP",
"color": "#0a7350"
}
],
"notes": [
"Prefers delivery after 5 pm"
],
"pinned": true,
"archived": false
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.put(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"tags": [
{
"name": "VIP",
"color": "#0a7350",
},
],
"notes": [
"Prefers delivery after 5 pm",
],
"pinned": True,
"archived": False,
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('PUT', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'tags' => [
[
'name' => 'VIP',
'color' => '#0a7350',
],
],
'notes' => [
'Prefers delivery after 5 pm',
],
'pinned' => true,
'archived' => false,
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"tags": [
{
"name": "VIP",
"color": "#0a7350"
}
],
"notes": [
"Prefers delivery after 5 pm"
],
"pinned": true,
"archived": false
}`)
req, err := http.NewRequest("PUT", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/metadata", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true
}Add a label to a chat (older form)
/v1/sessions/{sessionId}/inbox/{chatId}/tagsAdds one label to the chat (no duplicates; names are normalised to lowercase with dashes). color is used only when the label is new. Prefer POST …/labels, which adds and removes several at once.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Request body
namestringrequiredLabel namecolorstring#RRGGBB, for a new label
Responses
- 200Label added
Response fields
okbooleanrequiredtagsarray of objectrequiredAll tags of the chattags[].namestringrequiredtags[].colorstringrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/tags" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "vip",
"color": "#0a7350"
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/tags', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "vip",
"color": "#0a7350"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/tags",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"name": "vip",
"color": "#0a7350",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/tags', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'name' => 'vip',
'color' => '#0a7350',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"name": "vip",
"color": "#0a7350"
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/tags", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true,
"tags": [
{
"name": "vip",
"color": "#0a7350"
}
]
}Toggle the pin of a chat
/v1/sessions/{sessionId}/inbox/{chatId}/pinFlips the pinned flag of the chat (pinned becomes unpinned and the other way round). The response does not return the new state; read it from the metadata.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Responses
- 200Toggled
Response fields
okbooleanrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/pin" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/pin', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/pin",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/pin', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/pin", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true
}Toggle the archive flag of a chat
/v1/sessions/{sessionId}/inbox/{chatId}/archiveFlips the archived flag of the chat. The response does not return the new state; read it from the metadata.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Responses
- 200Toggled
Response fields
okbooleanrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/archive" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/archive', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/archive",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/archive', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/archive", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true
}Set local message expiry for a chat
/v1/sessions/{sessionId}/inbox/{chatId}/disappearingStores a retention time for the chat. A background job that runs every 5 minutes deletes the messages of the chat older than that time from the stored history. It does not change the disappearing-messages setting of the chat on WhatsApp (for groups see PUT …/groups/{gid}/ephemeral). null or 0 turns it off.
Path parameters
sessionIdstringrequiredSession (device) idchatIdstringrequiredChat id (JID) exactly as stored in the inbox, e.g.447700900123@s.whatsapp.netor…@g.us. URL-decoded by the server; no phone-number normalisation is applied
Request body
duration_msinteger | nullrequiredKeep messages this long, in milliseconds: 3600000 (1 hour) to 31536000000 (365 days);nullor 0 disables
Responses
- 200Saved
Response fields
okbooleanrequiredduration_msinteger | nullrequiredThe stored value;nullwhen off
- 400
duration_msis out of range (VALIDATION_FAILED) - 401Missing or invalid credentials
- 403The API key is restricted to other sessions, or the operation is not available to CS-agent logins
- 404The chat is not in this device's inbox (
NOT_FOUND); unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/disappearing" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"duration_ms": 604800000
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/disappearing', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"duration_ms": 604800000
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/disappearing",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"duration_ms": 604800000,
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/disappearing', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'duration_ms' => 604800000,
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"duration_ms": 604800000
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/inbox/447700900123%40s.whatsapp.net/disappearing", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"ok": true,
"duration_ms": 604800000
}List chats across all devices
/v1/inboxChats of all the tenant's devices, most recent first. For an agent login only chats assigned to that agent or unassigned are returned. Per-device listing is GET /v1/sessions/{sessionId}/inbox.
Query parameters
limitintegerValues outside 1-1 000 are clampedoffsetinteger | null
Responses
- 200Chats
Response fields
inboxarray of objectrequiredinbox[].idstringrequiredinbox[].session_idstringrequiredinbox[].chat_idstringrequiredinbox[].chat_namestring | nullrequiredinbox[].last_messagestring | nullrequiredinbox[].last_message_atinteger | nullrequiredinbox[].unread_countinteger | nullrequiredinbox[].is_groupinteger | nullrequired1 = group chat, 0 = 1-on-1inbox[].agent_idstring | nullrequiredAssigned agent, or nullinbox[].statusstring | nullrequiredopenorresolved
- 401Missing, invalid or expired credentials
curl "https://api.chatkomodo.com/v1/inbox" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/inbox', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.get(
"https://api.chatkomodo.com/v1/inbox",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/inbox', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/inbox", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
}
fmt.Println(string(data))
}{
"inbox": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"session_id": "YOUR_DEVICE_ID",
"chat_id": "+447700900123",
"chat_name": "string",
"last_message": "Hi Sam, your order has shipped.",
"last_message_at": 1767225600000,
"unread_count": 12,
"is_group": 1,
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"status": "active"
}
]
}