Conversation and Message Responses (Streaming/Synchronous)
Conversations and Synchronization
Send messages to AI assistant and receive responses.
curl -X POST \
'https://api.maiagent.ai/api/v1/chatbots/{chatbot_id}/completions/' \
-H 'Authorization: Api-Key YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"conversation": "string|null",
"message": {
"content": "string",
"attachments": []
},
"is_streaming": boolean
}'Parameters:
chatbot_id(path parameter): Chatbot IDconversation(request content): Optional conversation ID for continuing conversationsmessage.content(request content): Message content to be sentmessage.attachments(request content): Array of attachments (if any)is_streaming(request content): Whether to use streaming response
Response (Non-streaming):
{
"content": "string",
"conversationId": "string"
}Response (Streaming):
Server-sent events format:
data: {
"content": "string",
"conversation_id": "string",
"done": boolean
}Notes:
For streaming responses, the server will send multiple events containing partial content until the response is complete
The conversation ID returned in the response can be used for subsequent requests to continue the conversation
Integration Results
Last updated
Was this helpful?
