KineticDocs

API reference

REST endpoints on the same origin as the site. All requests and responses are JSON unless noted.

Base URL & proxying

https://kinetic-4g1.pages.dev/api/...

Cloudflare Pages Functions (/functions/_middleware.js) proxy /api/* to the EC2 backend with the same origin — no CORS configuration is needed for browser apps served alongside it.

Authentication methods

MethodCredentialUsed by
Admin sessionCookie: admin_token=…Admin API (/api/admin/*)
Tenant sessionCookie: kinetic_tenant_session=… (set by POST /api/portal/login; HttpOnly, signed)Portal, verticals, inbox, leads, BI, payments, members, approvals
Developer keyx-developer-api-key: <DEVELOPER_API_KEY>Developer API (/api/developer/*) — CI/CD and programmatic access
Copilot keyAuthorization: Bearer <COPILOT_API_KEYS> or x-copilot-key: …Machine-facing Developer Copilot API (/api/copilot/*)
Webhook secretx-telegram-bot-api-secret-tokenTelegram webhook verification
WhatsApp verify token?hub.verify_token=…WhatsApp webhook handshake
Never embed admin, developer, or tenant credentials in client-side code you ship to third parties. The public chat widget requires only your Org ID, which is a public identifier, not a secret.

Core endpoint groups

GroupPrefixPurpose
Health/api/healthLiveness for load balancers and monitors (public).
Inbox/api/inboxUnified threaded inbox across CX/LG/BD; per-participant threads; replies.
Copilot/api/portal/copilotAgent-loop chat with tool use and progress streaming.
Leads/api/leadsLead discovery, scoring, pipeline stages, pause flags.
Verticals/api/portal/verticalsPer-tenant vertical activation state.
BI/api/bi, /api/portal/roiDashboards, ROI metrics, market briefs.
Payments/api/paymentsWallet top-ups and callbacks (signature-verified).
Admin/api/adminTenants, harnesses, incidents, activity, dashboard data.
Developer/api/developerHealth checks, cost intelligence, overview, infrastructure.
Developer Copilot/api/copilotScoped read-only senses surface for the Developer Copilot; Alertmanager ingestion; gated self-heal.
Offline sync/api/syncOffline batch upload (/batch) and status (/status) for Business Centre Everywhere.

Unified inbox (highlights)

GET  /api/inbox/unified?vertical=cx|lg|bd&channel=&status=all|needs_you|in_progress|resolved
GET  /api/inbox/unified/:vertical/:id/messages
POST /api/inbox/unified/:vertical/:id/reply   { "message": "..." }

# Legacy per-participant endpoints remain available:
GET  /api/inbox
GET  /api/inbox/:participantId/messages
POST /api/inbox/:participantId/reply          { "message": "...", "channel": "whatsapp" }

The unified reply endpoint routes automatically: a CX reply goes out on the customer's channel; an LG reply uses the lead's active WhatsApp; a BD reply uses the partner's WhatsApp. A thread without a sendable channel returns 400 with an explanatory error — the API never fakes a send.

Copilot message

POST /api/portal/copilot/message
{ "message": "Find plumbers in Lusaka", "sessionId": null }   // sessionId: null starts a new session

B2C commerce endpoints (tenant-scoped)

GroupPrefixPurpose
Catalog/api/catalogProducts and categories shown to customers in chat; WhatsApp-formatted catalog view.
Ecommerce/api/ecommerceStore connections, two-way product sync, sync log, platform webhooks.
Marketing/api/marketingDraft marketing campaigns and social content (approval-first).
Supply chain/api/supply-chainLanded cost, exchange-rate checks, supplier/logistics discovery, supply-chain monitoring.
B2C compliance/api/compliance/b2cImport/export requirements and cross-border labour checks from jurisdiction config.

Developer Copilot API (senses)

A machine-facing, scoped surface at /api/copilot for the Developer Copilot. Every route requires the copilot key (see authentication); if COPILOT_API_KEYS is unset the entire surface is disabled and every request is rejected with 503.

GET  /api/copilot/health-check        # orchestrator + MCP + Redis pings with response times
GET  /api/copilot/cost-intelligence   # same logic as GET /api/developer/cost-intelligence
GET  /api/copilot/infrastructure      # container/service infrastructure view
GET  /api/copilot/mesh-health         # harness mesh health
GET  /api/copilot/status              # persisted copilot heartbeat document
POST /api/copilot/alerts              # Alertmanager ingestion: {"alerts":[...]} or a single alert object
POST /api/copilot/remediate           # gated self-heal scaffold (see below)

Admin control plane APIs

The admin control plane exposes tenant lifecycle and platform health via /api/admin (admin session cookie) and the developer-side control-plane views under /api/developer (developer key): tenant list and detail, incidents, activity, usage summaries, pricing, and ingestion/profiling statistics.

Backup & restore

Units consumption

Error semantics

StatusMeaning
400Invalid input, or an operation that cannot be honestly performed (e.g. replying on a channel with no connection).
401Missing/expired credentials.
404Resource does not exist in this tenant's scope.
503A required dependency (DB, harness) is starting or unavailable.