API Reference

The Kloosr API is the programmatic interface to every layer of the platform, business data, integration events, workflow triggers, and AI agents. It is REST-first with GraphQL for complex queries, versioned under /v1, and designed for the same governance model your operations team uses in the console.

All endpoints require OAuth 2.0 client credentials or a scoped API key. Requests are tenant-isolated, rate-limited per plan, and fully logged in the audit trail. Sandbox and production environments are separate tenants with identical API surfaces.

v1

Current API version

99.9%

API uptime SLA

120

Requests/sec (Scale)

<200ms

P95 latency

API Domains

Core & Auth

/v1/auth, /v1/tenants

Token exchange, tenant metadata, user provisioning, and role management.

POST /oauth/tokenGET /tenants/{id}GET /usersPOST /users

Business Data

/v1/crm, /v1/inventory, /v1/finance

CRUD operations on orders, SKUs, customers, invoices, and ledger entries.

GET /inventory/itemsPOST /crm/dealsPATCH /finance/invoices/{id}

Integrations

/v1/connectors, /v1/sync

Manage connectors, trigger sync jobs, inspect field mappings, and replay failed events.

GET /connectorsPOST /sync/triggerGET /sync/logs

Workflows & Events

/v1/workflows, /v1/events

Subscribe to the event bus, publish custom events, and invoke automation workflows.

POST /events/subscribeGET /events/{id}POST /workflows/{id}/run

AI & Copilot

/v1/ai

Query operations data in natural language, run document extraction, and invoke agent tasks.

POST /ai/queryPOST /ai/documents/extractPOST /ai/agents/run

Code Examples

Authentication

POST /v1/oauth/token
Content-Type: application/json

{
  "grant_type": "client_credentials",
  "client_id": "kl_live_xxxxxxxx",
  "client_secret": "sk_live_xxxxxxxx",
  "scope": "inventory:read crm:write"
}

// Response
{
  "access_token": "eyJhbG...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "inventory:read crm:write"
}

Inventory Query

GET /v1/inventory/items?reorder_below=true&warehouse_id=wh_jkt_01
Authorization: Bearer eyJhbG...
X-Kloosr-Tenant: tenant_acme

{
  "data": [
    {
      "id": "sku_1042",
      "name": "Hydraulic Seal 42mm",
      "quantity_on_hand": 18,
      "reorder_point": 50,
      "warehouse_id": "wh_jkt_01",
      "last_synced_at": "2026-08-10T08:14:22Z"
    }
  ],
  "meta": { "total": 3, "page": 1, "per_page": 25 }
}

Official SDKs

JavaScript / TypeScript

v3.2.1

npm install @kloosr/sdk

Python

v2.8.0

pip install kloosr

Java

v1.6.0

Maven: com.kloosr:sdk:1.6.0

Go

v1.4.2

go get github.com/kloosr/kloosr-go

Rate Limits by Plan

Launch

30 req/s

60/min

Growth

60 req/s

120/min

Scale

120 req/s

300/min

Enterprise

Custom

Dedicated pool

Webhooks

inventory.stock.low

Fired when SKU quantity drops below reorder point.

order.created

New sales or purchase order created in any connected channel.

sync.failed

Connector sync job failed after retry policy exhausted.

workflow.completed

Automation workflow finished successfully or with terminal error.

ai.query.completed

Copilot query returned a structured response.