. Create an API key under API keys.API reference · Conversations
Agents & assignment
Customer-service agents who work the shared inbox, the queue of unassigned chats, assignment and resolving.
List customer-service agents
/v1/cs/agentsAgents of the tenant, ordered by name. Secrets (access code hash, authenticator secret) are never included.
Responses
- 200Agents
Response fields
agentsarray of objectrequiredagents[].idstringrequiredagents[].api_key_idstringrequiredOwning tenantagents[].namestringrequiredagents[].rolestringrequiredStored as given at creation (defaultagent)agents[].is_onlineintegerrequired1 or 0agents[].max_chatsinteger | nullrequiredConcurrent chat capagents[].active_chatsinteger | nullrequiredChats currently assigned and unresolvedagents[].created_atintegerrequiredUnix time in millisecondsagents[].phonestring | nullrequiredLogin number, digits with country codeagents[].has_access_codebooleanrequiredWhether an access code is set. The code and its hash are never returned
- 401Missing, invalid or expired credentials
curl "https://api.chatkomodo.com/v1/cs/agents" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/cs/agents', {
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/cs/agents",
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/cs/agents', [
'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/cs/agents", 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))
}{
"agents": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"api_key_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"name": "Sam Carter",
"role": "agent",
"is_online": 1,
"max_chats": 1,
"active_chats": 1,
"created_at": 1767225600000,
"phone": "+447700900123",
"has_access_code": true
}
]
}Create a customer-service agent
/v1/cs/agentsDashboard loginAdds an agent who can sign in to the dashboard and work the shared inbox. An agent signs in with a WhatsApp number plus one-time code (phone), or with an access_code. The phone number must not already belong to another agent or to a tenant owner login. A sign-in (phone or access_code) can only be set from the signed-in dashboard: with an API key the request is refused (AGENT_LOGIN_REQUIRES_LOGIN), so a leaked key cannot create logins.
Request body
namestringrequiredDisplay name; must contain a non-blank valuerolestringStored as given (defaultagent)max_chatsintegerConcurrent chat cap (default 10)access_codestringOptional login code, 10 to 128 characters. Stored only as a salted hash and never returnedphonestringWhatsApp number used for one-time-code login; international format, or local format resolved against the business country
Responses
- 201Created
Response fields
idstringrequiredphonestring | nullrequiredNormalised login number (digits), or null when none was given
- 400
nameis missing or blank, oraccess_codeis not 10 to 128 characters (VALIDATION_FAILED) - 401Missing, invalid or expired credentials
- 403
phoneoraccess_codesent with an API key (AGENT_LOGIN_REQUIRES_LOGIN) - 409The number is already used by another account (
PHONE_IN_USE)
curl -X POST "https://api.chatkomodo.com/v1/cs/agents" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sam Carter",
"phone": "+447700900123",
"max_chats": 10
}'const res = await fetch('https://api.chatkomodo.com/v1/cs/agents', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Sam Carter",
"phone": "+447700900123",
"max_chats": 10
}),
});
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/cs/agents",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"name": "Sam Carter",
"phone": "+447700900123",
"max_chats": 10,
},
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/cs/agents', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'name' => 'Sam Carter',
'phone' => '+447700900123',
'max_chats' => 10,
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"name": "Sam Carter",
"phone": "+447700900123",
"max_chats": 10
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/cs/agents", 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",
"phone": "+447700900123"
}Edit a customer-service agent
/v1/cs/agents/{id}Changes the name, online flag, chat cap and/or access code of one of the tenant's agents. Send only the fields to change. The phone number cannot be changed here, and a new access code can only be set from the signed-in dashboard (AGENT_LOGIN_REQUIRES_LOGIN with an API key); a new access code signs the agent out everywhere.
Path parameters
idstringrequiredAgent id
Request body
namestringis_onlinebooleanmax_chatsintegerConcurrent chat capaccess_codestringNew login code, 10 to 128 characters (ignored when empty). Stored only as a salted hash
Responses
- 200Updated
Response fields
okbooleanrequired
- 400A field has the wrong type or length (
VALIDATION_FAILED) - 401Missing, invalid or expired credentials
- 403
access_codesent with an API key (AGENT_LOGIN_REQUIRES_LOGIN) - 404No agent with this id in the tenant (
NOT_FOUND)
curl -X PATCH "https://api.chatkomodo.com/v1/cs/agents/ID" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sam Carter",
"is_online": true,
"max_chats": 1,
"access_code": "482913"
}'const res = await fetch('https://api.chatkomodo.com/v1/cs/agents/ID', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Sam Carter",
"is_online": true,
"max_chats": 1,
"access_code": "482913"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);import os
import requests
res = requests.patch(
"https://api.chatkomodo.com/v1/cs/agents/ID",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"name": "Sam Carter",
"is_online": True,
"max_chats": 1,
"access_code": "482913",
},
timeout=30,
)
res.raise_for_status()
print(res.json())<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$res = $client->request('PATCH', 'https://api.chatkomodo.com/v1/cs/agents/ID', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'name' => 'Sam Carter',
'is_online' => true,
'max_chats' => 1,
'access_code' => '482913',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"name": "Sam Carter",
"is_online": true,
"max_chats": 1,
"access_code": "482913"
}`)
req, err := http.NewRequest("PATCH", "https://api.chatkomodo.com/v1/cs/agents/ID", 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
}Delete a customer-service agent
/v1/cs/agents/{id}Deletes the agent. Chats assigned to them become unassigned.
Path parameters
idstringrequiredAgent id
Responses
- 200Deleted
Response fields
okbooleanrequired
- 401Missing, invalid or expired credentials
- 403Forbidden for a customer-service agent login (
Agent access is not allowed for this operation) and an API key restricted to specific sessions (KEY_SCOPE_FORBIDDEN) - 404Agent not found (no
code)
curl -X DELETE "https://api.chatkomodo.com/v1/cs/agents/ID" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/cs/agents/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/cs/agents/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/cs/agents/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/cs/agents/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
}Sign an agent out everywhere
/v1/cs/agents/{id}/revoke-sessionsSigns the agent out on every device: access tokens already issued stop working at once and refresh tokens are deleted. Setting a new access_code (PATCH) does the same. Recorded in the audit log as agent.revoke_sessions.
Path parameters
idstringrequiredAgent id
Responses
- 200Revoked
Response fields
okbooleanrequiredrevokedintegerrequiredNumber of sign-ins ended
- 401Missing, invalid or expired credentials
- 403Forbidden for a customer-service agent login (
Agent access is not allowed for this operation) and an API key restricted to specific sessions (KEY_SCOPE_FORBIDDEN) - 404Agent not found (no
code)
curl -X POST "https://api.chatkomodo.com/v1/cs/agents/ID/revoke-sessions" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/cs/agents/ID/revoke-sessions', {
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/cs/agents/ID/revoke-sessions",
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/cs/agents/ID/revoke-sessions', [
'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/cs/agents/ID/revoke-sessions", 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,
"revoked": 1
}List unassigned open chats
/v1/cs/queueOpen chats on the tenant's devices that no agent is assigned to yet, most recent activity first, at most 200. Available to agents as well as the owner.
Responses
- 200Queue
Response fields
queuearray of objectrequiredqueue[].idstringrequiredqueue[].session_idstringrequiredqueue[].chat_idstringrequiredqueue[].chat_namestring | nullrequiredqueue[].last_messagestring | nullrequiredqueue[].last_message_atinteger | nullrequiredqueue[].unread_countinteger | nullrequiredqueue[].is_groupinteger | nullrequired1 = group chatqueue[].agent_idany | nullrequiredAlways null in the queuequeue[].statusstringrequiredopen
- 401Missing, invalid or expired credentials
curl "https://api.chatkomodo.com/v1/cs/queue" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/cs/queue', {
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/cs/queue",
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/cs/queue', [
'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/cs/queue", 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))
}{
"queue": [
{
"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": null,
"status": "active"
}
]
}Alert setting for unanswered chats
/v1/cs/reply-alertA customer waits from their first unanswered message in a 1:1 chat until the team answers: from the dashboard, the API or the phone itself. When the wait reaches minutes, the assigned agent's devices (the owner's for a chat nobody has) get a notification and the chat.unanswered webhook fires; with reassign_minutes, an assigned chat then moves to the next agent in turn.
Responses
- 200Setting
Response fields
enabledbooleanrequiredminutesintegerrequiredAlert after this many minutes without an answer (1–1440, default 15)reassign_minutesinteger | nullrequiredMove an assigned chat to the next agent in turn after this many minutes (more thanminutes, at most 2880); null = neverbusiness_hours_onlybooleanrequiredOnly alert and move chats during business hours (when business hours are on)bots_answerbooleanrequiredAutomatic replies (welcome, auto-reply, flows, AI) count as an answer
- 401Missing, invalid or expired credentials
curl "https://api.chatkomodo.com/v1/cs/reply-alert" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/cs/reply-alert', {
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/cs/reply-alert",
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/cs/reply-alert', [
'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/cs/reply-alert", 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))
}{
"enabled": true,
"minutes": 1,
"reassign_minutes": 1,
"business_hours_only": true,
"bots_answer": true
}Set the alert for unanswered chats
/v1/cs/reply-alertFields left out take their default. Recorded in the audit log as settings.reply_alert.
Request body
enabledbooleanrequiredminutesintegerAlert after this many minutes without an answer (1–1440, default 15)reassign_minutesinteger | nullMove an assigned chat to the next agent in turn after this many minutes (more thanminutes, at most 2880); null = neverbusiness_hours_onlybooleanOnly alert and move chats during business hours (when business hours are on)bots_answerbooleanAutomatic replies (welcome, auto-reply, flows, AI) count as an answer
Responses
- 200Saved
Response fields
enabledbooleanrequiredminutesintegerrequiredAlert after this many minutes without an answer (1–1440, default 15)reassign_minutesinteger | nullrequiredMove an assigned chat to the next agent in turn after this many minutes (more thanminutes, at most 2880); null = neverbusiness_hours_onlybooleanrequiredOnly alert and move chats during business hours (when business hours are on)bots_answerbooleanrequiredAutomatic replies (welcome, auto-reply, flows, AI) count as an answer
- 400Body is not valid JSON (
INVALID_JSON) or fails validation (VALIDATION_FAILED) - 401Missing, invalid or expired credentials
- 403Forbidden for a customer-service agent login (
Agent access is not allowed for this operation)
curl -X PUT "https://api.chatkomodo.com/v1/cs/reply-alert" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"minutes": 1,
"reassign_minutes": 1
}'const res = await fetch('https://api.chatkomodo.com/v1/cs/reply-alert', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"enabled": true,
"minutes": 1,
"reassign_minutes": 1
}),
});
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/cs/reply-alert",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"enabled": True,
"minutes": 1,
"reassign_minutes": 1,
},
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/cs/reply-alert', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'enabled' => true,
'minutes' => 1,
'reassign_minutes' => 1,
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"enabled": true,
"minutes": 1,
"reassign_minutes": 1
}`)
req, err := http.NewRequest("PUT", "https://api.chatkomodo.com/v1/cs/reply-alert", 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))
}{
"enabled": true,
"minutes": 1,
"reassign_minutes": 1,
"business_hours_only": true,
"bots_answer": true
}Support team performance
/v1/cs/reportFor the last days (7, 30 or 90): answers and how long customers waited for them (average, median, share within the alert time), chats assigned and resolved, alerts and chats moved away, and satisfaction (CSAT, by the agent the chat is assigned to), per agent; the row with id: null is the owner and API. waiting_now counts customers waiting right now.
Query parameters
daysstring
Responses
- 200Report
Response fields
daysintegerrequiredsinceintegerrequiredUnix time in millisecondstarget_minutesintegerrequiredalerts_enabledbooleanrequiredtotalsobjectrequiredtotals.repliesintegerrequiredtotals.avg_reply_msinteger | nullrequiredtotals.median_reply_msinteger | nullrequiredtotals.within_targetnumber | nullrequiredtotals.waiting_nowintegerrequiredtotals.oldest_waiting_sinceinteger | nullrequiredUnix time in milliseconds, or nulltotals.alertsintegerrequiredtotals.movedintegerrequiredtotals.csatnumber | nullrequiredagentsarray of objectrequiredagents[].idstring | nullrequiredagents[].namestring | nullrequiredagents[].onlinebooleanrequiredagents[].open_chatsintegerrequiredagents[].assignedintegerrequiredagents[].resolvedintegerrequiredagents[].repliesintegerrequiredagents[].avg_reply_msinteger | nullrequiredagents[].median_reply_msinteger | nullrequiredagents[].within_targetnumber | nullrequiredagents[].alertsintegerrequiredagents[].moved_awayintegerrequiredagents[].csatnumber | nullrequiredagents[].csat_countintegerrequired
- 401Missing, invalid or expired credentials
- 403Forbidden for a customer-service agent login (
Agent access is not allowed for this operation)
curl "https://api.chatkomodo.com/v1/cs/report" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/cs/report', {
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/cs/report",
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/cs/report', [
'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/cs/report", 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))
}{
"days": 1,
"since": 1767225600000,
"target_minutes": 1,
"alerts_enabled": true,
"totals": {
"replies": 1,
"avg_reply_ms": 1767225600000,
"median_reply_ms": 1767225600000,
"within_target": 0.5,
"waiting_now": 1,
"oldest_waiting_since": 1767225600000,
"alerts": 1,
"moved": 1,
"csat": 0.5
},
"agents": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"name": "Example",
"online": true,
"open_chats": 1,
"assigned": 1,
"resolved": 1,
"replies": 1,
"avg_reply_ms": 1767225600000,
"median_reply_ms": 1767225600000,
"within_target": 0.5,
"alerts": 1,
"moved_away": 1,
"csat": 0.5,
"csat_count": 12
}
]
}Assign a chat to an agent
/v1/cs/assignAssigns a chat to one of the tenant's agents (replacing any earlier assignment) and updates the agent's active-chat count. Available to agents as well as the owner. The body is not validated beyond ownership of agent_id and session_id.
Request body
chat_idstringrequiredChat JIDsession_idstringrequiredDevice the chat belongs toagent_idstringrequiredAgent to assign
Responses
- 200Assigned
Response fields
okbooleanrequired
- 401Missing, invalid or expired credentials
- 403The agent or the device is not the tenant's (message
Forbidden, nocode)
curl -X POST "https://api.chatkomodo.com/v1/cs/assign" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X"
}'const res = await fetch('https://api.chatkomodo.com/v1/cs/assign', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X"
}),
});
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/cs/assign",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
},
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/cs/assign', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'session_id' => 'YOUR_DEVICE_ID',
'chat_id' => '447700900123@s.whatsapp.net',
'agent_id' => '01JA5V6Q8M2H7G4K9P3T0R1S2X',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net",
"agent_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X"
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/cs/assign", 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
}Mark a chat as resolved
/v1/cs/resolveMarks a chat resolved, which removes it from the open queue, and frees one slot of the assigned agent. Available to agents as well as the owner.
Request body
chat_idstringrequiredChat JIDsession_idstringrequiredDevice the chat belongs to
Responses
- 200Resolved
Response fields
okbooleanrequired
- 401Missing, invalid or expired credentials
- 403The device is not the tenant's (message
Forbidden, nocode)
curl -X POST "https://api.chatkomodo.com/v1/cs/resolve" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net"
}'const res = await fetch('https://api.chatkomodo.com/v1/cs/resolve', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net"
}),
});
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/cs/resolve",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net",
},
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/cs/resolve', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'session_id' => 'YOUR_DEVICE_ID',
'chat_id' => '447700900123@s.whatsapp.net',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"session_id": "YOUR_DEVICE_ID",
"chat_id": "447700900123@s.whatsapp.net"
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/cs/resolve", 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
}