Serverless AI Bot Action

AI powered bot action service that determines which actions are relevant based on user input and provides explanations with confidence scores.

Endpoint

Determine relevant actions based on user input

POSThttps://api.xtartapp.com/bot/action

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
askstringYes500The user input message
actionsarray of objectsYes10List of possible actions to evaluate
actions[].namestringYes50The name of the action
actions[].objectivestringYes100The objective of the action
actions[].parametersarray of stringsNo50List of parameter names that can be used with this action. Parameters must be meaningful and relevant to its objective or intent.
historyarray of objectsNo15Previous conversation history between user and bot
history[].rolestringYes-The role of the message sender (user or bot)
history[].contentstringYes500The message content
contextarray of stringsNo25Additional context information for action evaluation
context[]stringYes500Additional context information for action evaluation
languagestringNo-The language code for the response

Response

NameTypeDescription
dataobjectThe action response data
data.actionsarrayArray of relevant actions with explanations and confidence scores
data.actions[].namestringThe name of the relevant action
data.actions[].explanationstringExplanation of why the action is relevant
data.actions[].confidencenumberConfidence score between 0 and 1
data.actions[].payloadobjectThe parsed parameters as a JSON object containing the matched action's parameter values
data.responsestringThe response to the user message
metadataobjectMetadata about the action process
metadata.costnumberThe cost of the action request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400BOT_ACTION_ERROREx: could not determine actions | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
400INPUT_TOO_LONGThe input text exceeds the maximum length
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.