Skip to content

API Reference

KLEO Chat exposes a RESTful API for store management and integration.

Base URL

Production: https://teflon-kleobot.onrender.com

Authentication

API requests require store authentication via query parameter or header:

bash
# Query parameter
GET /api/products?storeId=mystore.myshopify.com

# Or header
GET /api/products
X-Store-Id: mystore.myshopify.com

Endpoints

Health Check

http
GET /health

Response:

json
{
  "status": "ok",
  "architecture": "SOLID",
  "timestamp": "2026-02-04T10:00:00.000Z"
}

Store Configuration

Get Store Config

http
GET /api/store-config/:storeId

Response:

json
{
  "success": true,
  "config": {
    "storeId": "mystore.myshopify.com",
    "services": {
      "telegram": {
        "botUsername": "mystorebot",
        "isActive": true,
        "webhookConfigured": true
      },
      "ai": {
        "enabled": true,
        "personality": "friendly"
      }
    }
  }
}

Save Telegram Token

http
POST /api/store-config/:storeId/telegram
Content-Type: application/json

{
  "botToken": "123456:ABC-DEF..."
}

Response:

json
{
  "success": true,
  "message": "Telegram bot configured and webhook registered",
  "botUsername": "mystorebot"
}

Products

Search Products

http
GET /api/products/search?storeId=:storeId&q=:query

Parameters:

NameTypeDescription
storeIdstringShopify store domain
qstringSearch query
limitnumberMax results (default: 10)

Response:

json
{
  "success": true,
  "products": [
    {
      "id": "gid://shopify/Product/123",
      "title": "Red Running Shoes",
      "description": "Comfortable running shoes...",
      "price": "89.99",
      "currency": "EUR",
      "images": ["https://..."],
      "variants": [...]
    }
  ]
}

Get Product by ID

http
GET /api/products/:productId?storeId=:storeId

Webhooks

Telegram Webhook

http
POST /telegram/webhook/:storeId

Receives updates from Telegram Bot API. Configured automatically when merchant saves bot token.

Shopify Order Webhook

http
POST /webhooks/shopify/orders
X-Shopify-Hmac-SHA256: {signature}
X-Shopify-Shop-Domain: {shop}

Receives order notifications from Shopify.


Dashboard

Serve Dashboard

http
GET /shopify-app/

Embedded merchant dashboard (Polaris-based).


Error Responses

All errors follow this format:

json
{
  "success": false,
  "error": "Error message",
  "code": "ERROR_CODE"
}
CodeHTTP StatusDescription
STORE_NOT_FOUND404Store doesn't exist
INVALID_TOKEN400Bot token is invalid
UNAUTHORIZED401Missing authentication
RATE_LIMITED429Too many requests

Rate Limits

EndpointLimit
/api/*100 req/min per store
/telegram/webhook/*Unlimited (Telegram traffic)
/healthUnlimited

SDKs

Coming soon:

  • JavaScript/TypeScript SDK
  • Python SDK