Chat
Send new chat message and get response from your AI chat bot
Request Body required
Chat message request body
Your Magic AI project id
The text message that you want to send to your AI chat bot
The unique identifier of the session. If you don't provide it, the API will generate a new session id for you. You will need to save this on your side for consecutive requests. Otherwise you will loose chat history
- 200
- 400
- 401
- 403
- 426
- 500
successful operation
Schema
- Array [
- ]
The response you get from your AI chat bot
sourceDocuments object[]
The documents that your AI chat bot used to generate the response
The text message that you want to send to your AI chat bot
metadata object
The title of the datasource used to train the AI model
If the datasource is a web page, this is the url of the page
{
"text": "Magic AI is a SaaS platform that allows you to create personalized chat bots using your own data. It serves as a game-changing solution...",
"sourceDocuments": [
{
"pageContent": "What is Magic AI?\\n\\nMagic AI is a SaaS platform that allows you to create personalised chat bots using your own data. The platform enables you to...",
"metadata": {
"title": "How Personalised Chat Bots Can Help Teams Work Together More Efficiently | Magic AI",
"url": "https://magicai.ai/what-is-magic-ai"
}
}
]
}
The specified parameter is invalid
Schema
unique error code
{
"message": "Invalid Request",
"details": "Project already exists",
"code": "PROJECT_EXISTS"
}
Authentication information is missing or invalid
Response Headers
WWW_Authenticate string
You don't have permission to access this resource
Schema
unique error code
{
"message": "Invalid Request",
"details": "Project already exists",
"code": "PROJECT_EXISTS"
}
You need to upgrade your account to access this resource
Schema
unique error code
{
"message": "Invalid Request",
"details": "Project already exists",
"code": "PROJECT_EXISTS"
}
An unexpected error occurred
Schema
unique error code
{
"message": "Invalid Request",
"details": "Project already exists",
"code": "PROJECT_EXISTS"
}