# Phone and SMS

Source: https://docs.autessa.com/docs/cli/phone

> Find and purchase phone numbers, route inbound calls to an agent or a call flow, set recording and call limits, read call history, decide who answers texts, read and reply to the shared inbox, forward texts, send and read text messages, manage personal phone reminders, and look up SMS consent records.

# Phone and SMS

Three related namespaces: `phone-numbers` wires a real phone number to an agent so people can call or text it, and sends texts from it, `phone-reminders` calls *you* before calendar events, and `sms-consent` is the consent record-keeping behind outbound SMS. The first two are fully scriptable; consent records are web-app-only.

## Phone numbers

Company-scoped. This is how a voice agent gets a number people can dial.

### How to find and purchase a number

```bash
# see what's available
autessa phone-numbers search-numbers --areaCode 206 --limit 10

# buy the one you picked
autessa phone-numbers purchase-number --phoneNumber "+12065550142"
```

`search-numbers` takes an optional `--areaCode`, `--contains` (digits the number should include), and `--limit` (up to 20). Pass `--areaCode` alone to `purchase-number` to take the first available number in that area code, or no arguments to let a US number be selected automatically. Numbers are free to get and use for calls — no card is needed — and the response carries the `configId` you need for routing. Texting is off until you turn it on for the number, which starts a monthly texting fee; see [Turning on texting](/docs/guide/agentic/sms-setup.md#turning-on-texting-for-a-number).

Until you set up routing, a new number still takes messages: callers go to voicemail and texts are saved to the inbox. See [Numbers with nothing set up](/docs/guide/agentic/phone-numbers.md#numbers-with-nothing-set-up).

> Releasing a number is **not** available from the CLI — it is done from phone number settings in the web app. Purchase deliberately, since you cannot undo it from here.

### How to route calls to an agent

```bash
autessa phone-numbers configs-list
autessa phone-numbers config-get --configId <id>
```

`configure-routing` decides what happens when the number rings:

```bash
# straight through to one agent
autessa phone-numbers configure-routing \
  --configId <id> \
  --routingType DIRECT \
  --directResourceType AGENT \
  --directResourceId K2UYSwk3Yy4i
```

| Routing type | Behavior |
| --- | --- |
| `DIRECT` | Every call goes straight to one resource — set `directResourceType` (`AGENT` or `MANAGER`) and `directResourceId` |
| `PRESS_DIGIT` | Callers hear a menu and press a digit to reach different resources — configured via `routingConfig` |

`--locallyHostedStt` controls whether calls on the number use locally-hosted speech-to-text.

> The target agent or [manager](/docs/cli/managers.md) must be **published**. Routing to a draft leaves callers hitting a resource that will not run.

### How to set up a call flow

A call flow decides who answers: AI agents, people, a keypad menu, voicemail, or a mix, with business hours. See [Who answers](/docs/guide/agentic/phone-numbers.md#who-answers) for what each destination does.

```bash
# ring the front desk on weekdays, voicemail when nobody answers or when closed
autessa phone-numbers update-call-flow --configId <id> --callFlow '{
  "greeting": "Thanks for calling Acme Dental.",
  "businessHours": {
    "timezone": "America/Los_Angeles",
    "weekly": [
      { "day": "MONDAY", "open": "09:00", "close": "17:00" },
      { "day": "TUESDAY", "open": "09:00", "close": "17:00" },
      { "day": "WEDNESDAY", "open": "09:00", "close": "17:00" },
      { "day": "THURSDAY", "open": "09:00", "close": "17:00" },
      { "day": "FRIDAY", "open": "09:00", "close": "17:00" }
    ],
    "closedDestination": { "type": "VOICEMAIL", "voicemail": { "greeting": "We are closed. Please leave a message." } }
  },
  "destination": {
    "type": "RING",
    "ring": {
      "targets": [
        { "to": "+14155550100", "label": "Front desk", "ringSeconds": 25 },
        { "to": "client:<identity>", "label": "Dana (browser)" }
      ],
      "strategy": "SIMULTANEOUS",
      "ringSeconds": 20,
      "requireKeyPress": true,
      "whisper": "Call from the main line.",
      "noAnswer": { "type": "VOICEMAIL", "voicemail": { "finishOnKey": "#", "silenceSeconds": 5 } }
    }
  }
}'

# go back to sending every call straight to the agent set with configure-routing
autessa phone-numbers update-call-flow --configId <id> --callFlow null
```

A destination's `type` is `AI_AGENT`, `AI_MULTI_AGENT` (both take `resourceId`), `RING`, `MENU`, `VOICEMAIL`, or `HANG_UP`, and any destination can have a `message` (or a recorded `messageAudio`) played first. A `MENU` takes `prompt`, `promptAudio`, `options` (a map of digit to destination), `timeoutSeconds`, `invalidMessage`, `noInputMessage`, `retries`, and `noInput`. A `VOICEMAIL` takes `greeting`, `greetingAudio`, `maxSeconds`, `finishOnKey`, `silenceSeconds`, and `transcribe`. Each ring target is `{ "to": ..., "label": ..., "ringSeconds": ... }`, where `to` is a phone number in E.164 format or `client:<identity>` for a teammate's browser phone (the web app's call flow editor lets you pick teammates instead of typing identities). A ring also takes `requireKeyPress`, `whisper`, `callerId` (`BUSINESS_NUMBER` or `CALLER`), `waitAudio`, and `maxTotalSeconds`. Add `closedDates` (for example `[{ "date": "2026-12-25", "name": "Christmas" }]`) to `businessHours` for holidays. Every field is described in the [call flow object](/docs/api/poweruser/phone-numbers.md#the-call-flow-object) reference, and what each one does for callers is in [Who answers](/docs/guide/agentic/phone-numbers.md#who-answers). A flow that doesn't make sense, such as a bad time or an agent you can't use, is rejected with a plain-language message.

### How to use your own recordings

Audio fields (`greetingAudio`, `messageAudio`, `promptAudio`, a voicemail's `greetingAudio`, and a ring's `waitAudio`) take an `https://` link to a file you host, or a file you upload in three steps:

```bash
# 1. get an upload link for an MP3 (or "wav")
autessa phone-numbers audio-upload-link --configId <id> --fileType mp3

# 2. upload the file with the exact contentType from step 1
curl "<uploadUrl>" -X PUT -H "Content-Type: audio/mpeg" --data-binary @greeting.mp3

# 3. save the audioUri from step 1 into the call flow, for example as greetingAudio
autessa phone-numbers update-call-flow --configId <id> --callFlow '{ "greetingAudio": "<audioUri>", "destination": { "type": "AI_AGENT", "resourceId": "<agent id>" } }'
```

The upload must use the `Content-Type` that step 1 returned, or it's refused. Upload before the link expires (`expiresInSeconds`). `update-call-flow` replaces the whole flow, so send your full flow with the new audio field in it. When an audio field is set, it plays instead of the matching text, and `config-get` returns a playable link for each uploaded file in `audioPreviewUrls`.

### How to set recording, transcripts, and limits

```bash
autessa phone-numbers update-call-settings --configId <id> --callSettings '{
  "speech": { "language": "en-US", "noiseSuppression": true },
  "transcript": { "save": true, "retentionDays": 365 },
  "recording": { "save": true, "announcement": "This call may be recorded.", "retentionDays": 90 },
  "redaction": { "enabled": true, "audioRedaction": "TONE" },
  "limits": { "maxDurationMinutes": 30, "maxDurationWarningSeconds": 60, "silenceTimeoutSeconds": 20, "silencePromptRepeats": 2 },
  "callerInfo": { "lookupCallerName": true },
  "screening": { "blockedNumbers": ["+15555550123"], "rejectAnonymous": true },
  "ai": { "interruptionSensitivity": "LOW", "endOfTurn": "PATIENT", "hangUpPhrases": ["Have a great day"] },
  "answeringMachine": { "detection": "WAIT_FOR_BEEP", "timeoutSeconds": 30 }
}'
```

The settings apply to every call on the number, incoming and outgoing. Sections you leave out use their defaults.

- `speech` sets the voice (`voiceModel`, `voiceName`) and `language` for everything the number says. `autessa phone-numbers voice-options` lists the languages and voices you can use. `speech.vocabulary` adds words to listen for and corrections for this number only, on top of the company's [speech vocabulary](/docs/cli/company.md#speech-vocabulary), for example `{"terms": ["Dr. Okonkwo"], "replacements": {"doctor okon co": "Dr. Okonkwo"}}` (up to 200 of each). `speech.noiseSuppression: true` turns on **Reduce background noise** for AI calls on the number (default `false`).
- `retentionDays` under `transcript` or `recording` deletes those from each call that many days after it.
- `redaction` turns on Call Redaction, which removes personal info from recordings and transcripts and costs $0.010 per audio minute, or $0.015 with health and national ID types; leave out `redact` to remove every kind it supports, or list some of `CARD_NUMBER`, `CARD_EXPIRY`, `CARD_CVV`, `SSN`, `BANK_ACCOUNT`, `ACCOUNT_NUMBER`, `DATE_OF_BIRTH`, `PHONE`, `EMAIL`, `ADDRESS`.
- `screening` blocks numbers and anonymous callers; add `blockedMessage` to say something before hanging up instead of giving a busy signal.
- `ai` tunes AI calls: `interruptions`, `interruptionSensitivity` (`LOW`, `MEDIUM`, `HIGH`), `endOfTurn` (`FAST`, `NORMAL`, `PATIENT`), `hangUpPhrases`, and `passKeypresses` (`true` lets callers type numbers on the keypad any time; it's the keypad mode for agents that don't set their own). An agent's own `listening` settings win over the number's; see [Agent listening and keypad settings](/docs/guide/agentic/phone-numbers.md#agent-listening-and-keypad-settings).
- `answeringMachine` sets detection on outgoing calls: `OFF`, `ON`, or `WAIT_FOR_BEEP`.

See [Settings at a glance](/docs/guide/agentic/phone-numbers.md#settings-at-a-glance) for what each setting does, and the [call settings object](/docs/api/poweruser/phone-numbers.md#the-call-settings-object) for every field and range.

### How to read call history

```bash
autessa phone-numbers calls-list --configId <id> --limit 25
```

Returns the number's calls newest first, from your company's [Phone calls table](/docs/guide/agentic/phone-numbers.md#the-phone-calls-table): direction, the other number, caller info, status, length, who handled it, the transcript, and short-lived links to the recording and voicemail. `--limit` is up to 50 (default 10); pass the previous page's `next` as `--after` to continue. `tableId` in the response is the Phone calls table itself, which you can query with the [AutessaDB commands](/docs/cli/autessadb.md).

### How to turn on quick automations

```bash
# text back callers you missed (the number must be able to text)
autessa phone-numbers set-automation --configId <id> \
  --automation TEXT_BACK_MISSED_CALLS --enabled true \
  --smsMessage "Sorry we missed your call. We'll call you back shortly."

# email new voicemails to up to 5 people
autessa phone-numbers set-automation --configId <id> \
  --automation EMAIL_VOICEMAILS --enabled true \
  --emails '["frontdesk@example.com"]'
```

Each automation is a regular trigger on the Phone calls table. `--enabled false` turns it off without deleting it. See [Quick automations](/docs/guide/agentic/phone-numbers.md#quick-automations).

> `update-call-flow`, `update-call-settings`, `calls-list`, `set-automation`, `audio-upload-link`, and `voice-options` ship with the phone call controls release. If `autessa phone-numbers --help` doesn't list them yet, run `autessa login` again to refresh your command list.

### How to send a text

```bash
autessa phone-numbers sms-send \
  --configId <id> \
  --to "+14155550100" \
  --body "Hi Sam, your order has shipped. Reply STOP to opt out."
```

The text reaches a real person, so it's checked first: your company needs a finished [Text Messaging registration](/docs/guide/agentic/sms-setup.md) (or the number comes from your own connected Twilio account), and the recipient needs an approved [consent record](/docs/guide/agentic/sms-consent.md) or a text to you within the last year. People who replied STOP are never texted. When a text is refused, `success` is `false`, `errorCode` says why, and `errorMessage` explains what to do — the codes are listed under the [Send SMS tool](/docs/tools/phone-sms.md#send-sms-).

### How to read text history

```bash
autessa phone-numbers sms-messages-list --configId <id> --pageSize 25
```

Returns the number's texts newest first — incoming texts, replies, and sends that were refused, with the reason. Pass the previous page's `nextCursor` as `--cursor` to continue. Company owners can omit `--configId` to list every number.

### How to decide who answers texts

```bash
# your team answers texts from the inbox, with an auto-reply and a keyword reply;
# an AI agent answers outside the call flow's business hours
autessa phone-numbers update-text-flow --configId <id> --textFlow '{
  "keywordReplies": [ { "keyword": "HOURS", "reply": "We are open Monday to Friday, 9 to 5." } ],
  "useCallFlowHours": true,
  "open": {
    "type": "NO_AI",
    "autoReply": { "message": "Thanks for your message. We will text you back shortly.", "onceEveryHours": 24 }
  },
  "closed": { "type": "AI_AGENT", "resourceId": "<agent id>" }
}'

# go back to the default
autessa phone-numbers update-text-flow --configId <id> --textFlow null
```

`open` and `closed` each take `type` (`AI_AGENT` or `NO_AI`), `resourceId` for `AI_AGENT` (leave it out to use the agent the number sends calls to), and `autoReply` for `NO_AI`. `onceEveryHours` sends the auto-reply to the same person at most once in that many hours (default 24, 0 for every text, up to 720). Give texts their own hours with `businessHours` (the same shape as a call flow's), or set `useCallFlowHours` to share the call flow's. Leave out `closed` to handle texts the same way at all hours. STOP, START, and HELP are always handled first and can't be changed.

By default, with no text flow, texts are answered by the agent the number sends calls to directly; if calls don't go straight to one agent, texts get no reply and wait in the inbox. Every field is in the [text flow object](/docs/api/poweruser/phone-numbers.md#the-text-flow-object) reference, and what each setting does is in [Texts](/docs/guide/agentic/phone-numbers.md#texts).

### How to read and reply to the inbox

```bash
# threads, most recent first
autessa phone-numbers sms-threads-list --configId <id> --limit 20

# one conversation, newest first
autessa phone-numbers sms-thread-get --configId <id> --otherNumber "+14155550100" --limit 50

# reply as the business number
autessa phone-numbers sms-send --configId <id> --to "+14155550100" --body "Yes, 10 to 2 on Saturdays."
```

`sms-threads-list` takes `--limit` up to 50 (default 20); pass the previous page's `next` as `--after`. `sms-thread-get` takes `--limit` up to 200 (default 50); pass `next` as `--before` for older messages. Each message's `handledBy` says who answered it: the agent's name, `Auto-reply`, `Keyword reply`, `Staff:` and a teammate's name, or `Automation`. Replies sent with `sms-send` show up as `Staff:` and your name, and are checked like any text (see [How to send a text](#how-to-send-a-text)).

### How to forward texts

```bash
# send every incoming text on to up to 5 phones
autessa phone-numbers set-automation --configId <id> \
  --automation FORWARD_TEXTS_SMS --enabled true \
  --phones '["+14155550100"]'

# email every incoming text to up to 5 people
autessa phone-numbers set-automation --configId <id> \
  --automation FORWARD_TEXTS_EMAIL --enabled true \
  --emails '["frontdesk@example.com"]'
```

Forwarded texts arrive as "From +14155550199: " followed by the message, sent from the business number, so the number must be able to text and each phone must be allowed to receive texts from it (texting the number once from each phone is enough). Texts from those phones are never forwarded. Both are regular triggers on your company's [Text messages table](/docs/guide/agentic/phone-numbers.md#the-text-messages-table), whose id is `textLogTableId` in `config-get`.

> `update-text-flow`, `sms-threads-list`, `sms-thread-get`, and the `FORWARD_TEXTS_SMS` and `FORWARD_TEXTS_EMAIL` automations ship with the texting-without-AI release. If `autessa phone-numbers --help` doesn't list them yet, run `autessa login` again to refresh your command list.

### How to check your texting registration

```bash
autessa phone-numbers sms-registration-get
```

Read-only: shows where your company's Text Messaging registration stands and what the carriers are waiting on. Submitting or changing the registration is done in the web app, on **Phone & Texting → Texting setup**.

> The texting commands (`search-numbers`, `sms-send`, `sms-messages-list`, `sms-registration-get`) ship with the Text Messaging release. If `autessa phone-numbers --help` doesn't list them yet, run `autessa login` again to refresh your command list.

## Phone reminders

**Personal, not company-scoped.** Autessa scans your connected calendars and calls you before your events. Only the owner can read or change their own setups — there is no sharing model here, and a teammate cannot see yours.

### How to create a setup

```bash
autessa phone-reminders create \
  --displayName "Work meetings" \
  --reminderPhoneNumber "+15551234567" \
  --leadTimeMinutes 10 \
  --quietHoursEnabled true \
  --quietHoursStart "22:00" \
  --quietHoursEnd "07:00" \
  --quietHoursTimezone "America/Los_Angeles" \
  --calendarConnectorIds '["<calendar connector id>"]'
```

Times are `HH:mm` in the setup's own timezone. The calendar connectors come from [Connectors](/docs/cli/connectors.md) — `autessa connectors google-calendar all` or `connectors outlook-calendar all` gives you the ids.

### How to manage one

```bash
autessa phone-reminders list
autessa phone-reminders get --configId <id>

# change settings without touching the calendar set
autessa phone-reminders update-settings --configId <id> --leadTimeMinutes 15 --isEnabled true

# replace which calendars it scans
autessa phone-reminders update-calendars --configId <id> --json '{...}'

# don't wait for the next scheduled scan
autessa phone-reminders scan-now --configId <id>
```

`scan-now` is the web app's "Refresh" action — useful right after you add a calendar and want to confirm events are picked up rather than waiting for the next cycle.

> Resetting a setup — which re-provisions it and **changes the Autessa phone number** that calls you — is web-app-only. `update-settings` and `update-calendars` cover everything else.

## SMS consent

Consent records for your company's phone numbers. Both commands are web-app-only — recording and searching consent happen on the SMS consent page in the browser, because consent capture is a compliance flow that needs a human in it.

```bash
autessa sms-consent create
```

```
SMS consent records are created from your company's SMS consent page in the web app.
```

The commands remain in the help tree so discovery tells you the capability exists and where it lives. See [SMS consent](/docs/guide/agentic/sms-consent.md).

## Related

- [Agents](/docs/cli/agents.md) — the agent a number routes to
- [Connectors](/docs/cli/connectors.md) — the calendars reminders scan
- [Phone numbers](/docs/guide/agentic/phone-numbers.md) in the builder
- [Meeting reminders](/docs/guide/platform/meeting-reminders.md)
- [Text Messaging setup](/docs/guide/agentic/sms-setup.md)
- [Phone and SMS tool types](/docs/tools/phone-sms.md)

