Ilana Docs
API

POST /chat

Endpoint

POST /chat

Authentication: Required — Authorization: Bearer <embed-token>

Request Body

{
  "botId": string,            // Required — agent ID
  "input": string,            // Required — user message
  "conversationId"?: string   // Optional — for multi-turn conversations
}
FieldTypeRequiredDescription
botIdstringYesThe agent ID
inputstringYesThe user's message text
conversationIdstringNoPass the ID from a previous response to continue the conversation

Response (200 OK)

{
  "conversationId": "conv-abc-123",
  "response": "We offer three plans: Free, Starter, and Growth...",
  "intentDetected": "pricing_inquiry",
  "metadata": {
    "capabilityAllowed": true,
    "schemaEnforced": false,
    "schemaFallbackUsed": false
  }
}
FieldTypeDescription
conversationIdstringConversation ID for follow-up messages
responsestringThe AI-generated response
intentDetectedstring | undefinedClassified intent name
metadataobjectGovernance enforcement metadata

metadata

FieldTypeDescription
capabilityAllowedbooleanWhether the intent was allowed by the Capability Profile
enforcementReasonstring | undefinedWhy the request was restricted (see below)
schemaEnforcedbooleanWhether output schema enforcement was applied
schemaFallbackUsedbooleanWhether a fallback response replaced the original
schemaValidationErrorstring | undefinedSchema validation error details

enforcementReason Values

ValueMeaning
DENY_LISTIntent is on the Capability Profile deny list
NOT_IN_ALLOW_LISTIntent is not in the allow list
no_intent_matchCould not classify any intent from the input
schema_fallbackResponse failed schema validation; fallback used

Example

curl -X POST https://api.getilana.ai/chat \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "botId": "bot-abc-123",
    "input": "What pricing plans do you offer?"
  }'

Error Responses

See Error Handling for the full error response format and codes.

Common errors for this endpoint:

StatusCodeCause
400INVALID_REQUESTMissing or malformed request body
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENDomain not allowed for this bot
404NOT_FOUNDBot not found
429RATE_LIMITEDToo many requests
429MESSAGE_CAP_EXCEEDEDMonthly message cap reached