ChatKomodo Docs Home Sign in

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

GET/v1/sessions/{sessionId}/inbox

List 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

  • limitinteger
    Default: 50From 1 to 100
  • offsetinteger | null
    Default: 0
  • qstring
    Search the chat name and last message; 3+ digits also match the number
    Up to 64 characters
  • filterstring
    unread, groups, archived, snoozed, mine (support agents), unassigned, agent:<agentId> or label:<name>. Any filter except archived and snoozed leaves out archived and snoozed chats.

Responses

  • 200Inbox listing
    Response fields
    • inboxarray of objectrequired
    • inbox[].idstringrequired
    • inbox[].session_idstringrequired
    • inbox[].chat_idstringrequired
      Up to 64 characters
    • inbox[].chat_namestring | nullrequired
    • inbox[].last_messagestring | nullrequired
    • inbox[].snoozed_untilinteger | null
      Snoozed until this time (epoch ms): POST …/inbox/{chatId}/snooze
    • inbox[].last_message_typestring | null
      Type of the last customer message (text, image, video, audio, document, sticker): a photo or voice note has no text in last_message
    • inbox[].last_message_atintegerrequired
    • inbox[].unread_countintegerrequired
    • inbox[].is_groupintegerrequired
      1 = group chat, 0 = 1-on-1
    • inbox[].agent_idstring | nullrequired
      Assigned CS agent, or null for unassigned
    • inbox[].statusstringrequired
Request
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))
}
Response 200
{
  "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

GET/v1/sessions/{sessionId}/contacts

Distinct 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

  • sessionIdstringrequired
    Session (device) id

Responses

  • 200Chats
    Response fields
    • contactsarray of objectrequired
    • contacts[].chat_idstringrequired
    • contacts[].last_seenintegerrequired
      Time 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
Request
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))
}
Response 200
{
  "contacts": [
    {
      "chat_id": "+447700900123",
      "last_seen": 1
    }
  ]
}

List the messages of a chat

GET/v1/sessions/{sessionId}/inbox/{chatId}/messages

Messages 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Query parameters

  • limitinteger
    Page size; values outside 1-100 are clamped
    Default: 50From 1 to 100
  • beforenumber
    created_at (epoch ms) of the oldest message already loaded; non-numeric values are ignored

Responses

  • 200A page of messages
    Response fields
    • messagesarray of objectrequired
      Oldest first
    • messages[].idstringrequired
      Gateway message id (ULID)
    • messages[].directionstringrequired
      One of: inbound, outbound
    • messages[].chat_idstringrequired
      Chat JID
    • messages[].message_typestringrequired
      text, image, video, document, audio, sticker, location, poll, contact or reaction
    • messages[].bodystring | nullrequired
      Text content, if any
    • messages[].media_r2_keystring | nullrequired
      Key of the stored media file; download it with GET /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 | null
      File name of a document a customer sent
    • messages[].statusstringrequired
      queued, sent, delivered, read, failed, cancelled or deleted
    • messages[].created_atintegerrequired
      Creation time (Unix epoch, milliseconds)
    • messages[].wa_message_idstring | nullrequired
      WhatsApp message id; null until the message was handed to WhatsApp
    • messages[].sent_atinteger | nullrequired
      Time the message was handed to WhatsApp (Unix epoch, milliseconds)
    • messages[].errorstring | nullrequired
      Failure reason of a failed message
    • has_morebooleanrequired
      true when the page is full
    • next_cursorinteger | nullrequired
      created_at of 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
Request
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))
}
Response 200
{
  "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

GET/v1/sessions/{sessionId}/inbox/{chatId}/media

Photos, 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Query parameters

  • limitinteger
    Default 60
    From 1 to 200
  • beforeinteger
    next_before of the previous page

Responses

  • 200Files
    Response fields
    • mediaarray of objectrequired
    • media[].idstringrequired
    • media[].directionstringrequired
    • media[].message_typestringrequired
    • media[].media_r2_keystringrequired
    • media[].media_namestring | nullrequired
    • media[].bodystring | nullrequired
      Caption
    • media[].created_atintegerrequired
      Sent 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
Request
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))
}
Response 200
{
  "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

POST/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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Request body

  • atintegerrequired
    When to send (epoch ms)
  • typestring
    Default text
    One of: text, image, video, document, audio
  • bodystring
    The text (type text)
    Up to 4 096 characters
  • media_r2_keystring
    An uploaded file of this business (other types)
  • captionstring
    Up to 1 024 characters

Responses

  • 201Scheduled
    Response fields
    • idstringrequired
    • statusstringrequired
      One of: pending
    • scheduled_atintegerrequired
  • 400VALIDATION_ERROR
  • 401Missing or invalid credentials
  • 403The API key is restricted to other sessions
  • 404Unknown session, or a session of another tenant
Request
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))
}
Response 201
{
  "id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
  "status": "pending",
  "scheduled_at": 1767225600000
}

Act on several chats

POST/v1/sessions/{sessionId}/inbox/bulk

Up 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

  • sessionIdstringrequired
    Session (device) id

Request body

  • chat_idsarray of stringrequired
    1–200 items
  • actionstringrequired
    One of: read, archive, unarchive, resolve, assign, label, unlabel
  • agent_idstring
    For assign
  • labelstring
    For label and unlabel

Responses

  • 200Done
    Response fields
    • okbooleanrequired
    • actionstringrequired
    • changedintegerrequired
    • skippedintegerrequired
      Ids not in this inbox
    • failedarray of objectrequired
      For example the label limit was reached
    • failed[].chat_idstringrequired
    • failed[].errorstringrequired
  • 400VALIDATION_ERROR
  • 401Missing or invalid credentials
  • 403The API key is restricted to other sessions
  • 404Unknown session, or a session of another tenant
Request
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))
}
Response 200
{
  "ok": true,
  "action": "string",
  "changed": 1,
  "skipped": 1,
  "failed": [
    {
      "chat_id": "+447700900123",
      "error": "string"
    }
  ]
}

Snooze a chat

POST/v1/sessions/{sessionId}/inbox/{chatId}/snooze

Hides 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Request body

  • untilinteger | nullrequired
    Epoch milliseconds, at least 30 seconds ahead; null to wake the chat

Responses

  • 200Snoozed (or woken)
    Response fields
    • okbooleanrequired
    • snoozed_untilinteger | nullrequired
  • 400VALIDATION_ERROR: missing, past or too far until
  • 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
Request
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))
}
Response 200
{
  "ok": true,
  "snoozed_until": 1767225600000
}

Export a conversation

GET/v1/sessions/{sessionId}/inbox/{chatId}/transcript

Every 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Query parameters

  • formatstring
    Default json
    One of: json, txt
  • notesstring
    1 includes internal notes
    One of: 0, 1

Responses

  • 200The conversation (JSON; text/plain attachment with format=txt)
    Response fields
    • chat_idstringrequired
    • chat_namestring | nullrequired
    • phonestring | nullrequired
    • business_namestring | nullrequired
    • timezonestringrequired
      IANA timezone of the business
    • generated_atintegerrequired
      Export time (Unix epoch, milliseconds)
    • countintegerrequired
    • truncatedbooleanrequired
      true when the chat has more than 20,000 messages (the oldest are left out)
    • entriesarray of objectrequired
    • entries[].kindstringrequired
      One of: message, note
    • entries[].atintegerrequired
      Time (Unix epoch, milliseconds)
    • entries[].directionstring | nullrequired
      inbound or outbound; null for notes
    • entries[].typestringrequired
      Message type (text, image, document…) or note
    • entries[].bodystring | nullrequired
    • entries[].namestring | nullrequired
      Document file name, or the author of a note
    • entries[].statusstring | nullrequired
  • 401Missing or invalid credentials
  • 403The API key is restricted to other sessions
  • 404Unknown session, or a session of another tenant
Request
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))
}
Response 200
{
  "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

POST/v1/sessions/{sessionId}/inbox/{chatId}/close

Marks 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Responses

  • 200Closed
    Response fields
    • okbooleanrequired
    • statusstringrequired
      One of: closed
    • csat_sentbooleanrequired
      true when 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
Request
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))
}
Response 200
{
  "ok": true,
  "status": "closed",
  "csat_sent": true
}

Reopen a chat

POST/v1/sessions/{sessionId}/inbox/{chatId}/reopen

Opens 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Responses

  • 200Open
    Response fields
    • okbooleanrequired
    • statusstringrequired
      One of: open
    • reopenedbooleanrequired
      false when 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
Request
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))
}
Response 200
{
  "ok": true,
  "status": "open",
  "reopened": true
}

Reset the unread counter

POST/v1/sessions/{sessionId}/inbox/{chatId}/read

Sets 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@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
Request
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))
}
Response 200
{
  "ok": true
}

List the internal notes of a chat

GET/v1/sessions/{sessionId}/inbox/{chatId}/notes

Notes the team wrote in this chat, oldest first (max 500). Notes are never sent to the customer.

Path parameters

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Responses

  • 200Notes
    Response fields
    • notesarray of objectrequired
    • notes[].idstringrequired
    • notes[].chat_idstringrequired
    • notes[].authorobjectrequired
    • notes[].author.typestringrequired
      One of: owner, agent, api
    • notes[].author.idstring | nullrequired
      Agent id (or API key id)
    • notes[].author.namestring | nullrequired
    • notes[].bodystringrequired
    • notes[].mentionsarray of stringrequired
      Mentioned agent ids, and owner
    • notes[].created_atintegerrequired
      When 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
Request
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))
}
Response 200
{
  "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

POST/v1/sessions/{sessionId}/inbox/{chatId}/notes

Adds 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Request body

  • bodystring
    1–2 000 characters
  • textstring
    Older name of body

Responses

  • 201Written
    Response fields
    • okbooleanrequired
    • noteobjectrequired
    • note.idstringrequired
    • note.chat_idstringrequired
    • note.authorobjectrequired
    • note.author.typestringrequired
      One of: owner, agent, api
    • note.author.idstring | nullrequired
      Agent id (or API key id)
    • note.author.namestring | nullrequired
    • note.bodystringrequired
    • note.mentionsarray of stringrequired
      Mentioned agent ids, and owner
    • note.created_atintegerrequired
      When the note was written (Unix epoch, milliseconds)
    • notesarray of stringrequired
      All 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
Request
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))
}
Response 201
{
  "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

DEL/v1/sessions/{sessionId}/inbox/{chatId}/notes/{noteId}

The author, or the business owner, deletes a note. Recorded as chat.note_delete.

Path parameters

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied
  • noteIdstringrequired

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
Request
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))
}
Response 200
{
  "ok": true
}

Get labels, notes, pin and archive state

GET/v1/sessions/{sessionId}/inbox/{chatId}/metadata

Returns 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Responses

  • 200Chat metadata
    Response fields
    • tagsarray of objectrequired
      Tags attached to the chat
    • tags[].namestringrequired
    • tags[].colorstringrequired
    • notesarray of stringrequired
      Internal notes, newest first
    • pinnedbooleanrequired
    • archivedbooleanrequired
  • 401Missing or invalid credentials
  • 403The API key is restricted to other sessions
  • 404Unknown session, or a session of another tenant
Request
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))
}
Response 200
{
  "tags": [
    {
      "name": "Example",
      "color": "#0a7350"
    }
  ],
  "notes": [
    "Prefers delivery after 5 pm"
  ],
  "pinned": true,
  "archived": true
}

Replace labels, notes, pin and archive state

PUT/v1/sessions/{sessionId}/inbox/{chatId}/metadata

Replaces 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Request body

  • tagsarray of object
  • tags[].namestringrequired
  • tags[].colorstringrequired
  • notesarray of string
  • pinnedboolean
    Any truthy value pins
  • archivedboolean
    Any 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
Request
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))
}
Response 200
{
  "ok": true
}

Add a label to a chat (older form)

POST/v1/sessions/{sessionId}/inbox/{chatId}/tags

Adds 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Request body

  • namestringrequired
    Label name
  • colorstring
    #RRGGBB, for a new label

Responses

  • 200Label added
    Response fields
    • okbooleanrequired
    • tagsarray of objectrequired
      All tags of the chat
    • tags[].namestringrequired
    • tags[].colorstringrequired
  • 401Missing or invalid credentials
  • 403The API key is restricted to other sessions
  • 404Unknown session, or a session of another tenant
Request
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))
}
Response 200
{
  "ok": true,
  "tags": [
    {
      "name": "vip",
      "color": "#0a7350"
    }
  ]
}

Toggle the pin of a chat

POST/v1/sessions/{sessionId}/inbox/{chatId}/pin

Flips 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@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
Request
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))
}
Response 200
{
  "ok": true
}

Toggle the archive flag of a chat

POST/v1/sessions/{sessionId}/inbox/{chatId}/archive

Flips the archived flag of the chat. The response does not return the new state; read it from the metadata.

Path parameters

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@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
Request
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))
}
Response 200
{
  "ok": true
}

Set local message expiry for a chat

POST/v1/sessions/{sessionId}/inbox/{chatId}/disappearing

Stores 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

  • sessionIdstringrequired
    Session (device) id
  • chatIdstringrequired
    Chat id (JID) exactly as stored in the inbox, e.g. 447700900123@s.whatsapp.net or …@g.us. URL-decoded by the server; no phone-number normalisation is applied

Request body

  • duration_msinteger | nullrequired
    Keep messages this long, in milliseconds: 3600000 (1 hour) to 31536000000 (365 days); null or 0 disables

Responses

  • 200Saved
    Response fields
    • okbooleanrequired
    • duration_msinteger | nullrequired
      The stored value; null when off
  • 400duration_ms is 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
Request
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))
}
Response 200
{
  "ok": true,
  "duration_ms": 604800000
}

List chats across all devices

GET/v1/inbox

Chats 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

  • limitinteger
    Values outside 1-1 000 are clamped
    Default: 100From 1 to 1 000
  • offsetinteger | null
    Default: 0From 0 to 1 000 000

Responses

  • 200Chats
    Response fields
    • inboxarray of objectrequired
    • inbox[].idstringrequired
    • inbox[].session_idstringrequired
    • inbox[].chat_idstringrequired
    • inbox[].chat_namestring | nullrequired
    • inbox[].last_messagestring | nullrequired
    • inbox[].last_message_atinteger | nullrequired
    • inbox[].unread_countinteger | nullrequired
    • inbox[].is_groupinteger | nullrequired
      1 = group chat, 0 = 1-on-1
    • inbox[].agent_idstring | nullrequired
      Assigned agent, or null
    • inbox[].statusstring | nullrequired
      open or resolved
  • 401Missing, invalid or expired credentials
Request
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))
}
Response 200
{
  "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"
    }
  ]
}