ChatKomodo Docs Home Sign in

API reference · WhatsApp features

WhatsApp Business

Update the business profile

PUT/v1/sessions/{sessionId}/business/profile

Not available yet: the WhatsApp library version in use (Baileys 6.7.23) has no updateBussinesProfile method, so this answers 501 NOT_SUPPORTED. The handler would pass the JSON body to the library unchanged and does not validate it.

Path parameters

  • sessionIdstringrequired
    Session (device) id

Request body

Any JSON object. Business profile fields, passed unchanged to the WhatsApp library

Responses

  • 200Updated
    Response fields
    • okbooleanrequired
  • 400The body is not valid JSON
  • 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
  • 409The session is not connected
  • 500WhatsApp operation failed: WhatsApp or the library rejected the call. The gateway does not validate this body, so missing or malformed fields end up here too
  • 501NOT_SUPPORTED: the WhatsApp library version in use (Baileys 6.7.x) has no such operation, so the call is not available yet
Request
curl -X PUT "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/profile" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/profile', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
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/business/profile",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={},
    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/business/profile', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [],
]);

print_r(json_decode((string) $res->getBody(), true));
Response 200
{
  "ok": true
}

List catalog products

GET/v1/sessions/{sessionId}/business/catalog

Fetches up to 100 products of a business catalog from WhatsApp. There is no paging parameter, so nextPageCursor cannot be followed.

Path parameters

  • sessionIdstringrequired
    Session (device) id

Query parameters

  • jidstring
    Business whose catalog to read; defaults to the account of the session

Responses

  • 200Catalog
    Response fields
    • productsarray of objectrequired
    • products[].idstringrequired
    • products[].namestringrequired
    • products[].descriptionstring
    • products[].pricenumber
    • products[].currencystring
    • products[].retailerIdstring
    • products[].urlstring
    • products[].isHiddenboolean
    • products[].imageUrlsobject
    • products[].availabilitystring
    • products[].reviewStatusobject
    • nextPageCursorstring
  • 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
  • 500WhatsApp operation failed: WhatsApp or the library rejected the call. The gateway does not validate this body, so missing or malformed fields end up here too
Request
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog', {
  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/business/catalog",
    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/business/catalog', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
Response 200
{
  "products": [
    {
      "id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
      "name": "Iced coffee 250 ml",
      "description": "Short description",
      "price": 150000,
      "currency": "IDR",
      "retailerId": "SKU-1042",
      "url": "https://example.com/file.jpg",
      "isHidden": true,
      "imageUrls": {},
      "availability": "string",
      "reviewStatus": {}
    }
  ],
  "nextPageCursor": "string"
}

Create a catalog product

POST/v1/sessions/{sessionId}/business/catalog/products

Creates a product in the catalog of the account. Each image is downloaded by the gateway through the outbound-URL guard (http/https only, max 5 MB, no private or local addresses) and uploaded as bytes; anything else in images is a 400. The remaining fields are passed unchanged to the WhatsApp library and not validated by the gateway; they follow the library's product type.

Path parameters

  • sessionIdstringrequired
    Session (device) id

Request body

  • namestringrequired
    Product name
  • descriptionstringrequired
    Product description
  • pricenumberrequired
    Price as the WhatsApp library expects it
  • currencystringrequired
    Currency code
  • imagesarray of objectrequired
    Product images, each given as { "url": "https://…" } (at most 10)
    Up to 10 items
  • images[].urlstringrequired
    Public http(s) URL of the image (max 5 MB). The gateway downloads it itself; private and local addresses are refused
  • retailerIdstring
    Your own product id
  • urlstring
    Link to the product page
  • isHiddenboolean
  • originCountryCodestring
    ISO country code of origin

Responses

  • 200Product created
    Response fields
    • idstringrequired
    • namestringrequired
    • descriptionstring
    • pricenumber
    • currencystring
    • retailerIdstring
    • urlstring
    • isHiddenboolean
    • imageUrlsobject
    • availabilitystring
    • reviewStatusobject
  • 400The body is not valid JSON, or image_url is missing, is not an http(s) URL, answers with an HTTP error, is larger than 5 MB, or points at a private/local address (error starts with image_url)
  • 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
  • 409The session is not connected
  • 500WhatsApp operation failed: WhatsApp or the library rejected the call. The gateway does not validate this body, so missing or malformed fields end up here too
Request
curl -X POST "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Iced coffee 250 ml",
  "description": "Short description",
  "price": 150000,
  "currency": "IDR",
  "images": [
    {
      "url": "https://example.com/file.jpg"
    }
  ],
  "retailerId": "SKU-1042",
  "url": "https://example.com/file.jpg"
}'
const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Iced coffee 250 ml",
    "description": "Short description",
    "price": 150000,
    "currency": "IDR",
    "images": [
      {
        "url": "https://example.com/file.jpg"
      }
    ],
    "retailerId": "SKU-1042",
    "url": "https://example.com/file.jpg"
  }),
});
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/business/catalog/products",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "name": "Iced coffee 250 ml",
        "description": "Short description",
        "price": 150000,
        "currency": "IDR",
        "images": [
            {
                "url": "https://example.com/file.jpg",
            },
        ],
        "retailerId": "SKU-1042",
        "url": "https://example.com/file.jpg",
    },
    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/business/catalog/products', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'name' => 'Iced coffee 250 ml',
        'description' => 'Short description',
        'price' => 150000,
        'currency' => 'IDR',
        'images' => [
            [
                'url' => 'https://example.com/file.jpg',
            ],
        ],
        'retailerId' => 'SKU-1042',
        'url' => 'https://example.com/file.jpg',
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
Response 200
{
  "id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
  "name": "Iced coffee 250 ml",
  "description": "Short description",
  "price": 150000,
  "currency": "IDR",
  "retailerId": "SKU-1042",
  "url": "https://example.com/file.jpg",
  "isHidden": true,
  "imageUrls": {},
  "availability": "string",
  "reviewStatus": {}
}

Delete catalog products

DEL/v1/sessions/{sessionId}/business/catalog/products

Deletes products from the catalog; the ids travel in the JSON body of this DELETE request.

Path parameters

  • sessionIdstringrequired
    Session (device) id

Request body

  • product_idsarray of stringrequired
    Product ids

Responses

  • 200Result
    Response fields
    • deletedintegerrequired
      Products deleted
  • 400The body is not valid JSON
  • 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
  • 409The session is not connected
  • 500WhatsApp operation failed: WhatsApp or the library rejected the call. The gateway does not validate this body, so missing or malformed fields end up here too
Request
curl -X DELETE "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "product_ids": [
    "01JA5V6Q8M2H7G4K9P3T0R1S2X"
  ]
}'
const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "product_ids": [
      "01JA5V6Q8M2H7G4K9P3T0R1S2X"
    ]
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.delete(
    "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "product_ids": [
            "01JA5V6Q8M2H7G4K9P3T0R1S2X",
        ],
    },
    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/business/catalog/products', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'product_ids' => [
            '01JA5V6Q8M2H7G4K9P3T0R1S2X',
        ],
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
Response 200
{
  "deleted": 1
}

Update a catalog product

PUT/v1/sessions/{sessionId}/business/catalog/products/{pid}

Updates a catalog product. Images are handled as in POST …/business/catalog/products (downloaded by the gateway, never fetched from a URL by the library). The remaining fields are passed unchanged to the WhatsApp library and not validated by the gateway.

Path parameters

  • sessionIdstringrequired
    Session (device) id
  • pidstringrequired
    Product id

Request body

  • namestringrequired
    Product name
  • descriptionstringrequired
    Product description
  • pricenumberrequired
    Price as the WhatsApp library expects it
  • currencystringrequired
    Currency code
  • imagesarray of objectrequired
    Product images, each given as { "url": "https://…" } (at most 10)
    Up to 10 items
  • images[].urlstringrequired
    Public http(s) URL of the image (max 5 MB). The gateway downloads it itself; private and local addresses are refused
  • retailerIdstring
    Your own product id
  • urlstring
    Link to the product page
  • isHiddenboolean

Responses

  • 200Product updated
    Response fields
    • idstringrequired
    • namestringrequired
    • descriptionstring
    • pricenumber
    • currencystring
    • retailerIdstring
    • urlstring
    • isHiddenboolean
    • imageUrlsobject
    • availabilitystring
    • reviewStatusobject
  • 400The body is not valid JSON, or image_url is missing, is not an http(s) URL, answers with an HTTP error, is larger than 5 MB, or points at a private/local address (error starts with image_url)
  • 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
  • 409The session is not connected
  • 500WhatsApp operation failed: WhatsApp or the library rejected the call. The gateway does not validate this body, so missing or malformed fields end up here too
Request
curl -X PUT "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products/7012345678901234" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Iced coffee 250 ml",
  "description": "Short description",
  "price": 150000,
  "currency": "IDR",
  "images": [
    {
      "url": "https://example.com/file.jpg"
    }
  ],
  "retailerId": "SKU-1042",
  "url": "https://example.com/file.jpg"
}'
const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products/7012345678901234', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Iced coffee 250 ml",
    "description": "Short description",
    "price": 150000,
    "currency": "IDR",
    "images": [
      {
        "url": "https://example.com/file.jpg"
      }
    ],
    "retailerId": "SKU-1042",
    "url": "https://example.com/file.jpg"
  }),
});
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/business/catalog/products/7012345678901234",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "name": "Iced coffee 250 ml",
        "description": "Short description",
        "price": 150000,
        "currency": "IDR",
        "images": [
            {
                "url": "https://example.com/file.jpg",
            },
        ],
        "retailerId": "SKU-1042",
        "url": "https://example.com/file.jpg",
    },
    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/business/catalog/products/7012345678901234', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'name' => 'Iced coffee 250 ml',
        'description' => 'Short description',
        'price' => 150000,
        'currency' => 'IDR',
        'images' => [
            [
                'url' => 'https://example.com/file.jpg',
            ],
        ],
        'retailerId' => 'SKU-1042',
        'url' => 'https://example.com/file.jpg',
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
Response 200
{
  "id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
  "name": "Iced coffee 250 ml",
  "description": "Short description",
  "price": 150000,
  "currency": "IDR",
  "retailerId": "SKU-1042",
  "url": "https://example.com/file.jpg",
  "isHidden": true,
  "imageUrls": {},
  "availability": "string",
  "reviewStatus": {}
}

List WhatsApp Business labels

GET/v1/sessions/{sessionId}/labels

Not available yet: the WhatsApp library version in use (Baileys 6.7.23) has no getLabels method, so this answers 501 NOT_SUPPORTED. The handler would return { "labels": [...] }.

Path parameters

  • sessionIdstringrequired
    Session (device) id

Responses

  • 200Labels
    Response fields
    • labelsarray of objectrequired
    • labels[].idstringrequired
    • labels[].namestringrequired
  • 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
  • 500WhatsApp operation failed: WhatsApp or the library rejected the call. The gateway does not validate this body, so missing or malformed fields end up here too
  • 501NOT_SUPPORTED: the WhatsApp library version in use (Baileys 6.7.x) has no such operation, so the call is not available yet
Request
curl "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/labels" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/labels', {
  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/labels",
    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/labels', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
Response 200
{
  "labels": [
    {
      "id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
      "name": "Example"
    }
  ]
}