v1.0 • Lead Management
Send a message to your chatbot and receive an AI response
Send a chat message and receive an AI-powered response
POST https://your-domain.com/api/v1/chatbots/{chatbotId}/chatchatbotIdThe unique identifier of the chatbot (required)
JSON payload with your message and options
{
"message": "Hello, how can you help me?",
"conversationId": "cm5abc123xyz456",
"stream": true,
"metadata": {
"source": "mobile_app",
"userId": "user_123"
}
}messageThe user's message to send to the chatbot
conversationIdContinue an existing conversation
streamEnable streaming response (SSE)
metadataCustom metadata for the request
If stream is provided, it overrides the chatbot's default setting. If not provided, the chatbot's configured streaming preference is used.
Different response formats based on streaming mode
{
"success": true,
"data": {
"response": "Hello! I'm here to help you. What would you like to know?",
"conversationId": "cm5abc123xyz456",
"messageId": "cm5msg789def012"
}
}Use the returned conversationId in your next request:
{
"message": "Tell me more about that",
"conversationId": "cm5abc123xyz456"
}Common error codes and their meanings
{
"success": false,
"error": "Invalid or inactive API key",
"code": "INVALID_API_KEY"
}{
"success": false,
"error": "Chatbot not found or access denied",
"code": "CHATBOT_NOT_FOUND"
}{
"success": false,
"error": "Rate limit exceeded. Please wait before sending another message.",
"code": "RATE_LIMIT_EXCEEDED",
"retryAfter": 60
}{
"success": false,
"error": "Insufficient credits to generate AI response. Please upgrade your plan.",
"code": "INSUFFICIENT_CREDITS"
}Ready-to-use examples in popular languages
# Non-streaming request
curl -X POST https://your-domain.com/api/v1/chatbots/{chatbotId}/chat \
-H "Authorization: Bearer sk-workspace_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, how can you help me?"
}'
# Streaming request
curl -X POST https://your-domain.com/api/v1/chatbots/{chatbotId}/chat \
-H "Authorization: Bearer sk-workspace_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello!",
"stream": true
}' --no-bufferRate limits are configured per chatbot. Check your chatbot's settings for the specific limits. The response headers include rate limit information:
X-RateLimit-LimitMaximum requests allowedX-RateLimit-RemainingRequests remaining in current windowX-RateLimit-ResetUnix timestamp when the limit resets