Serverless AI Bot Data Matcher
AI powered service that matches user queries with relevant data items and associates them with appropriate intents.
Endpoint
Match data with intents based on user queries
POSThttps://api.xtartapp.com/bot/data
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
ask | string | Yes | 500 | The user query to match with data items and intents |
data | array of objects | Yes | 25 | Collection of data items to match against the query |
data[].id | string | Yes | 100 | Unique identifier for the data item |
data[].content | string | Yes | 250 | Content of the data item |
intents | array of objects | Yes | 10 | Available intents to match with data items |
intents[].name | string | Yes | 50 | The name of the intent |
intents[].description | string | Yes | 200 | The description of the intent |
history | array of objects | No | 15 | Previous conversation history between user and bot |
history[].role | string | Yes | - | The role of the message sender (user or bot) |
history[].content | string | Yes | 500 | The message content |
language | string | No | - | The language code for the response |
Response
Name | Type | Description |
---|---|---|
data | object | The response data |
data.matches | array | Array of matched data items with associated intents and confidence scores |
data.matches[].dataId | string | The ID of the matched data item |
data.matches[].intent | string | The name of the matched intent |
data.matches[].confidence | number | Confidence score for this match (0-1) |
data.response | string | The response message to the user query |
data.total | number | The total number of matches |
metadata | object | Metadata about the data matching process |
metadata.cost | number | The cost of the data matching request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when the payload is invalid. |
400 | INVALID_REQUEST | Ex.: The request is invalid. |
400 | BOT_DATA_ERROR | Ex: could not match data | parsing error |
400 | HARM_CONTENT | Ex.: The content is harmful and cannot be processed. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
400 | INPUT_TOO_LONG | The input text exceeds the maximum length |
401 | UNAUTHORIZED | Ex.: The token is invalid. |
429 | TOO_MANY_REQUESTS | Ex.: The request limit has been reached. |