> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create SMS

> Create, send, schedule, or log a Close SMS.

`close.createSms` creates, sends, schedules, or logs a Close SMS.

```ts automations/close-create-sms.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { close } from "automate.ax/close"

export default automation("Create SMS", () => {
  onDashboardRun({ title: "Create SMS" })
  close.createSms({
    status: "outbox",
    leadId: "lead_abc123",
    contactId: "cont_abc123",
    localPhone: "+14155550100",
    remotePhone: "+14155550199",
    text: "Your demo starts in 10 minutes.",
  })
})
```

## Inputs

Provide `status`: `draft`, `scheduled`, `outbox`, `sent`, `inbox`, or `error`. `scheduled` requires `dateScheduled`; both `scheduled` and `outbox` require `localPhone`. `sendIn` accepts 0–59 seconds, and `sendToInbox` controls whether Close adds the sent message to the inbox. Optional fields cover lead/contact, direction, local, and remote E.164 numbers, source, text, user, template, timing, and Close-uploaded attachments with supported MIME types. Optional second argument `{ account }` selects a named Close binding.

## Output

Returns the created `CloseSms`. Use `source: "External"` when logging a message sent outside Close.
