Serverless AI Bot Trigger

AI powered bot trigger service that determines if user input can trigger external APIs and generates appropriate payloads.

Endpoint

Trigger external APIs based on user input

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

*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
triggersarray of objectsYes10List of possible triggers to evaluate
triggers[].namestringYes50The name of the trigger
triggers[].urlstringYes-The URL to trigger when the input matches the criteria
triggers[].objectivestringYes100The objective of the trigger
triggers[].parametersarray of stringsNo50List of parameter names that can be used with this trigger
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 trigger evaluation
context[]stringYes500Additional context information for trigger evaluation
languagestringNo-The language code for the response

Response

NameTypeDescription
dataobjectThe trigger response data
data.triggersarrayArray of relevant triggers with explanations and confidence scores
data.triggers[].namestringThe name of the relevant trigger
data.triggers[].explanationstringExplanation of why the trigger is relevant
data.triggers[].confidencenumberConfidence score between 0 and 1
data.triggers[].payloadobjectThe parsed parameters as a JSON object to be submitted to the trigger URL
data.triggers[].urlstringThe URL of the matched trigger
data.responsestringThe response to the user message
metadataobjectMetadata about the trigger process
metadata.costnumberThe cost of the trigger request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400BOT_TRIGGER_ERROREx: could not process trigger | 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.