Send a message to the business analyst and receive an analyzed response.
Request
Unique identifier for the user in your system
Previous messages in the conversation{
role: 'user' | 'assistant' | 'system'
content: string
metadata?: {
mode?: 'chat' | 'business_analyst'
agentId?: string
thoughts?: string
reasoning?: string
actions?: Array<{
tool: string
toolInput: string
log: string
}>
followUpQuestion?: string
}
timestamp?: number
}[]
ID of an existing conversation to continue
List of specific integrations to use
Whether to use all available integrations
mode
string
default:"business_analyst"
Mode of operation (‘chat’ or ‘business_analyst’)
ID of a specific agent to use
Whether to store conversation history
Whether to use passthrough integrations
Response
The analyzed response to the message
The agent’s thought process
Actions taken by the agent{
tool: string
toolInput: string
log: string
}[]
Suggested follow-up question
Reasoning behind the analysis
Unix timestamp of the response
Example
curl -X POST https://suada.ai/api/public/chat \
-H "Authorization: Bearer sk-suada-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"message": "What's our revenue trend?",
"externalUserIdentifier": "user-123",
"useAllIntegrations": true,
"mode": "business_analyst"
}'
{
"answer": "Based on our analysis of recent data, your revenue shows a positive trend with a 15% growth rate over the last quarter...",
"thoughts": "Analyzing revenue data from multiple sources including Google Analytics and Zoho CRM...",
"actions": [
{
"tool": "google_analytics",
"toolInput": "query_revenue_metrics",
"log": "Retrieved revenue metrics for last quarter"
},
{
"tool": "zoho_crm",
"toolInput": "get_sales_pipeline",
"log": "Analyzed sales pipeline data"
}
],
"followUpQuestion": "Would you like to see a breakdown of revenue by product category?",
"reasoning": "The growth is primarily driven by increased enterprise sales and successful product launches",
"conversationId": "conv_123abc",
"timestamp": 1625097600000
}
Error Codes
Authentication error{
"error": "Invalid or expired API key"
}
Permission error{
"error": "Insufficient permissions"
}
Rate limit exceeded{
"error": "Too many requests, please try again later.",
"retryAfter": 60
}
Notes
- The conversation history is automatically stored unless
privacyMode is enabled
- When
useAllIntegrations is true, the agent will use all available integrations for the user/organization
- The
mode parameter determines how the message is processed:
business_analyst: Full analysis with integrations
chat: Simple chat response without integration data
- Rate limits apply based on your plan (see Rate Limiting)