Skip to main content
POST
/
v1
/
aibot
/
bots
/
{AgentId}
/
send-message
Chat with Agent
curl --request POST \
  --url http://{your-domain}/v1/aibot/bots/{AgentId}/send-message \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "tools": [
    {
      "name": "<string>",
      "description": "<string>",
      "parameters": {}
    }
  ],
  "resume": {
    "interruptId": "interrupt_abc123",
    "payload": {}
  },
  "conversationId": "conversation-xxx"
}
'
{
  "type": "text",
  "content": "Hello! How can I assist you today?"
}

Authorizations

Authorization
string
header
required

Token corresponding to the environment ID, obtained through login authentication

Headers

Accept
string
default:text/event-stream

Accept header for streaming response

Path Parameters

AgentId
string
required

Agent ID

Body

application/json
messages
object[]

Array of conversation messages

tools
object[]

Array of available tools for the agent

resume
object

Resume info for resuming an interrupted conversation

conversationId
string

Conversation ID for multi-conversation support (optional)

Example:

"conversation-xxx"

Response

Agent conversation successful, returns SSE format. Each event follows the SSE specification with JSON data:

data: {"type": "text", "content": "Hello"}

data: {"type": "tool-call-start", "toolCallId": "call_123", "toolCallName": "search"}

data: {"type": "tool-call-args", "toolCallId": "call_123", "delta": "{\"query\": \"weather\"}"}

data: {"type": "tool-call-end", "toolCallId": "call_123"}

data: {"type": "tool-result", "result": "Sunny, 25°C", "toolCallId": "call_123"}

data: [DONE]

The response is a stream of Server-Sent Events where each event contains JSON data representing different types of agent interactions.

Text content event from the agent. Contains streaming text responses as the agent generates them.

type
enum<string>
required

Event type identifier

Available options:
text
content
string
required

Text content from agent

Example:

"Hello! How can I assist you today?"