. Create an API key under API keys.API reference · Messaging
Devices
A device is one WhatsApp number linked to ChatKomodo (shown as a session in the API: its id is the sessionId in the paths). Create one, scan its QR code from WhatsApp → Linked devices (or use a pairing code), then send through it. GET /v1/sessions lists them with their status.
List devices
/v1/sessionsList all WhatsApp devices for the calling tenant.
Responses
- 200List of sessions
Response fields
sessionsarray of objectrequiredsessions[].idstringrequiredULID identifiersessions[].statusstringrequiredpending(starting),qr_ready(waiting for a scan),connected,disconnected(was working, connection lost) orfailedsessions[].phone_numberstring | nullrequiredPaired WhatsApp number as digits with country code (no+), e.g.447700900123sessions[].wa_namestring | nullrequiredWhatsApp display name, read from the phone when it is linked (no need to type it)sessions[].wa_aboutstring | nullThe number's WhatsApp "About" text (bio), read after linking and refreshed whenever the profile is fetched.""= no About;null= not read yet or hidden by the phone's privacy settingssessions[].phone_displaystring | nullThe number in international format with its country code, e.g.+44 7700 900123sessions[].phone_countrystring | nullISO 3166-1 alpha-2 country of the number, e.g.GB(nullwhen unknown)sessions[].phone_country_codestring | nullCountry calling code with+, e.g.+44sessions[].api_key_idstringrequiredOwning tenantsessions[].warmup_until_msinteger | nullrequiredPacing until this timestamp (anti-ban)sessions[].created_atintegerrequiredsessions[].connected_atinteger | nullrequiredsessions[].sandboxbooleantruefor a test device: WhatsApp is simulated and nothing is sent for real (seePOST /v1/sessionswithsandbox: true)
- 401Unauthorized
curl "https://api.chatkomodo.com/v1/sessions" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions', {
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",
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', [
'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", 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))
}{
"sessions": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"status": "pending",
"phone_number": "+447700900123",
"wa_name": "string",
"wa_about": "string",
"phone_display": "+447700900123",
"phone_country": "+447700900123",
"phone_country_code": "+447700900123",
"api_key_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"warmup_until_ms": 1767225600000,
"created_at": 1767225600000,
"connected_at": 1767225600000,
"sandbox": true
}
]
}Create a device
/v1/sessionsCreate a new WhatsApp device (session). Poll qr_polling_url for the QR code and scan it from WhatsApp, or link with a pairing code (POST /v1/sessions/{id}/pairing-code). Limited by the plan's device quota.
With {"sandbox": true} it creates a test device instead: connected at once, no QR code, nothing ever reaches WhatsApp. Sends go through the normal pipeline (logs, webhooks, statuses move to delivered after about 1 s and read after about 3 s); numbers ending in 0000 always fail; customer messages are simulated with POST /v1/sessions/{id}/sandbox/inbound. One test device per business, outside the device quota, and its messages do not count toward the monthly quota.
Request body
sandboxbooleantruecreates a test device (no QR code, simulated WhatsApp)
Responses
- 201Session created:
pendingwith a QR polling URL, or a connected test deviceResponse fields
idstringrequiredstatusstringrequiredqr_polling_urlstringrequired
- 401Unauthorized
- 403Plan device limit reached
- 409This business already has a test device (
SANDBOX_EXISTS, itsidincluded)
curl -X POST "https://api.chatkomodo.com/v1/sessions" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/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/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/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/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))
}{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"status": "pending",
"qr_polling_url": "https://example.com/file.jpg"
}Simulate a customer message
/v1/sessions/{id}/sandbox/inboundTest devices only: a message "from" a customer arrives on the test device and is handled like a real one. It is logged, fires the message.received webhook, appears in the inbox, and triggers welcome messages, auto-replies, chatbot flows and AI replies (whose answers go back through the test device). Nothing is sent over WhatsApp.
Path parameters
idstringrequired
Request body
fromstringrequiredThe customer's number (international, or local for the business country) or a person's chat id…@s.whatsapp.nettextstringWhat the customer writes (the caption withmedia; required without it)namestringThe customer's WhatsApp name (default "Test customer")mediastringSend a small sample file: a photo, a PDF, a voice note or a video. It is stored like a real customer file (media_r2_keyon the message,media_keyin themessage.mediawebhook)
Responses
- 202Delivered to the test device; webhooks and automations run in the background
Response fields
okbooleanrequiredchat_idstringrequiredwa_message_idstringrequired
- 400
VALIDATION_ERRORorINVALID_PHONE - 404Not found or not owned by tenant
- 409Not a test device (
NOT_A_TEST_DEVICE)
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/sandbox/inbound" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "+447700900123",
"text": "What time do you open on Saturday?",
"name": "Sam Carter"
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/sandbox/inbound', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"from": "+447700900123",
"text": "What time do you open on Saturday?",
"name": "Sam Carter"
}),
});
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/sandbox/inbound",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"from": "+447700900123",
"text": "What time do you open on Saturday?",
"name": "Sam Carter",
},
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/sandbox/inbound', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'from' => '+447700900123',
'text' => 'What time do you open on Saturday?',
'name' => 'Sam Carter',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"from": "+447700900123",
"text": "What time do you open on Saturday?",
"name": "Sam Carter"
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/sandbox/inbound", 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,
"chat_id": "+447700900123",
"wa_message_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X"
}Get a device
/v1/sessions/{id}Get a single session by id.
Path parameters
idstringrequired
Responses
- 200Session detail
Response fields
idstringrequiredULID identifierstatusstringrequiredpending(starting),qr_ready(waiting for a scan),connected,disconnected(was working, connection lost) orfailedphone_numberstring | nullrequiredPaired WhatsApp number as digits with country code (no+), e.g.447700900123wa_namestring | nullrequiredWhatsApp display name, read from the phone when it is linked (no need to type it)wa_aboutstring | nullThe number's WhatsApp "About" text (bio), read after linking and refreshed whenever the profile is fetched.""= no About;null= not read yet or hidden by the phone's privacy settingsphone_displaystring | nullThe number in international format with its country code, e.g.+44 7700 900123phone_countrystring | nullISO 3166-1 alpha-2 country of the number, e.g.GB(nullwhen unknown)phone_country_codestring | nullCountry calling code with+, e.g.+44api_key_idstringrequiredOwning tenantwarmup_until_msinteger | nullrequiredPacing until this timestamp (anti-ban)created_atintegerrequiredconnected_atinteger | nullrequiredsandboxbooleantruefor a test device: WhatsApp is simulated and nothing is sent for real (seePOST /v1/sessionswithsandbox: true)
- 404Not found or not owned by tenant
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID', {
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",
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', [
'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", 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))
}{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"status": "pending",
"phone_number": "+447700900123",
"wa_name": "string",
"wa_about": "string",
"phone_display": "+447700900123",
"phone_country": "+447700900123",
"phone_country_code": "+447700900123",
"api_key_id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"warmup_until_ms": 1767225600000,
"created_at": 1767225600000,
"connected_at": 1767225600000,
"sandbox": true
}Delete a device
/v1/sessions/{id}Closes the live connection, deletes the stored WhatsApp credentials and removes the session together with its auto-reply rules, blast campaigns, blocklist entries and message history. The inbox and scheduled messages are left in place, and WhatsApp is not asked to unlink the device. This cannot be undone.
Path parameters
idstringrequiredSession (device) id
Responses
- 200Deleted
Response fields
okbooleanrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions, or the operation is not available to CS-agent logins
- 404Unknown session, or a session of another tenant
curl -X DELETE "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_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",
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', [
'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", 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
}Number protection status
/v1/sessions/{sessionId}/healthProtection status of the WhatsApp number: age and warm-up, new contacts and messages today against its limits, failures, blocks and opt-outs in the last 7 days. Messages over a limit are not refused: they go out the next day with room (08:00-10:00 WIB). People who wrote to the number first are never counted as new contacts.
Path parameters
sessionIdstringrequired
Responses
- 200Health
Response fields
age_daysintegerrequiredDays since the number first connectedwarming_upbooleanrequiredFirst 14 days: the daily limit for new contacts grows from 20 to 800new_contacts_todayintegerrequirednew_contact_limitintegerrequiredNew contacts this number may message today (warm-up or your own limit, whichever is lower; after warm-up your limit up to 1 000)sent_todayintegerrequireddaily_limitinteger | nullrequiredYour limit for all messages a day, or null (only the platform limit)new_contact_daily_limitinteger | nullrequiredlast_7_daysobjectrequiredlast_7_days.sentintegerrequiredlast_7_days.failedintegerrequiredlast_7_days.blocksintegerrequiredlast_7_days.opt_outsintegerrequiredlast_7_days.complaint_repliesintegerrequiredReplies like "who is this?", "spam" or "stop texting me" to messages of this numberlast_7_days.failure_ratenumberrequiredlast_7_days.complaint_ratenumberrequired(blocks + opt-outs + complaint replies) / sentdelivery_ratenumber | nullrequiredShare of the messages to people (last 7 days, sent over 90 minutes ago) that reached the phone; null with fewer than 20 such messages. Under 0.6 the level is at leastcareful, under 0.35at_riskdelivery_sampleintegerrequiredHow many messages that isreply_ratenumber | nullrequiredShare of people this number messaged first (last 7 days, first message at least 6 hours old) who answered; null with no such contactscold_contacts_7dintegerrequiredHow many people that isquota_factornumberrequiredThe new-contact limit follows the reply rate (needs 30 such contacts): 0.5 under 3 % replies, 0.75 under 8 %, 1.25 from 25 % (only after the first week), else 1; multiplied by the riskspeed_factorrestricted_untilinteger | nullrequiredWhen WhatsApp limited this number (rate limit or restriction), until when it does not message new contacts (24 hours); null otherwise. Replies to people who wrote first still go outtwo_step_pin_confirmed_atinteger | nullrequiredWhen the owner confirmed WhatsApp two-step verification (PIN) is on for this number; null if not confirmedown_test_atinteger | nullrequiredLast time this number sent a message to its own number (for example a broadcast test); null if neverlevelstringrequiredat_riskalso while the number is restrictedriskobjectrequiredRisk estimate for this numberrisk.scorenumberrequiredEstimated probability (0-1) that WhatsApp restricts or bans this number in the next days, from a model that looks at ten signals together (strangers messaged, replies, undelivered messages, failures, complaints, age, today's volume against the number's own habit, identical texts, night sending, a recent restriction)risk.levelstringrequiredlowunder 12 %,mediumunder 35 %,highfrom 35 %risk.reasonsarray of objectrequiredThe biggest contributors, largest firstrisk.reasons[].featurestringrequirednew_share,no_reply,undelivered,failures,complaints,young,burst,repetition,night,restricted_recent,trend(delivery getting worse over days),near_dup(near copies of one text),neighbor(other numbers on the server were limited), or an interaction such asyoung*burstrisk.reasons[].pointsintegerrequiredPercentage points this signal adds to the scorerisk.projected_30dnumberrequiredChance (0-1) of a limit or ban within 30 days if nothing changesrisk.reliabilitystringrequiredprior: not enough outcomes yet, the score rests on general ban patterns.learning: the model learns from outcomes but is not proven.validated: at least 30 positive examples and it predicts them better than chance (AUC >= 0.7)risk.speed_factornumberrequiredMultiplier on the new-contact limit, 0.3-1.3. It grows slowly while the score is low and drops fast when the score is high; it is updated once a dayrisk.learned_fromobjectrequiredHow many restricted/banned and how many safe number-days the model has learned from. With few, the score still rests mostly on general ban patternsrisk.learned_from.bansintegerrequiredrisk.learned_from.safeintegerrequired
- 404Session not found
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/health" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/health', {
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/health",
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/health', [
'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/health", 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))
}{
"age_days": 1,
"warming_up": true,
"new_contacts_today": 1,
"new_contact_limit": 50,
"sent_today": 12,
"daily_limit": 50,
"new_contact_daily_limit": 50,
"last_7_days": {
"sent": 12,
"failed": 1,
"blocks": 1,
"opt_outs": 1,
"complaint_replies": 1,
"failure_rate": 0.5,
"complaint_rate": 0.5
},
"delivery_rate": 0.5,
"delivery_sample": 1,
"reply_rate": 0.5,
"cold_contacts_7d": 1,
"quota_factor": 0.5,
"restricted_until": 1767225600000,
"two_step_pin_confirmed_at": 1767225600000,
"own_test_at": 1767225600000,
"level": "good",
"risk": {
"score": 0.5,
"level": "low",
"reasons": [
{
"feature": "string",
"points": 1
}
],
"projected_30d": 0.5,
"reliability": "prior",
"speed_factor": 0.5,
"learned_from": {
"bans": 1,
"safe": 1
}
}
}Check the WhatsApp profile is complete
/v1/sessions/{sessionId}/profile-checkIs the number's WhatsApp profile filled in? A number with no photo, no name or the default "about" that messages strangers looks like a throwaway number and is banned sooner. description is checked for WhatsApp Business numbers only (null otherwise). Cached 6 hours; ?refresh=1 asks WhatsApp again.
Path parameters
sessionIdstringrequired
Query parameters
refreshstring
Responses
- 200Profile check
Response fields
photobooleanrequirednamebooleanrequiredaboutbooleanrequireddescriptionboolean | nullrequiredchecked_atintegerrequiredcompletebooleanrequiredmissingarray of stringrequired
- 409Device not connected
- 502WhatsApp did not answer
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/profile-check" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/profile-check', {
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/profile-check",
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/profile-check', [
'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/profile-check", 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))
}{
"photo": true,
"name": true,
"about": true,
"description": true,
"checked_at": 1767225600000,
"complete": true,
"missing": [
"photo"
]
}Set the number's daily limits
/v1/sessions/{sessionId}/limitsSet the number's own daily limits, and whether two-step verification (PIN) is on in WhatsApp (two_step_pin; WhatsApp does not tell linked devices, so the owner confirms it). daily_limit (10-1 000) caps every message a day; new_contact_daily_limit (0-1 000) caps first messages to people the number never chatted with: during the 14-day warm-up only lower than the warm-up value counts. null removes a limit. Recorded as session.limits. Not for agents.
Path parameters
sessionIdstringrequired
Request body
daily_limitinteger | nullnew_contact_daily_limitinteger | nulltwo_step_pinbooleanThe owner confirms (true) or withdraws (false) that two-step verification (PIN) is on in WhatsApp for this number
Responses
- 200Saved; the new health
Response fields
age_daysintegerrequiredDays since the number first connectedwarming_upbooleanrequiredFirst 14 days: the daily limit for new contacts grows from 20 to 800new_contacts_todayintegerrequirednew_contact_limitintegerrequiredNew contacts this number may message today (warm-up or your own limit, whichever is lower; after warm-up your limit up to 1 000)sent_todayintegerrequireddaily_limitinteger | nullrequiredYour limit for all messages a day, or null (only the platform limit)new_contact_daily_limitinteger | nullrequiredlast_7_daysobjectrequiredlast_7_days.sentintegerrequiredlast_7_days.failedintegerrequiredlast_7_days.blocksintegerrequiredlast_7_days.opt_outsintegerrequiredlast_7_days.complaint_repliesintegerrequiredReplies like "who is this?", "spam" or "stop texting me" to messages of this numberlast_7_days.failure_ratenumberrequiredlast_7_days.complaint_ratenumberrequired(blocks + opt-outs + complaint replies) / sentdelivery_ratenumber | nullrequiredShare of the messages to people (last 7 days, sent over 90 minutes ago) that reached the phone; null with fewer than 20 such messages. Under 0.6 the level is at leastcareful, under 0.35at_riskdelivery_sampleintegerrequiredHow many messages that isreply_ratenumber | nullrequiredShare of people this number messaged first (last 7 days, first message at least 6 hours old) who answered; null with no such contactscold_contacts_7dintegerrequiredHow many people that isquota_factornumberrequiredThe new-contact limit follows the reply rate (needs 30 such contacts): 0.5 under 3 % replies, 0.75 under 8 %, 1.25 from 25 % (only after the first week), else 1; multiplied by the riskspeed_factorrestricted_untilinteger | nullrequiredWhen WhatsApp limited this number (rate limit or restriction), until when it does not message new contacts (24 hours); null otherwise. Replies to people who wrote first still go outtwo_step_pin_confirmed_atinteger | nullrequiredWhen the owner confirmed WhatsApp two-step verification (PIN) is on for this number; null if not confirmedown_test_atinteger | nullrequiredLast time this number sent a message to its own number (for example a broadcast test); null if neverlevelstringrequiredat_riskalso while the number is restrictedriskobjectrequiredRisk estimate for this numberrisk.scorenumberrequiredEstimated probability (0-1) that WhatsApp restricts or bans this number in the next days, from a model that looks at ten signals together (strangers messaged, replies, undelivered messages, failures, complaints, age, today's volume against the number's own habit, identical texts, night sending, a recent restriction)risk.levelstringrequiredlowunder 12 %,mediumunder 35 %,highfrom 35 %risk.reasonsarray of objectrequiredThe biggest contributors, largest firstrisk.reasons[].featurestringrequirednew_share,no_reply,undelivered,failures,complaints,young,burst,repetition,night,restricted_recent,trend(delivery getting worse over days),near_dup(near copies of one text),neighbor(other numbers on the server were limited), or an interaction such asyoung*burstrisk.reasons[].pointsintegerrequiredPercentage points this signal adds to the scorerisk.projected_30dnumberrequiredChance (0-1) of a limit or ban within 30 days if nothing changesrisk.reliabilitystringrequiredprior: not enough outcomes yet, the score rests on general ban patterns.learning: the model learns from outcomes but is not proven.validated: at least 30 positive examples and it predicts them better than chance (AUC >= 0.7)risk.speed_factornumberrequiredMultiplier on the new-contact limit, 0.3-1.3. It grows slowly while the score is low and drops fast when the score is high; it is updated once a dayrisk.learned_fromobjectrequiredHow many restricted/banned and how many safe number-days the model has learned from. With few, the score still rests mostly on general ban patternsrisk.learned_from.bansintegerrequiredrisk.learned_from.safeintegerrequired
- 400Validation error
curl -X PUT "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/limits" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"daily_limit": 50,
"new_contact_daily_limit": 50,
"two_step_pin": true
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/limits', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"daily_limit": 50,
"new_contact_daily_limit": 50,
"two_step_pin": true
}),
});
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/limits",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"daily_limit": 50,
"new_contact_daily_limit": 50,
"two_step_pin": True,
},
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/limits', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'daily_limit' => 50,
'new_contact_daily_limit' => 50,
'two_step_pin' => true,
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"daily_limit": 50,
"new_contact_daily_limit": 50,
"two_step_pin": true
}`)
req, err := http.NewRequest("PUT", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/limits", 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))
}{
"age_days": 1,
"warming_up": true,
"new_contacts_today": 1,
"new_contact_limit": 50,
"sent_today": 12,
"daily_limit": 50,
"new_contact_daily_limit": 50,
"last_7_days": {
"sent": 12,
"failed": 1,
"blocks": 1,
"opt_outs": 1,
"complaint_replies": 1,
"failure_rate": 0.5,
"complaint_rate": 0.5
},
"delivery_rate": 0.5,
"delivery_sample": 1,
"reply_rate": 0.5,
"cold_contacts_7d": 1,
"quota_factor": 0.5,
"restricted_until": 1767225600000,
"two_step_pin_confirmed_at": 1767225600000,
"own_test_at": 1767225600000,
"level": "good",
"risk": {
"score": 0.5,
"level": "low",
"reasons": [
{
"feature": "string",
"points": 1
}
],
"projected_30d": 0.5,
"reliability": "prior",
"speed_factor": 0.5,
"learned_from": {
"bans": 1,
"safe": 1
}
}
}Get the current QR code
/v1/sessions/{sessionId}/qrReturns the QR payload for linking the device: render the qr string with any QR library and scan it from WhatsApp (Linked devices). A code lasts about 60 seconds; qr is null while none is available, so keep polling until status is qr_ready. Answers 410 once the device is connected.
Path parameters
sessionIdstringrequiredSession (device) id
Responses
- 200Current QR state
Response fields
qrstring | nullrequiredRaw QR payload string (not an image); null when there is no valid code right nowexpires_atinteger | nullrequiredExpiry of the code (Unix epoch, milliseconds)statusstringrequiredSession status:pending,qr_ready,connected,disconnectedorfailed
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
- 410The device is already connected (
error:Already connected)
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/qr" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/qr', {
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/qr",
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/qr', [
'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/qr", 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))
}{
"qr": "string",
"expires_at": 1767225600000,
"status": "active"
}Get the WhatsApp profile of a device
/v1/sessions/{sessionId}/profileReturns the linked account: number, display name, picture, About text and, for Business accounts, the business profile and catalog. A connected device is queried live with a 10-second limit, and parts that do not answer in time come back null or empty (syncing: true marks a timed-out lookup). A device that is not connected returns the cached values with connected: false.
Path parameters
sessionIdstringrequiredSession (device) id
Responses
- 200Profile
Response fields
connectedbooleanrequiredsyncingbooleantruewhen the live lookup timed out and only partial data is returnedphone_numberstring | nullrequiredDigits with country code, no+wa_namestring | nullrequiredprofile_pic_urlstring | nullrequiredaboutstring | nullrequiredThe About / status textis_businessbooleanrequiredbusiness_profileobject | nullrequiredOnly for Business accountsbusiness_profile.descriptionstring | nullrequiredbusiness_profile.categorystring | nullrequiredbusiness_profile.emailstring | nullrequiredbusiness_profile.websitearray of anyrequiredbusiness_profile.addressstring | nullrequiredbusiness_profile.business_hoursarray of objectrequiredbusiness_profile.business_hours[].daystringrequiredbusiness_profile.business_hours[].modestringrequiredbusiness_profile.business_hours[].openstring | nullrequiredHH:MMbusiness_profile.business_hours[].closestring | nullrequiredHH:MMcatalogarray of objectrequiredVisible catalog products (Business accounts only; empty otherwise)catalog[].idstringrequiredcatalog[].namestringrequiredcatalog[].pricenumberrequiredcatalog[].currencystringrequiredcatalog[].descriptionstringrequiredcatalog[].imagestring | nullrequiredcatalog[].urlstring | 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/profile" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/profile', {
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/profile",
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/profile', [
'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/profile", 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))
}{
"connected": true,
"syncing": true,
"phone_number": "+447700900123",
"wa_name": "string",
"profile_pic_url": "https://example.com/file.jpg",
"about": "string",
"is_business": true,
"business_profile": {
"description": "Short description",
"category": "string",
"email": "you@example.com",
"website": [
"string"
],
"address": "string",
"business_hours": [
{
"day": "string",
"mode": "string",
"open": "string",
"close": "string"
}
]
},
"catalog": [
{
"id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
"name": "Example",
"price": 150000,
"currency": "IDR",
"description": "Short description",
"image": "string",
"url": "https://example.com/file.jpg"
}
]
}Request a phone-number pairing code
/v1/sessions/{sessionId}/pairing-codeLinks the device with a code instead of a QR scan: enter the returned code on the phone (WhatsApp, Linked devices, Link with phone number). Needs a session that has a live connection manager, so create it with POST /v1/sessions or call /reconnect first.
Path parameters
sessionIdstringrequiredSession (device) id
Request body
phone_numberstringrequiredNumber of the WhatsApp account to link, with country code. Everything but digits is stripped; local-format numbers are not resolved
Responses
- 200Pairing code
Response fields
codestringrequiredCode to type on the phone
- 400
phone_numberis missing - 401Missing or invalid credentials
- 403The API key is restricted to other sessions, or the operation is not available to CS-agent logins
- 404No live connection manager for this session; unknown session, or a session of another tenant
- 500The library could not create a code;
errorcarries its message
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/pairing-code" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+447700900123"
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/pairing-code', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"phone_number": "+447700900123"
}),
});
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/pairing-code",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"phone_number": "+447700900123",
},
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/pairing-code', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'phone_number' => '+447700900123',
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"phone_number": "+447700900123"
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/pairing-code", 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))
}{
"code": "RECIPIENT_OPTED_OUT"
}Reconnect a device
/v1/sessions/{sessionId}/reconnectRestarts the WhatsApp connection of the session. With clear_creds: true the stored credentials are wiped first and the status goes back to pending, so the device has to be linked again (QR or pairing code); this flag only takes effect when the session already has a live connection manager. Poll GET /v1/sessions/{id} for the resulting status.
Path parameters
sessionIdstringrequiredSession (device) id
Request body
clear_credsbooleanWipe the stored WhatsApp credentials before reconnecting (default false)
Responses
- 200Reconnect started
Response fields
okbooleanrequired
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions, or the operation is not available to CS-agent logins
- 404Unknown session, or a session of another tenant
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/reconnect" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clear_creds": true
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/reconnect', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"clear_creds": true
}),
});
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/reconnect",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"clear_creds": True,
},
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/reconnect', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'clear_creds' => true,
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"clear_creds": true
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/reconnect", 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
}Resync groups and chats
/v1/sessions/{sessionId}/syncRe-fetches the participating groups and the WhatsApp app-state (chats, contacts) and refreshes group names in the inbox; waits up to 15 seconds for the app-state part. contacts counts the one-to-one chats known in the inbox, not an address book.
Path parameters
sessionIdstringrequiredSession (device) id
Responses
- 200Sync finished
Response fields
groupsintegerrequiredGroups the account participates incontactsintegerrequiredDistinct one-to-one chats in the inbox
- 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
- 409The session is not connected (
NOT_CONNECTED) - 502The sync failed (
SYNC_FAILED)
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/sync" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY"const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/sync', {
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/sync",
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/sync', [
'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/sync", 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))
}{
"groups": 1,
"contacts": 1
}Check numbers on WhatsApp
/v1/sessions/{sessionId}/validateChecks which of up to 1 000 numbers or JIDs have a WhatsApp account. Targets are normalised like recipients elsewhere (international format, or local format resolved against the business country or country_code); targets that cannot be normalised are dropped. If the lookup itself fails, every target is reported in not_registered. Limited to 10 calls per minute per key.
Path parameters
sessionIdstringrequiredSession (device) id
Request body
targetsarray of stringrequiredPhone numbers or JIDscountry_codestringCalling code (digits) used for local-format numbers; defaults to the business country
Responses
- 200Result
Response fields
registeredarray of stringrequiredJIDs that have a WhatsApp accountnot_registeredarray of stringrequiredNormalised JIDs that were not found
- 400
targetsis not an array of strings, or has more than 1 000 entries - 401Missing or invalid credentials
- 403The API key is restricted to other sessions
- 404Unknown session, or a session of another tenant
- 409The session is not connected
- 429Strict rate limit exceeded: 10 requests per minute (
RATE_LIMITED)
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/validate" \
-H "Authorization: Bearer $CHATKOMODO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"targets": [
"+447700900123",
"+12025550123"
]
}'const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/validate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"targets": [
"+447700900123",
"+12025550123"
]
}),
});
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/validate",
headers={
"Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
},
json={
"targets": [
"+447700900123",
"+12025550123",
],
},
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/validate', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
],
'json' => [
'targets' => [
'+447700900123',
'+12025550123',
],
],
]);
print_r(json_decode((string) $res->getBody(), true));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"targets": [
"+447700900123",
"+12025550123"
]
}`)
req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/validate", 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))
}{
"registered": [
"string"
],
"not_registered": [
"string"
]
}