---
title: "Decide an SMS draft"
method: POST
path: "/service_agents/aimessages/draft-decision"
tags: ["Service Agent"]
---

# Decide an SMS draft

`POST /service_agents/aimessages/draft-decision`

## Request

- Base URL: `https://api.voipbin.net/v1.0`
- URL: `https://api.voipbin.net/v1.0/service_agents/aimessages/draft-decision`
- Auth: none declared
- TypeScript: <https://skmtc.dev/voipbin/apis/voipbin-api/docs/service_agents/aimessages/draft-decision/post.ts> (a function with typed inputs; its response is checked against the schema)

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`.

## Request body

- object
  - `aicall_id` string, 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_id` string, 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.

## Response `200`

The `tool` message that records the decision result.

- AIManagerMessage
  - `id` string, uuid: The unique identifier of the message.
  - `customer_id` string, uuid: The unique identifier of the associated customer. Returned from the `GET /customers` response.
  - `aicall_id` string, uuid: The unique identifier of the associated AI call. Returned from the `GET /aicalls` response.
  - `activeflow_id` string, uuid: The unique identifier of the activeflow. Returned from the `GET /activeflows` response.
  - `active_ai_id` string, 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.
  - `content` string: 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_calls` object[]: List of tool calls made during the message.
    - `id` string: The unique identifier of the tool call.
    - `type` string: The type of tool call.
    - `function` object: The function call details.
      - `name` string: The name of the function to call.
      - `arguments` string: The arguments to pass to the function as a JSON string.
  - `tool_call_id` string: The tool call ID this message is responding to.
  - `tm_create` string, date-time: Timestamp when the message was created.

## Other responses

- `400`: Invalid request (INVALID_ARGUMENT).
- `401`: Authentication required (UNAUTHENTICATED).
- `403`: Insufficient permission (PERMISSION_DENIED).
- `404`: Resource not found (NOT_FOUND).
- `409`: State conflict (ALREADY_EXISTS or FAILED_PRECONDITION).
- `500`: Internal error (INTERNAL).

## Changes

- **2026-11-10** `111e2c5d9203`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/voipbin/apis/voipbin-api/changes/service_agents/aimessages/draft-decision/post.md)

---

[API](https://skmtc.dev/voipbin/apis/voipbin-api.md) - [All operations](https://skmtc.dev/voipbin/apis/voipbin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/voipbin/apis/voipbin-api/revisions/a3618cfd2159?raw)
