Skip to content
Talk to our solutions team

AI Bot API

Two surfaces: a data plane for conversations, and an admin plane for bot definitions and deploys.

The platform tenancy headers apply — X-Kis-Tenant, X-Kis-Product, X-Kis-Environment. Conversations are tenant-scoped; one tenant’s bots and conversations are not reachable from another.

GET /v1/bots/{bot}/conversations list conversations
GET /v1/bots/{bot}/conversations/{id} one conversation
POST /v1/bots/{bot}/conversations/{id}/messages send a message
POST /v1/bots/{bot}/conversations/{id}/messages/stream send, stream the reply
{
"text": "where is my order?",
"locale": "en-US",
"stream": false,
"attachments": [
{ "kind": "image", "media_type": "image/png", "uri": "https://…", "name": "receipt.png" }
],
"metadata": {}
}
FieldTypeRequiredNotes
textstringyesThe user’s message
localestringnoBCP-47; falls back to the bot’s default
streamboolnoStream the response instead of buffering it
attachments[]arraynokind, media_type, uri, optional name
metadataobjectnoPassed through to script hooks
{
"conversation_id": "01JB7CY1Q6R0GK09RZAVDQGF11",
"text": "Your order shipped on Tuesday.",
"cards": [],
"buttons": [],
"quick_replies": [],
"intent": "order_status",
"resolved_stage": "classifier"
}
FieldNotes
conversation_idStable id; send it back to continue the conversation
textThe reply
cards, buttons, quick_repliesRich elements, when the channel supports them
intentThe intent the cascade settled on
resolved_stageWhich cascade stage answered

resolved_stage is the field worth logging. It is the per-message view of the cost property the whole block is built around — a bot whose traffic increasingly resolves at llm rather than rules or classifier is getting more expensive, and this is where you see it before the bill does. See Core Concepts.

POST …/messages/stream streams the reply over SSE. Non-generative resolutions (a canned answer from a rule, a fast skill) return immediately rather than streaming, so a client must handle both. Streams are accumulated into conversation history on completion, so a streamed answer is stored the same as a buffered one.

GET /admin/v1/bots bots in this tenant
GET /admin/v1/bots/{bot} one bot definition
POST /admin/v1/bots/{bot}/deploy promote an artifact to an environment
POST /admin/v1/bots/{bot}/rollback restore the previous artifact
GET /admin/v1/stats cascade and resolution statistics
GET /admin/v1/health readiness

Deploy and rollback operate on signed, versioned artifacts that carry the bot definition, rules, scripts, model references and calibration together. Rollback therefore restores the exact prior behaviour rather than approximately restoring it — the models travel with the artifact instead of living in mutable state.

The platform’s structured error body: a stable code, a human-readable message, and the request id for correlation against logs and audit.

StatusMeaning
400Malformed message
401 / 403Authentication or authorisation failure
404Unknown bot or conversation for this tenant
429Rate limited, or a gateway budget exhausted upstream
5xxCascade failure with no resolvable stage

The surface splits by audience, and the split is deliberate:

RoutesWho calls themCredential
/v1/bots/:bot/conversations/*End users talking to a botAnonymous or authenticated
/admin/v1/*Your control planeA bearer token

Conversation routes accept a request with no token at all. That is the point — a bot embedded in a public page has to serve visitors who have not signed in. When a token is present it is validated and the conversation is attributed to that user; when it is absent the request still proceeds.

An anonymous caller may supply a tracking id header so successive messages join the same conversation. Treat that id as a correlation handle, not an identity: it is client-supplied and proves nothing.

The four CPET headers resolve the tenant. :bot selects within it.

StatusMeaning
400Request parse or validation failure
401An admin route with a missing or invalid token, as plain text
404No such bot or conversation
429Rate limited, or a gateway budget exhausted upstream
500Unexpected server error, or a model call failed