---
title: "Create Sms Draft Message"
method: POST
path: "/v2/sms/messages"
tags: ["sms"]
---

# Create Sms Draft Message

`POST /v2/sms/messages`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/sms/messages`
- Auth: HTTP bearer

Create SMS Draft

Create an SMS draft message for a partner. The body can be provided directly,
generated from a template, or generated by an LLM.

## Request body

- CreateSMSRequest: Request body for creating an SMS draft. Exactly one body source must be provided: `body`, `sms_template_id`, or `options.use_llm`. Generated bodies (`sms_template_id`, `options.use_llm`) are built from invoices, so they need at least one; a manual `body` may be sent with none (e.g. a free-form reply in an existing conversation).
  - `invoices` string[], required: Invoice IDs to link to the SMS; may be empty with a manual body
  - `partner_id` string, required: Partner ID to send the SMS to
  - `sms_template_id` string, nullable: SMS template ID to render
  - `body` string, nullable: Manual SMS body text
  - `options` CreateSMSOptions: Options for SMS draft creation.
    - `use_llm` boolean: Generate SMS body using LLM
    - `include_payment_url` boolean: Include payment URL in generated body

## Response `200`

Successful Response

- SMS: An SMS message.
  - `created_at` string, date-time, required
  - `modified_at` string, date-time, nullable, required
  - `id` string, required
  - `body` string, required: The message content
  - `classifications` InteractionClassification[], required
    - `created_at` string, date-time, required
    - `modified_at` string, date-time, nullable, required
    - `id` string, required
    - `action_recommendation` string, nullable, required: Necessary actions that need to be taken in response to this interaction
    - `agent_confidence_score` integer, nullable, required: The confidence score of the result on a scale of 0-100, where 0 indicates no confidence in the accuracy of the result and 100 indicates full confidence in the accuracy of the result.
    - `agent_metrics` AgentMetrics, required: The AI agent's confidence metrics
      - `confidence_reason` string, nullable: The justification for the agent's confidence score.
      - `confidence_score` integer, nullable: The confidence score of the result on a scale of 0-100, where 0 indicates no confidence in the accuracy of the result and 100 indicates full confidence in the accuracy of the result.
      - `error_code` 'duplicate' | 'insufficient' | 'invalid_file_type' | 'irrelevant' | 'processing_error' | 'upload_missing', nullable: The code for why an error occurred when processing the statement.
      - `uncertainties` string[]: A list of uncertainties we have regarding the result.
    - `classification` 'payment_inquiry' | 'payment_promise' | 'account_inquiry' | 'invoice_inquiry' | 'refund_request' | 'cancellation_request' | 'support_request' | 'complaint' | 'feedback' | 'wrong_contact' | 'message_forwarding_request' | 'cc_inclusion_request' | 'not_available' | 'contact_inquiry' | 'dispute' | 'resolution' | 'delivery_failure' | 'payment_processing_request' | 'other', required: Enumerates the possible classifications for an interaction (email or call).
    - `evidence` object, nullable, required: The text excerpts that led to the classification decision
    - `is_action_required` boolean, required: Whether an action or actions need to be taken as a result of this interaction
    - `is_reply_required` boolean, required: Whether an email needs to be sent as a reply to this interaction
    - `language` string, nullable, required: The detected language of the interaction using ISO 639-1 alpha-2 code.
    - `reason` string, required: The reason for the classifications of the interaction
    - `object` string, required: String representing the object's type. Objects of the same type share the same value.
  - `direction` 'inbound' | 'outbound', required
  - `from_number` string, phone, required: The sending phone number
  - `to_number` string, phone, required: The receiving phone number
  - `status` 'draft' | 'pending' | 'sent' | 'delivered' | 'failed' | 'undelivered', required
  - `is_automated` boolean, required: Whether the SMS was automatically sent by a workflow
  - `sent_at` string, date-time, nullable, required
  - `delivered_at` string, date-time, nullable, required
  - `error_message` string, nullable, required: Twilio error message if delivery failed
  - `object` string, required: String representing the object's type. Objects of the same type share the same value.

## Other responses

- `422`: Validation Error

---

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