Service Agent

Decide an SMS draft

Changed on

Approves or rejects an SMS draft card that the Insight Assistant produced with the draft_message tool. On approve the platform sends the drafted SMS (to the stored recipient and text, from the account's default sender) without involving the LLM, and records the result in the aicall's message history. On reject nothing is sent and the rejection is recorded. The draft id is the id of the tool message that carries the sms_draft block. A draft can be decided once. A repeated or opposite decision is refused with DRAFT_ALREADY_DECIDED. A draft that is not decided within 10 minutes of its creation (the default; operators can change it) is refused with DRAFT_EXPIRED. Both refusals answer with HTTP 409. An unknown draft, or a draft of another aicall or customer, is refused with DRAFT_NOT_FOUND. The aicall must belong to the service agent's own customer. A send failure is returned as a normal response whose message content has result set to failed.

post/service_agents/aimessages/draft-decision

Request

Request body

aicall_idstring uuid required

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

draft_idstring uuid required

The ID of the tool message that carries the sms_draft block. Returned from the id field of the GET /service_agents/aimessages response or of the aimessage_created event.

decision'approve' | 'reject' required

The agent's decision on an SMS draft card. approve sends the drafted SMS; reject discards it without sending.

Example request

{
  "aicall_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
  "draft_id": "7a1c3f80-804e-11ec-8477-2fea5968d85b",
  "decision": "approve"
}

Response

The tool message that records the decision result.

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.

origin'' | 'proactive' | 'listen_internal'

How this message came to exist, orthogonally to role. Empty for ordinary messages. "proactive" marks a note the Insight AI sent on its own initiative while monitoring a live call, rather than in answer to anything. "listen_internal" marks internal bookkeeping rows produced while monitoring; do not depend on their presence or meaning.

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",
  "origin": "proactive",
  "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"
}

Changes