POST
/
chat
{
  "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
}

Send a message to the business analyst and receive an analyzed response.

Request

message
string
required

The message to analyze

externalUserIdentifier
string
required

Unique identifier for the user in your system

chatHistory
array

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
}[]
conversationId
string

ID of an existing conversation to continue

integrations
string[]

List of specific integrations to use

useAllIntegrations
boolean
default:"true"

Whether to use all available integrations

mode
string
default:"business_analyst"

Mode of operation (‘chat’ or ‘business_analyst’)

agentId
string

ID of a specific agent to use

privacyMode
boolean
default:"false"

Whether to store conversation history

passthroughMode
boolean
default:"false"

Whether to use passthrough integrations

Response

answer
string

The analyzed response to the message

thoughts
string

The agent’s thought process

actions
array

Actions taken by the agent

{
  tool: string
  toolInput: string
  log: string
}[]
followUpQuestion
string

Suggested follow-up question

reasoning
string

Reasoning behind the analysis

conversationId
string

ID of the conversation

timestamp
number

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

401
object

Authentication error

{
  "error": "Invalid or expired API key"
}
403
object

Permission error

{
  "error": "Insufficient permissions"
}
429
object

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)