ChatKomodo Docs Home Sign in

API reference · WhatsApp features

WhatsApp Business

Update the business profile

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

Changes the WhatsApp Business profile of the device: description, address, e-mail, websites and opening hours. Only the fields you send change; give at least one. Unknown fields are rejected. A device on the ordinary WhatsApp app (not WhatsApp Business) answers 409 NOT_A_BUSINESS_ACCOUNT.

Path parameters

  • sessionIdstringrequired
    Session (device) id

Request body

  • descriptionstring
    The business description shown on the profile (up to 512 characters)
    Up to 512 characters
  • addressstring
    Street address (up to 256 characters)
    Up to 256 characters
  • emailstring (email)
    Contact e-mail address
    Up to 128 characters
  • websitesarray of string (uri)
    Up to two website addresses
    Up to 2 items
  • hoursobject
    Opening hours
  • hours.timezonestringrequired
    IANA time zone, for example Asia/Jakarta
    Up to 64 characters
  • hours.daysarray of objectrequired
    Up to 7 items
  • hours.days[].daystringrequired
    One of: sun, mon, tue, wed, thu, fri, sat
  • hours.days[].modestringrequired
    One of: specific_hours
  • hours.days[].openstringrequired
    Opening time, 24-hour HH:MM
  • hours.days[].closestringrequired
    Closing time, 24-hour HH:MM (later than open)

Responses

  • 200Updated
    Response fields
    • okbooleanrequired
    • updatedarray of stringrequired
      The fields that were sent to WhatsApp
  • 400A field is missing, too long or not valid (VALIDATION_ERROR)
  • 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
  • 409Not connected, or not a WhatsApp Business account (NOT_A_BUSINESS_ACCOUNT)
  • 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/profile" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "Gentle dental care in central Jakarta",
  "email": "hello@example.com",
  "websites": [
    "https://example.com"
  ],
  "hours": {
    "timezone": "Asia/Jakarta",
    "days": [
      {
        "day": "mon",
        "mode": "specific_hours",
        "open": "09:00",
        "close": "17:00"
      },
      {
        "day": "sat",
        "mode": "appointment_only"
      }
    ]
  }
}'
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({
    "description": "Gentle dental care in central Jakarta",
    "email": "hello@example.com",
    "websites": [
      "https://example.com"
    ],
    "hours": {
      "timezone": "Asia/Jakarta",
      "days": [
        {
          "day": "mon",
          "mode": "specific_hours",
          "open": "09:00",
          "close": "17:00"
        },
        {
          "day": "sat",
          "mode": "appointment_only"
        }
      ]
    }
  }),
});
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={
        "description": "Gentle dental care in central Jakarta",
        "email": "hello@example.com",
        "websites": [
            "https://example.com",
        ],
        "hours": {
            "timezone": "Asia/Jakarta",
            "days": [
                {
                    "day": "mon",
                    "mode": "specific_hours",
                    "open": "09:00",
                    "close": "17:00",
                },
                {
                    "day": "sat",
                    "mode": "appointment_only",
                },
            ],
        },
    },
    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' => [
        'description' => 'Gentle dental care in central Jakarta',
        'email' => 'hello@example.com',
        'websites' => [
            'https://example.com',
        ],
        'hours' => [
            'timezone' => 'Asia/Jakarta',
            'days' => [
                [
                    'day' => 'mon',
                    'mode' => 'specific_hours',
                    'open' => '09:00',
                    'close' => '17:00',
                ],
                [
                    'day' => 'sat',
                    'mode' => 'appointment_only',
                ],
            ],
        ],
    ],
]);

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

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
	  "description": "Gentle dental care in central Jakarta",
	  "email": "hello@example.com",
	  "websites": [
	    "https://example.com"
	  ],
	  "hours": {
	    "timezone": "Asia/Jakarta",
	    "days": [
	      {
	        "day": "mon",
	        "mode": "specific_hours",
	        "open": "09:00",
	        "close": "17:00"
	      },
	      {
	        "day": "sat",
	        "mode": "appointment_only"
	      }
	    ]
	  }
	}`)
	req, err := http.NewRequest("PUT", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/profile", 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,
  "updated": [
    "string"
  ]
}

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));
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog", 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
{
  "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));
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
	  "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"
	}`)
	req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products", 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
{
  "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));
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
	  "product_ids": [
	    "01JA5V6Q8M2H7G4K9P3T0R1S2X"
	  ]
	}`)
	req, err := http.NewRequest("DELETE", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products", 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
{
  "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));
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
	  "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"
	}`)
	req, err := http.NewRequest("PUT", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/business/catalog/products/7012345678901234", 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
{
  "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));
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/labels", 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
{
  "labels": [
    {
      "id": "01JA5V6Q8M2H7G4K9P3T0R1S2X",
      "name": "Example"
    }
  ]
}