v51

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-014102371.0 MB
Service Agent

Send an aimessage

Creates and sends a new message to the given aicall and returns the details of the created message. The aicall must belong to the service agent's own customer.

post/service_agents/aimessages

Request body

aicall_idstring uuid required

The ID of the aicall to send the message to. Returned from the POST /service_agents/aicalls or GET /service_agents/aicalls response.

role'' | 'system' | 'user' | 'assistant' | 'function' | 'tool' | 'notification' required

Role of the entity in the conversation.

contentstring required

The message content.

Example request

{
  "aicall_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
  "role": "assistant",
  "content": "Hello, how can I help you today?"
}

Response

The created aimessage details.

idstring uuid

The unique identifier of the message.

customer_idstring uuid

The unique identifier of the associated customer. Returned from the GET /customers response.

aicall_idstring uuid

The unique identifier of the associated AI call. Returned from the GET /aicalls response.

activeflow_idstring uuid

The unique identifier of the activeflow. Returned from the GET /activeflows response.

active_ai_idstring uuid

The unique identifier of the AI configuration that was active when this message was created. Returned from the GET /ais response.

role'' | 'system' | 'user' | 'assistant' | 'function' | 'tool' | 'notification'

Role of the entity in the conversation.

contentstring

Content of the message.

direction'' | 'incoming' | 'outgoing'

Direction of the message.

tool_call_idstring

The tool call ID this message is responding to.

tm_createstring date-time

Timestamp when the message was created.

Example response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "customer_id": "7c4d2f3a-1b8e-4f5c-9a6d-3e2f1a0b4c5d",
  "aicall_id": "550e8400-e29b-41d4-a716-446655440000",
  "activeflow_id": "550e8400-e29b-41d4-a716-446655440000",
  "active_ai_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "role": "assistant",
  "content": "Hello, how can I help you today?",
  "direction": "incoming",
  "tool_calls": [
    {
      "id": "call_abc123",
      "type": "function",
      "function": {
        "name": "get_weather",
        "arguments": "{\"location\": \"San Francisco\"}"
      }
    }
  ],
  "tool_call_id": "call_abc123",
  "tm_create": "2026-01-15T09:30:00.000000Z"
}