Phone Numbers
Find and purchase phone numbers, wire inbound calls to your agents, tools, or managers — directly, through a press-a-digit menu, or through a call flow that can also ring people, follow business hours, and take voicemail — set recording, transcripts, and call limits, read call history, decide who answers texts, send and read text messages, and release numbers you no longer need.
All paths on this page are relative to https://api.autessa.com/autessa_poweruser/twilio. Every request is a POST with a JSON body, and every ID is an opaque string. See the Poweruser API overview for authentication and conventions.
The typical flow is two calls: /purchase-number buys a
number and returns a configId, then /configure-routing
points that number at a resource. Use /search-numbers
first if you want to pick the number yourself. A number routes one of three ways:
DIRECT— every inbound call goes straight to one resource (directResourceType+directResourceId).PRESS_DIGIT— callers hear a menu and are routed by the digit they press, usingroutingConfig.digitToResourceMap. These numbers now run as a keypad-menu call flow.FLOW— a call flow decides who answers: AI agents, people, a keypad menu, voicemail, or a mix, with business hours. Set it with/update-call-flow.
Separately, /update-call-settings controls
voice and language, recording, transcripts, Call Redaction, call limits,
caller-name lookup, blocked callers, AI call behavior, and answering
machine detection for every call on the number, and
/get-calls reads its call history.
/audio-upload-link uploads your own
recordings for greetings and menus, and
/voice-options lists the voices and languages you
can pick.
For texts, /update-text-flow decides who answers
them (an AI agent or your team, with business hours, auto-replies, and
keyword replies), /sms/threads and
/sms/thread read the shared inbox, and
/sms/send replies.
A number with nothing set up yet still takes messages: callers go to voicemail, and texts are saved to the shared inbox. See Numbers with nothing set up.
The phone config object
- Name
configId- Type
- string
- Description
Unique phone configuration identifier.
- Name
phoneNumber- Type
- string
- Description
The purchased number in E.164 format (for example
+12065550142).
- Name
twilioPhoneSid- Type
- string
- Description
The carrier's identifier for the number.
- Name
routingType- Type
- string
- Description
DIRECT,PRESS_DIGIT, orFLOW.
- Name
directResourceType- Type
- string
- Description
DIRECTrouting — the resource kind answering calls:AGENT,TOOL, orMANAGER.
- Name
directResourceId- Type
- string
- Description
DIRECTrouting — the resource answering calls.
- Name
directRoutingConfig- Type
- object
- Description
DIRECTrouting — call settings:environmentVariables,promptTemplateVariables,locallyHostedStt(defaulttrue),initialMessage,initialMessagePrompt,conferenceParticipants,clientDisplayMessage.
- Name
routingConfig- Type
- object
- Description
PRESS_DIGITrouting —digitToResourceMap(map of digit to a routing target withtype,id,environmentVariables,promptTemplateVariables) andlocallyHostedStt.
- Name
callFlow- Type
- CallFlow | null
- Description
FLOWrouting — the call flow;nullotherwise.
- Name
callSettings- Type
- CallSettings
- Description
The number's call settings. Always present; an empty object means every setting is at its default.
- Name
callLogTableId- Type
- string | null
- Description
Your company's Phone calls AutessaDB table, or
nulluntil the first call creates it. The same table is shared by all your numbers.
- Name
textFlow- Type
- TextFlow | null
- Description
How texts to the number are handled; see
/update-text-flow.nullmeans the default.
- Name
textLogTableId- Type
- string | null
- Description
Your company's Text messages AutessaDB table, or
nulluntil the first text creates it. The same table is shared by all your numbers.
- Name
automations- Type
- object
- Description
The number's quick automations:
textBackMissedCalls(enabled,smsMessage,triggerId,toolId),emailVoicemails(enabled,emails,triggerId,toolId),textForwardSms(enabled,phones,triggerId,toolId), andtextForwardEmail(enabled,emails,triggerId,toolId). The ids point at the trigger and tool behind each one, or arenullif it was never turned on.
- Name
audioPreviewUrls- Type
- object
- Description
A map from each uploaded audio file the number uses (an
s3://value from/audio-upload-link) to a short-livedhttps://link you can play it from. Audio fields themselves come back exactly as you saved them.
- Name
sharingLevel- Type
- string
- Description
PRIVATE,SPECIFIC_MEMBER, orCOMPANY.
- Name
companyPermissionLevel- Type
- string
- Description
Access level granted company-wide when shared with the company:
READ,WRITE,PUBLISH, orADMIN.
- Name
isActive- Type
- boolean
- Description
Whether the number is live. Released numbers become inactive.
- Name
createdAt- Type
- string
- Description
ISO-8601 creation timestamp.
- Name
updatedAt- Type
- string
- Description
ISO-8601 timestamp of the last update.
{
"configId": "pH9nR3vC6b",
"phoneNumber": "+12065550142",
"twilioPhoneSid": "PNa1b2c3d4e5f60718293a4b5c6d7e8f90",
"routingType": "DIRECT",
"directResourceType": "AGENT",
"directResourceId": "V1StGXR8Z5",
"directRoutingConfig": {
"environmentVariables": {},
"promptTemplateVariables": { "companyName": "Acme Corp" },
"locallyHostedStt": true,
"initialMessage": "Thanks for calling Acme, how can I help?",
"initialMessagePrompt": null,
"conferenceParticipants": [],
"clientDisplayMessage": null
},
"routingConfig": null,
"callFlow": null,
"callSettings": {
"transcript": { "save": true },
"recording": { "save": true, "announcement": "This call may be recorded." }
},
"callLogTableId": "tB7xQ2mL9k",
"textFlow": null,
"textLogTableId": "tM3wK8pR5j",
"automations": {
"textBackMissedCalls": { "enabled": false, "smsMessage": null, "triggerId": null, "toolId": null },
"emailVoicemails": { "enabled": true, "emails": ["frontdesk@example.com"], "triggerId": "tR4kP8nW2q", "toolId": "tL6vH3cJ9d" },
"textForwardSms": { "enabled": false, "phones": [], "triggerId": null, "toolId": null },
"textForwardEmail": { "enabled": false, "emails": [], "triggerId": null, "toolId": null }
},
"sharingLevel": "COMPANY",
"companyPermissionLevel": "READ",
"isActive": true,
"createdAt": "2026-06-01T14:22:05",
"updatedAt": "2026-06-28T17:42:10"
}
Search available numbers
/twilio/search-numbersLists US numbers available to buy. Nothing is
reserved — pass the number you pick to
/purchase-number as phoneNumber.
Request parameters
- Name
areaCode- Type
- string
- Description
Three-digit US area code.
- Name
contains- Type
- string
- Description
Digits the number should contain, for example
"555".
- Name
limit- Type
- integer
- Description
How many numbers to return, 1–20 (default 10).
Response
- Name
numbers- Type
- array<object>
- Description
Available numbers:
phoneNumber(E.164),locality,region, andcapabilities(sms,voice,mms).
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
curl https://api.autessa.com/autessa_poweruser/twilio/search-numbers \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "areaCode": "206", "limit": 5 }'
{
"numbers": [
{
"phoneNumber": "+12065550142",
"locality": "Seattle",
"region": "WA",
"capabilities": { "sms": true, "voice": true, "mms": true }
}
],
"errors": []
}
Purchase a phone number
/twilio/purchase-numberGets a new US phone number. Numbers are free for calls, and no card is
needed. Pick an exact number from
/search-numbers, give just an area code, or send
{} to let the platform choose. The number takes calls immediately. It starts
without routing; configure it with /configure-routing.
Texting is off until you turn it on with
/sms/attach-number.
Request parameters
- Name
phoneNumber- Type
- string
- Description
The exact number to buy, in E.164 format, from
/search-numbers.
- Name
areaCode- Type
- string
- Description
Buy the first available number in this area code.
- Name
idempotencyKey- Type
- string
- Description
Your own key (up to 64 characters). Retrying with the same key never buys twice.
- Name
attachToSms- Type
- boolean
- Description
Also turn on texting for the number, exactly as
/sms/attach-numberdoes — including its monthly texting fee and card requirement.
Response
- Name
success- Type
- boolean
- Description
Whether the purchase succeeded.
- Name
configId- Type
- string
- Description
The new phone configuration — pass this to every other endpoint on this page.
- Name
phoneNumber- Type
- string
- Description
The purchased number in E.164 format.
- Name
twilioPhoneSid- Type
- string
- Description
The carrier's identifier for the number.
- Name
message- Type
- string
- Description
Human-readable result.
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
- cURL
- JavaScript
- Python
curl https://api.autessa.com/autessa_poweruser/twilio/purchase-number \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch(
'https://api.autessa.com/autessa_poweruser/twilio/purchase-number',
{
method: 'POST',
headers: {
'Authorization': process.env.POWERUSER_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({})
}
);
const { configId, phoneNumber } = await response.json();
import os
import requests
response = requests.post(
'https://api.autessa.com/autessa_poweruser/twilio/purchase-number',
headers={'Authorization': os.environ['POWERUSER_KEY']},
json={}
)
data = response.json()
config_id = data['configId']
{
"success": true,
"configId": "pH9nR3vC6b",
"phoneNumber": "+12065550142",
"twilioPhoneSid": "PNa1b2c3d4e5f60718293a4b5c6d7e8f90",
"message": "Phone number purchased successfully",
"errors": []
}
Configure routing
/twilio/configure-routingSets how inbound calls to a number are handled. For DIRECT routing, supply
directResourceType and directResourceId; for PRESS_DIGIT, supply
routingConfig with a digitToResourceMap.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to update.
- Name
routingType- Type
- string
- Description
DIRECTorPRESS_DIGIT.
- Name
directResourceType- Type
- string
- Description
DIRECT—AGENT,TOOL, orMANAGER.
- Name
directResourceId- Type
- string
- Description
DIRECT— the resource that answers calls.
- Name
routingConfig- Type
- object
- Description
PRESS_DIGIT—digitToResourceMap: map of digit ("1","2", …) to a target{ type, id, environmentVariables, promptTemplateVariables }, pluslocallyHostedStt.
- Name
locallyHostedStt- Type
- boolean
- Description
Use Autessa-hosted speech-to-text (default
true).
- Name
promptTemplateVariables- Type
- object
- Description
Values for the resource's
@@{variable}@@prompt template placeholders.
- Name
environmentVariables- Type
- object
- Description
Environment variables passed to tool executions triggered by the call.
- Name
initialMessage- Type
- string
- Description
Static greeting spoken when an inbound call connects.
- Name
initialMessagePrompt- Type
- string
- Description
Prompt sent to the LLM to generate a dynamic greeting when the call connects. Supports
@@{variableName}@@placeholders. Takes the place ofinitialMessagewhen provided.
- Name
conferenceParticipants- Type
- array<string>
- Description
Additional phone numbers dialed into the conference when an inbound call starts; each participant joins on answer.
- Name
clientDisplayMessage- Type
- string
- Description
Message shown to browser-client conference participants when they receive the call.
Response
- Name
success- Type
- boolean
- Description
Whether the routing was applied.
- Name
message- Type
- string
- Description
Human-readable result.
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
- cURL
- JavaScript
- Python
curl https://api.autessa.com/autessa_poweruser/twilio/configure-routing \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{
"configId": "pH9nR3vC6b",
"routingType": "DIRECT",
"directResourceType": "AGENT",
"directResourceId": "V1StGXR8Z5",
"initialMessage": "Thanks for calling Acme, how can I help?",
"promptTemplateVariables": { "companyName": "Acme Corp" }
}'
// PRESS_DIGIT menu: 1 → support agent, 2 → sales agent
await fetch(
'https://api.autessa.com/autessa_poweruser/twilio/configure-routing',
{
method: 'POST',
headers: {
'Authorization': process.env.POWERUSER_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
configId: 'pH9nR3vC6b',
routingType: 'PRESS_DIGIT',
routingConfig: {
digitToResourceMap: {
'1': { type: 'AGENT', id: 'V1StGXR8Z5' },
'2': { type: 'AGENT', id: 'kZ3mQ9pW2x' }
},
locallyHostedStt: true
}
})
}
);
import os
import requests
requests.post(
'https://api.autessa.com/autessa_poweruser/twilio/configure-routing',
headers={'Authorization': os.environ['POWERUSER_KEY']},
json={
'configId': 'pH9nR3vC6b',
'routingType': 'DIRECT',
'directResourceType': 'AGENT',
'directResourceId': 'V1StGXR8Z5',
'initialMessage': 'Thanks for calling Acme, how can I help?'
}
)
{
"success": true,
"message": "Routing configured successfully",
"errors": []
}
Update the call flow
/twilio/update-call-flowSets who answers the number: AI agents, people, a keypad menu, voicemail,
or a mix, optionally with business hours. Setting a flow changes
routingType to FLOW. Passing callFlow: null changes it back to
DIRECT, and calls go to the number's direct resource again, which is kept
while a flow is set. See Who answers
for how each destination behaves.
The flow is checked before it's saved. Phone numbers must be in E.164
format, menu keys must be 0–9, *, or #, times must be HH:mm, the
time zone must be a valid name such as America/New_York, and you must be
able to use every agent and multi-agent it names. A flow that fails a check
returns 400 with a plain-language message.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to update.
- Name
callFlow- Type
- CallFlow | null
- Description
The flow, or
nullto go back toDIRECTrouting.
The call flow object
- Name
greeting- Type
- string
- Description
Spoken to every caller first.
- Name
greetingAudio- Type
- string
- Description
A recording to play instead of
greeting: anhttps://link, or anaudioUrifrom/audio-upload-link.
- Name
businessHours- Type
- object
- Description
Optional.
timezone(for exampleAmerica/Los_Angeles),weekly(a list of{ day, open, close }withdayfromMONDAYtoSUNDAYand times asHH:mm),closedDates, andclosedDestination(a destination for calls outside those hours). Days not listed are closed all day.closedDateslists holidays and other days you're closed all day, each as{ date, endDate, name }with dates asYYYY-MM-DD.endDateis optional and makes an inclusive range, andname(such as"Thanksgiving") is just a label. A closed date wins overweekly, so every call that day goes toclosedDestination.
- Name
destination- Type
- CallDestination
- Description
Where calls go (during business hours, if set).
The destination object
- Name
type- Type
- string
- Description
AI_AGENT,AI_MULTI_AGENT,RING,MENU,VOICEMAIL, orHANG_UP.
- Name
message- Type
- string
- Description
Spoken before the destination runs, for example "Our office is closed today."
- Name
messageAudio- Type
- string
- Description
A recording to play instead of
message: anhttps://link, or anaudioUrifrom/audio-upload-link.
- Name
resourceId- Type
- string
- Description
AI_AGENT/AI_MULTI_AGENT— the agent or multi-agent that answers. It uses the AI call settings set with/configure-routing.
- Name
ring- Type
- object
- Description
RING— rings people. See the ring object.
- Name
menu- Type
- object
- Description
MENU—prompt(the options read to the caller),promptAudio(a recording to play instead),options(a map of key to destination, for example{ "1": {...}, "2": {...} }),timeoutSeconds(how long to wait for a key after the prompt,2to30, default6),invalidMessage(spoken when the caller presses a key that isn't an option),noInputMessage(spoken when they press nothing in time),retries(how many times to repeat the prompt), andnoInput(a destination for when the caller never presses a valid key).
- Name
voicemail- Type
- object
- Description
VOICEMAIL—greeting(played before the beep),greetingAudio(a recording to play instead),maxSeconds(longest message, default120),finishOnKey(the key that ends the message, default#;""for none),silenceSeconds(seconds of silence that end the message,1to30, default5), andtranscribe(defaulttrue).
The ring object
- Name
targets- Type
- array<object>
- Description
Who to ring. Each target is
{ to, label, ringSeconds }:tois a phone number in E.164 format orclient:<identity>for a teammate's browser phone,labelis an optional name such as"Front desk", andringSecondsoverrides the ring time for that target.
- Name
strategy- Type
- string
- Description
SIMULTANEOUSrings everyone at once and the first to answer gets the call;SEQUENTIALrings one at a time, in order.
- Name
ringSeconds- Type
- integer
- Description
How long each target rings when it has no
ringSecondsof its own (default20).
- Name
requireKeyPress- Type
- boolean
- Description
The person who answers must press 1 to accept the call (default
false). Turn it on for cell phones, so a personal voicemail that picks up can't take the caller; the call moves on as if nobody answered.
- Name
whisper- Type
- string
- Description
Spoken only to the person who answers, before they're connected, for example "Call from the sales line."
- Name
callerId- Type
- string
- Description
What the rung phone shows:
BUSINESS_NUMBER(default) orCALLER. If the carrier won't show the caller's number, the business number is shown.
- Name
waitAudio- Type
- string
- Description
Played on a loop to the caller while phones ring, instead of a ringing tone: an
https://link, or anaudioUrifrom/audio-upload-link.
- Name
maxTotalSeconds- Type
- integer
- Description
SEQUENTIALonly. Stop ringing after this many seconds in total, even if some targets haven't rung yet.
- Name
noAnswer- Type
- CallDestination
- Description
Where the call goes when nobody answers. If it's not set, the caller goes to voicemail.
Response
The updated phone config object.
- cURL
- JavaScript
curl https://api.autessa.com/autessa_poweruser/twilio/update-call-flow \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{
"configId": "pH9nR3vC6b",
"callFlow": {
"greeting": "Thanks for calling Acme.",
"businessHours": {
"timezone": "America/New_York",
"weekly": [
{ "day": "MONDAY", "open": "09:00", "close": "17:00" },
{ "day": "FRIDAY", "open": "09:00", "close": "15:00" }
],
"closedDates": [
{ "date": "2026-11-26", "endDate": "2026-11-27", "name": "Thanksgiving" }
],
"closedDestination": { "type": "AI_AGENT", "resourceId": "V1StGXR8Z5" }
},
"destination": {
"type": "MENU",
"menu": {
"prompt": "Press 1 for sales or 2 for support.",
"timeoutSeconds": 8,
"invalidMessage": "Sorry, that is not an option.",
"retries": 2,
"options": {
"1": {
"type": "RING",
"ring": {
"targets": [
{ "to": "+14155550100", "label": "Sales desk" },
{ "to": "+14155550101", "label": "Sam cell", "ringSeconds": 25 }
],
"strategy": "SIMULTANEOUS",
"ringSeconds": 20,
"requireKeyPress": true,
"whisper": "Call from the sales line.",
"noAnswer": { "type": "VOICEMAIL" }
}
},
"2": { "type": "AI_AGENT", "resourceId": "kZ3mQ9pW2x" }
},
"noInput": { "type": "VOICEMAIL" }
}
}
}
}'
// back to DIRECT routing
await fetch(
'https://api.autessa.com/autessa_poweruser/twilio/update-call-flow',
{
method: 'POST',
headers: {
'Authorization': process.env.POWERUSER_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({ configId: 'pH9nR3vC6b', callFlow: null })
}
);
Update call settings
/twilio/update-call-settingsSets the number's voice and language, recording, transcripts, Call Redaction, call limits, caller-name lookup, blocked callers, AI call behavior, and answering machine detection. The settings apply to every call on it, incoming and outgoing, whether an agent or a person handles it. A call already in progress keeps the settings it started with. Calls placed with the Make Phone Call tool can override them for one call.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to update.
- Name
callSettings- Type
- CallSettings
- Description
The new settings. Sections you leave out use their defaults.
The call settings object
- Name
speech- Type
- object
- Description
The voice and language for everything the number says (greetings, messages, menus, voicemail greetings, the recording disclosure, the silence prompt, and transfer announcements).
voiceModelandvoiceNamepick a voice, in the same shape as an agent's voice; leave them out to use the answering agent's voice, or a standard voice when no agent is involved.languageis a language code such asen-USores-US; on AI calls it also sets the language speech recognition listens for. See/voice-optionsfor the values you can use.
- Name
transcript- Type
- object
- Description
save— keep a transcript of each call (defaulttrue).retentionDays— delete each call's transcript and voicemail transcript this many days after the call; leave it out to keep them.
- Name
recording- Type
- object
- Description
save— keep each call's audio (defaultfalse).announcement— the disclosure played before the call connects when recording; defaults to "This call may be recorded." and""plays nothing.retentionDays— delete each call's recording and voicemail recording this many days after the call; leave it out to keep them. Recording laws vary, and you're responsible for getting any consent they require.
- Name
redaction- Type
- object
- Description
Call Redaction, which removes personal info from recordings and transcripts before they're saved. Billed at $0.01 per call.
enabled(defaultfalse);redact— what to remove, any ofCARD_NUMBER,CARD_EXPIRY,CARD_CVV,SSN,BANK_ACCOUNT,ACCOUNT_NUMBER,DATE_OF_BIRTH,PHONE,EMAIL,ADDRESS(default: all);audioRedaction— replace removed audio withSILENCEorTONE. It doesn't change the agent's conversation history, which still contains what was said live.
- Name
limits- Type
- object
- Description
maxDurationMinutes— end calls after this long;maxDurationWarning— spoken before that limit;maxDurationWarningSeconds— how long before the limit the warning plays (10to300, default30);silenceTimeoutSeconds— end the call after this much silence;silencePrompt— asked before hanging up on silence (default "Are you still there?");silencePromptRepeats— how many times it's asked before the call ends (0to3, default1;0hangs up without asking).
- Name
callerInfo- Type
- object
- Description
lookupCallerName— look up incoming callers' names from carrier caller-ID records. The carrier charges a small fee per lookup, included in the call's price.
- Name
screening- Type
- object
- Description
Blocks unwanted incoming calls.
blockedNumbers— phone numbers in E.164 format that can't reach this number;rejectAnonymous— also block callers who hide their number (defaultfalse);blockedMessage— spoken to blocked callers before hanging up. LeaveblockedMessageout and blocked calls get a busy signal without being answered.
- Name
ai- Type
- object
- Description
How AI agents handle the conversation.
interruptions— whether the caller can talk over the agent (defaulttrue);interruptionSensitivity—LOW,MEDIUM(default), orHIGH, how easily the caller's voice interrupts;endOfTurn—FAST,NORMAL(default), orPATIENT, how long the agent waits after the caller stops talking;hangUpPhrases— a list of phrases, and when the agent's reply contains one, the call ends after the reply plays.
- Name
answeringMachine- Type
- object
- Description
Outgoing calls.
detection—OFF,ON(tell people and answering machines apart), orWAIT_FOR_BEEP(also wait for the machine's beep before leaving a voicemail message);timeoutSeconds— how long to listen before deciding (2to60). Leave the section out and detection turns on by itself for calls that leave a voicemail message or generate their opening line.
- Name
callLogTableId- Type
- string
- Description
Read-only. Your company's Phone calls table; ignored if sent.
Response
The updated phone config object.
curl https://api.autessa.com/autessa_poweruser/twilio/update-call-settings \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{
"configId": "pH9nR3vC6b",
"callSettings": {
"speech": { "language": "en-US" },
"transcript": { "save": true, "retentionDays": 365 },
"recording": { "save": true, "announcement": "This call may be recorded for quality.", "retentionDays": 90 },
"redaction": {
"enabled": true,
"redact": ["CARD_NUMBER", "CARD_EXPIRY", "CARD_CVV", "SSN"],
"audioRedaction": "TONE"
},
"limits": {
"maxDurationMinutes": 30,
"maxDurationWarning": "We need to wrap up in a minute.",
"maxDurationWarningSeconds": 60,
"silenceTimeoutSeconds": 20,
"silencePromptRepeats": 2
},
"callerInfo": { "lookupCallerName": true },
"screening": { "blockedNumbers": ["+15555550123"], "rejectAnonymous": true },
"ai": {
"interruptionSensitivity": "LOW",
"endOfTurn": "PATIENT",
"hangUpPhrases": ["Have a great day"]
}
}
}'
Update the text flow
/twilio/update-text-flowSets how texts to the number are handled: by an AI agent or with no AI, optionally with business hours, auto-replies, and keyword replies. Texts follow this setting whatever the number's call routing is. See Texts for what each setting does.
Passing textFlow: null goes back to the default: if the number sends
calls straight to one AI agent, that agent answers texts; otherwise texts
get no reply and are saved to the
shared inbox and the
Text messages table.
STOP, START, and HELP are always handled first for compliance, before keyword replies or anything else, and can't be changed here.
The flow is checked before it's saved, the same way as a
call flow: times must be HH:mm, the time zone
must be a valid name, and you must be able to use any agent it names. A
flow that fails a check returns 400 with a plain-language message.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to update.
- Name
textFlow- Type
- TextFlow | null
- Description
The text flow, or
nullfor the default.
The text flow object
- Name
keywordReplies- Type
- array<object>
- Description
Fixed replies to specific words, each
{ keyword, reply }. A text matches when the whole message equalskeyword, ignoring capital letters and spaces around it. Checked beforeopenorclosed, at any hour and whoever answers. A matching text getsreplyand goes no further.
- Name
businessHours- Type
- object | null
- Description
Hours just for texts:
timezone,weekly, and optionalclosedDates, in the same shape as a call flow'sbusinessHours, withoutclosedDestination(useclosedinstead). Leave out for no hours.
- Name
useCallFlowHours- Type
- boolean
- Description
trueuses the business hours of the number's call flow instead ofbusinessHours, so the two always match.
- Name
open- Type
- TextHandling
- Description
How texts are handled during business hours, or at all times when there are no hours.
- Name
closed- Type
- TextHandling
- Description
How texts are handled outside business hours. Leave out to handle them the same as
open.
The text handling object
- Name
type- Type
- string
- Description
AI_AGENT(an agent answers) orNO_AI(texts wait in the shared inbox for your team).
- Name
resourceId- Type
- string
- Description
AI_AGENT— the agent that answers. Leave out to use the agent the number sends calls to directly.
- Name
autoReply- Type
- object
- Description
NO_AIonly — an automatic reply:message(the text to send) andonceEveryHours(send it to the same person at most once in this many hours; default24,0replies to every text, at most720).
Response
- Name
config- Type
- object
- Description
The updated phone config object, with the new
textFlow.
- Name
permission- Type
- string
- Description
Your permission level on the number.
curl https://api.autessa.com/autessa_poweruser/twilio/update-text-flow \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{
"configId": "pH9nR3vC6b",
"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": "V1StGXR8Z5" }
}
}'
List calls
/twilio/get-callsReturns the number's calls, newest first, from your company's Phone calls table. Incoming and outgoing calls are both included, with or without AI.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration whose calls to list.
- Name
limit- Type
- integer
- Description
Calls per page, up to
50(default10).
- Name
after- Type
- string
- Description
The
nextvalue from the previous page.
Response
- Name
tableId- Type
- string | null
- Description
The Phone calls AutessaDB table, or
nullif no call has been logged yet. You can query it with the AutessaDB API.
- Name
calls- Type
- array<object>
- Description
The calls on this page. Each has
rowId(its row in the table),callId,direction(INBOUNDorOUTBOUND),businessNumber,otherNumber,callerName,callerLocation,forwardedFrom,handledBy,conversationId(the agent conversation, for AI calls),startedAtandendedAt(UTC, ISO-8601),durationSeconds,status,answeredBy,endedBy,transferredTo,keypadResponse,transcript,recordingUrl,voicemailRecordingUrl,voicemailTranscript,redactionStatus, andprocessingError. The recording links are valid for 10 minutes. See the guide for the values of each column.
- Name
next- Type
- string | null
- Description
Pass as
afterto get the next page;nullon the last page.
curl https://api.autessa.com/autessa_poweruser/twilio/get-calls \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b", "limit": 1 }'
{
"tableId": "tB7xQ2mL9k",
"calls": [
{
"rowId": "r8KdW2pQ5n",
"callId": "c3Vt9LmX2a",
"direction": "INBOUND",
"businessNumber": "+12065550142",
"otherNumber": "+14155550100",
"callerName": "JANE DOE",
"callerLocation": "San Francisco, CA, US",
"forwardedFrom": null,
"handledBy": "Front desk agent",
"conversationId": "cv5Hn7Rt2w",
"startedAt": "2026-10-09T17:02:11Z",
"endedAt": "2026-10-09T17:05:48Z",
"durationSeconds": 217,
"status": "COMPLETED",
"answeredBy": "HUMAN",
"endedBy": "AGENT",
"transferredTo": null,
"keypadResponse": null,
"transcript": "Agent: Thanks for calling Acme, how can I help?\nCaller: I'd like to move my appointment...",
"recordingUrl": "https://...",
"voicemailRecordingUrl": null,
"voicemailTranscript": null,
"redactionStatus": "DONE",
"processingError": null
}
],
"next": "eyJzIjoiMjAyNi0xMC0wOVQxNzowMjoxMVoifQ"
}
Set an automation
/twilio/set-automationTurns one of the number's quick automations on or off. Each automation is a regular trigger on the Phone calls table (or, for forwarding texts, the Text messages table) that runs a regular tool, so you can see and edit it like any other. Turning one off disables its trigger without deleting it, and turning it back on reuses it.
TEXT_BACK_MISSED_CALLS— texts the caller from this number when an incoming call isn't answered, is busy, or goes to voicemail. The number must be able to text.EMAIL_VOICEMAILS— emails the voicemail transcript and a link to the call when a caller leaves a voicemail.FORWARD_TEXTS_SMS— texts every incoming text on to up to 5 phones, as "From +14155550100: " followed by the message. The forwarded texts are sent from this number, so it must be able to text and the phones must be allowed to receive texts from it (texting the number once from each phone is enough). Texts from those phones are never forwarded.FORWARD_TEXTS_EMAIL— emails every incoming text to up to 5 people.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration.
- Name
automation- Type
- string
- Description
TEXT_BACK_MISSED_CALLS,EMAIL_VOICEMAILS,FORWARD_TEXTS_SMS, orFORWARD_TEXTS_EMAIL.
- Name
enabled- Type
- boolean
- Description
Turn the automation on or off.
- Name
smsMessage- Type
- string
- Description
TEXT_BACK_MISSED_CALLS— the text to send.
- Name
emails- Type
- array<string>
- Description
EMAIL_VOICEMAILSandFORWARD_TEXTS_EMAIL— who gets the email, up to 5 addresses.
- Name
phones- Type
- array<string>
- Description
FORWARD_TEXTS_SMS— the phones to forward texts to, up to 5, in E.164 format.
Response
The updated phone config object, with the
automation's state in automations.
curl https://api.autessa.com/autessa_poweruser/twilio/set-automation \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{
"configId": "pH9nR3vC6b",
"automation": "TEXT_BACK_MISSED_CALLS",
"enabled": true,
"smsMessage": "Sorry we missed your call. We will call you back shortly."
}'
Get an audio upload link
/twilio/audio-upload-linkUploads your own recording, such as a greeting, menu prompt, voicemail greeting, or hold music, for use in a number's call flow. It takes three steps:
- Get a link. Call this endpoint with the number and the file type.
The response has an
uploadUrl, anaudioUri, and acontentType. - Upload the file. Send the audio file's bytes with an HTTP
PUTtouploadUrl, with aContent-Typeheader set to exactly thecontentTypefrom step 1. Any other content type is refused. Upload beforeexpiresInSecondsruns out, or get a new link. - Use it. Save
audioUriinto an audio field with/update-call-flow:greetingAudio,messageAudio, a menu'spromptAudio, a voicemail'sgreetingAudio, or a ring'swaitAudio. Audio fields also accept your ownhttps://links, so this step-by-step upload is only needed for files you don't host.
When an audio field is set, it plays instead of the matching text. The
phone config object returns a playable link for
each uploaded file in audioPreviewUrls.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration the recording is for.
- Name
fileType- Type
- string
- Description
mp3orwav.
Response
- Name
uploadUrl- Type
- string
- Description
Where to
PUTthe file. It expires afterexpiresInSeconds.
- Name
audioUri- Type
- string
- Description
The value to save in an audio field once the upload is done.
- Name
contentType- Type
- string
- Description
The
Content-Typeheader to send with the upload, for exampleaudio/mpeg.
- Name
expiresInSeconds- Type
- integer
- Description
How long
uploadUrlstays valid.
curl https://api.autessa.com/autessa_poweruser/twilio/audio-upload-link \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b", "fileType": "mp3" }'
{
"uploadUrl": "https://...",
"audioUri": "s3://.../greeting.mp3",
"contentType": "audio/mpeg",
"expiresInSeconds": 900
}
curl "$UPLOAD_URL" \
-X PUT \
-H "Content-Type: audio/mpeg" \
--data-binary @greeting.mp3
curl https://api.autessa.com/autessa_poweruser/twilio/update-call-flow \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{
"configId": "pH9nR3vC6b",
"callFlow": {
"greeting": "Thanks for calling Acme.",
"greetingAudio": "s3://.../greeting.mp3",
"destination": { "type": "AI_AGENT", "resourceId": "V1StGXR8Z5" }
}
}'
List voice options
/twilio/voice-optionsLists the languages and voices you can use in a number's speech
call settings. It takes no parameters; send
an empty JSON object.
Response
- Name
languages- Type
- array<object>
- Description
The supported languages, each with
code(the value forspeech.language, such asen-US) andlabel(a readable name such as "English (US)").
- Name
voices- Type
- array<object>
- Description
The voices you can pick, the same list agents offer, including your company's custom voices. Use a voice's model and name as
speech.voiceModelandspeech.voiceName.
curl https://api.autessa.com/autessa_poweruser/twilio/voice-options \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{}'
List all phone configs
/twilio/get-all-configsLists every phone configuration visible to the linked user.
Request parameters
None — send an empty object {}.
Response
- Name
configs- Type
- array<PhoneConfig>
- Description
The phone configurations, each in the phone config object shape.
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
curl https://api.autessa.com/autessa_poweruser/twilio/get-all-configs \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{}'
{
"configs": [
{
"configId": "pH9nR3vC6b",
"phoneNumber": "+12065550142",
"routingType": "DIRECT",
"directResourceType": "AGENT",
"directResourceId": "V1StGXR8Z5",
"sharingLevel": "COMPANY",
"isActive": true,
"createdAt": "2026-06-01T14:22:05"
}
],
"errors": []
}
Get a phone config
/twilio/get-configRetrieves one phone configuration, including its full routing details and the calling user's access level.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to fetch.
Response
- Name
config- Type
- PhoneConfig
- Description
The phone config object.
- Name
permission- Type
- string
- Description
The calling user's access level on this config:
READ,WRITE,PUBLISH, orADMIN.
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
curl https://api.autessa.com/autessa_poweruser/twilio/get-config \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b" }'
{
"config": {
"configId": "pH9nR3vC6b",
"phoneNumber": "+12065550142",
"routingType": "DIRECT",
"directResourceType": "AGENT",
"directResourceId": "V1StGXR8Z5",
"isActive": true
},
"permission": "ADMIN",
"errors": []
}
Release a phone number
/twilio/release-numberReleases the number back to the carrier and deactivates the configuration.
Inbound calls to the number stop working immediately, and the number cannot
be recovered — buy a new one with /purchase-number if
needed. Any monthly texting fee stops from the next month. A hosted number stops being hosted. A number linked from your own
Twilio account is only unlinked — it stays in your Twilio account.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration whose number to release.
Response
- Name
success- Type
- boolean
- Description
Whether the release succeeded.
- Name
message- Type
- string
- Description
Human-readable result.
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
curl https://api.autessa.com/autessa_poweruser/twilio/release-number \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b" }'
{
"success": true,
"message": "Phone number released successfully",
"errors": []
}
Turn on texting for a number
/twilio/sms/attach-numberTurns on texting for a number by adding it to your company's
Text Messaging registration. This starts the
number's monthly texting fee, charged to your company's card on file — a
card is required, and the call fails with PAYMENT_METHOD_REQUIRED without
one. The number texts, and is billed, once the registration is approved; if it
already is, that happens right away. The fee amount is shown on the number's
page in the web app.
Use /sms/detach-number to turn texting off.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to turn texting on for.
Response
- Name
success- Type
- boolean
- Description
Whether texting was turned on.
- Name
message- Type
- string
- Description
Human-readable result.
- Name
config- Type
- PhoneConfig
- Description
The number after the change, with its updated texting status.
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
curl https://api.autessa.com/autessa_poweruser/twilio/sms/attach-number \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b" }'
Turn off texting for a number
/twilio/sms/detach-numberTurns texting off for a number. The number keeps working for calls, and its monthly texting fee stops from the next month.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to turn texting off for.
Response
Same shape as /sms/attach-number.
curl https://api.autessa.com/autessa_poweruser/twilio/sms/detach-number \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b" }'
Send a text message
/twilio/sms/sendSends one text from a company number to a US number. The message reaches a real person, so it's checked first: your company needs a finished Text Messaging registration (or the number comes from your own connected Twilio account), and the recipient needs an approved consent record or a text to you within the last year. People who replied STOP are never texted. Requires write access to the phone configuration.
A refused text still returns 200: success is false, errorCode says why,
and errorMessage explains it in plain language. The codes are the same as the
Send SMS tool's.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration to text from.
- Name
to- Type
- string
- Description
The recipient's US number;
(415) 555-0100and+14155550100are both accepted.
- Name
body- Type
- string
- Description
The message text, at most 1600 characters.
Response
- Name
success- Type
- boolean
- Description
Whether the carrier accepted the text.
- Name
messageId- Type
- string
- Description
Autessa's ID for the logged message.
- Name
twilioMessageSid- Type
- string
- Description
The carrier's identifier for the message.
- Name
status- Type
- string
- Description
QUEUED,ACCEPTED,SENDING, orSENTwhen accepted;BLOCKEDorFAILEDwhen not sent. Delivery shows later in/sms/messages.
- Name
from- Type
- string
- Description
The sending number in E.164 format.
- Name
to- Type
- string
- Description
The recipient in E.164 format.
- Name
segments- Type
- integer
- Description
How many SMS segments the message used, when known.
- Name
errorCode- Type
- string
- Description
Why the text wasn't sent — only when
successisfalse.
- Name
errorMessage- Type
- string
- Description
Plain-language explanation of
errorCode.
curl https://api.autessa.com/autessa_poweruser/twilio/sms/send \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{
"configId": "pH9nR3vC6b",
"to": "+14155550100",
"body": "Hi Sam, your order has shipped. Reply STOP to opt out."
}'
{
"success": true,
"messageId": "mS4kT8wQ2n",
"twilioMessageSid": "SMa1b2c3d4e5f60718293a4b5c6d7e8f90",
"status": "QUEUED",
"from": "+12065550142",
"to": "+14155550100",
"segments": 1,
"errors": []
}
{
"success": false,
"errorCode": "CONSENT_REQUIRED",
"errorMessage": "This person hasn't agreed to receive texts from you. Add a consent record for them in SMS Consent, or wait for them to text you first.",
"errors": []
}
List text messages
/twilio/sms/messagesLists a number's text messages, newest first — incoming texts, replies, and
sends that were refused, with the reason. The other party's number is masked.
Company owners can omit configId to list every company number.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration whose messages to list.
- Name
pageSize- Type
- integer
- Description
Messages per page (default 25, at most 100).
- Name
cursor- Type
- string
- Description
The previous page's
nextCursor; omit for the first page.
Response
- Name
messages- Type
- array<object>
- Description
The page of messages:
messageId,configId,direction(INBOUNDorOUTBOUND),origin,status,ourNumber,counterparty(masked),body,segments,errorCode,errorMessage,twilioMessageSid,createdAt, andstatusUpdatedAt.
- Name
nextCursor- Type
- string
- Description
Pass as
cursorto get the next page; absent on the last page.
- Name
errors- Type
- array<string>
- Description
Error messages, if any occurred.
curl https://api.autessa.com/autessa_poweruser/twilio/sms/messages \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b", "pageSize": 25 }'
{
"messages": [
{
"messageId": "mS4kT8wQ2n",
"configId": "pH9nR3vC6b",
"direction": "OUTBOUND",
"origin": "SDK",
"status": "DELIVERED",
"ourNumber": "+12065550142",
"counterparty": "+1415•••0100",
"body": "Hi Sam, your order has shipped. Reply STOP to opt out.",
"segments": 1,
"createdAt": "2026-09-22T17:42:10Z"
}
],
"nextCursor": "eyJvZmZzZXQiOjI1fQ",
"errors": []
}
List text threads
/twilio/sms/threadsLists the number's shared inbox:
one thread per person who has texted the number or been texted from it,
with the most recent activity first. Read a thread's messages with
/sms/thread, and reply with
/sms/send.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration whose inbox to list.
- Name
limit- Type
- integer
- Description
Threads per page, up to
50(default20).
- Name
after- Type
- string
- Description
The
nextvalue from the previous page.
Response
- Name
threads- Type
- array<object>
- Description
The threads on this page. Each has
otherNumber(the person's number in E.164 format),lastBodyandlastDirection(INBOUNDorOUTBOUND) of the latest text,lastAt(UTC, ISO-8601), andmessageCount.
- Name
next- Type
- string | null
- Description
Pass as
afterto get the next page;nullon the last page.
curl https://api.autessa.com/autessa_poweruser/twilio/sms/threads \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b", "limit": 20 }'
{
"threads": [
{
"otherNumber": "+14155550100",
"lastBody": "Is the shop open Saturday?",
"lastDirection": "INBOUND",
"lastAt": "2026-10-09T17:02:11Z",
"messageCount": 4
}
],
"next": null
}
Get a text thread
/twilio/sms/threadReturns the texts between the number and one person, newest first.
Request parameters
- Name
configId- Type
- string
- Description
The phone configuration.
- Name
otherNumber- Type
- string
- Description
The person's number, as returned in
otherNumberby/sms/threads.
- Name
limit- Type
- integer
- Description
Messages per page, up to
200(default50).
- Name
before- Type
- string
- Description
The
nextvalue from the previous page, to load older messages.
Response
- Name
messages- Type
- array<object>
- Description
The messages on this page. Each has
id,direction(INBOUNDorOUTBOUND),body,sentAt(UTC, ISO-8601),status, andhandledBy(the agent's name,Auto-reply,Keyword reply,Staff:and the teammate's name, orAutomation).
- Name
next- Type
- string | null
- Description
Pass as
beforeto get older messages;nullwhen there are none.
To reply, use /sms/send with the same configId
and otherNumber as to. The reply is sent as the business number and
shows up in the thread with handledBy set to Staff: and your name. It's
checked like any other text: the number must be able to text, and the
person must not have opted out and must have texted you within the last
year or have an approved consent record.
curl https://api.autessa.com/autessa_poweruser/twilio/sms/thread \
-X POST \
-H "Authorization: $POWERUSER_KEY" \
-H "Content-Type: application/json" \
-d '{ "configId": "pH9nR3vC6b", "otherNumber": "+14155550100", "limit": 2 }'
{
"messages": [
{
"id": "mT7rQ2kW9p",
"direction": "OUTBOUND",
"body": "Yes, 10 to 2 on Saturdays.",
"sentAt": "2026-10-09T17:05:40Z",
"status": "DELIVERED",
"handledBy": "Staff: Dana Lee"
},
{
"id": "mS4kT8wQ2n",
"direction": "INBOUND",
"body": "Is the shop open Saturday?",
"sentAt": "2026-10-09T17:02:11Z",
"status": "RECEIVED",
"handledBy": null
}
],
"next": "eyJiIjoiMjAyNi0xMC0wOVQxNzowMjoxMVoifQ"
}
Errors
| Status | When |
|---|---|
200 | Success — check success and errors for operation-level failures (no numbers available, invalid routing target, a refused text). |
400 | A call flow, text flow, call settings, or automation request failed a check (for example a phone number not in E.164 format, or an agent you can't use). The message says what to fix. |
401 | Invalid or missing poweruser key, or the linked user lacks access to the config. |
403 | Scoped key without the endpoint in its allow-list. |
408 | Server-side error; errors contains the message. |