ChatKomodo Docs Home Sign in

ChatKomodo API

Introduction

Send and receive WhatsApp messages from your own software — order updates, one-time codes, reminders, customer service and campaigns — through the WhatsApp numbers you link to ChatKomodo.

The basics

Base URL
https://api.chatkomodo.com
Format
JSON in and out (UTF-8). File uploads use multipart/form-data.
Authentication
Authorization: Bearer <your API key> on every /v1 request. See Authentication.
Devices
Each linked WhatsApp number is a device; its id (sessionId in the paths) says which number sends.
Errors
{"error": "…", "code": "…"} with a stable code to branch on. See Errors.
Machine-readable spec
OpenAPI 3.1 at api.chatkomodo.com/openapi.json — import it into Postman, Insomnia or a client generator. An interactive console runs at api.chatkomodo.com/docs.

A first call

Send a WhatsApp message from one of your devices:

Request
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/messages" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chat_id": "+447700900123",
  "type": "text",
  "body": "Hi Sam, your order #1042 has shipped 🚚"
}'
const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/messages', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "chat_id": "+447700900123",
    "type": "text",
    "body": "Hi Sam, your order #1042 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/messages",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "chat_id": "+447700900123",
        "type": "text",
        "body": "Hi Sam, your order #1042 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/messages', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'chat_id' => '+447700900123',
        'type' => 'text',
        'body' => 'Hi Sam, your order #1042 has shipped 🚚',
    ],
]);

print_r(json_decode((string) $res->getBody(), true));

The answer is {"id": "01J…", "status": "queued"}: the message is in the device's queue and goes out within seconds (POST /v1/sessions/{sessionId}/messages).

What you can build