Xuda logo Xuda Docs User Guides
/
xuda.io
← All guides Phone Numbers

Xuda Phone Numbers API Reference

Source file: xuda-phone-api-reference.md

Xuda Phone Numbers API Reference

This reference covers the full method surface of Xuda Phone Numbers and Voice: renting a business number, deciding how a line answers, registering a browser softphone, placing and taking calls, sending and receiving SMS, reading call history and transcripts, tracking metered usage, and the operator methods behind the compliance queue. It is written for developers automating phone provisioning or wiring call and message data into their own systems. Every parameter name, type and required flag below is taken from the shipped method contract.

How To Call These Methods

Every method here is a CPI method. CPI methods are dispatched by name over the Xuda API and MCP layer, and the normal credential for that layer is the account API key. For the transport-level detail, including how requests are framed and how the MCP layer exposes methods, see /api-mcp-integration.

Two things are worth knowing before you write a line of code.

None of the 45 registered methods is flagged private. Unlike several other Xuda modules, the phone module publishes its whole registered surface, so an account API key is a valid credential for the 40 user-clearance methods. Five methods carry clearance: "admin" and are additionally superuser-gated inside the module, which means they answer -403 to anyone outside the platform's own operator list.

The calling account is always resolved from the credential, never from a parameter. There is no uid argument anywhere in this surface. A successful call returns { code: 1, data: ... }. A failure returns { code: -1, data: "<error_code>" }, with the code drawn from a fixed allowlist so that provider detail never leaks back to a caller.

One honest caveat about what these calls will actually do today. The phone product is switched off in production (profile_voice.enabled: false), so activate_voice_service answers voice_service_disabled there, and the production country catalog has its only country disabled, so every search, quote and purchase answers country_not_enabled. On the development environment the product is on but the catalog country is in the internal state, so anyone outside the platform's internal account list receives country_internal_only. The read methods behave normally in both places; the buying path does not yet complete for an external caller.

What The Availability Labels Mean

Every method below carries one explicit availability line. Read it first, because it tells you whether you can call the method from your own code today.

  • Availability: API key means an external developer API key or the MCP layer can call it. Forty phone methods carry this label.
  • Availability: Dashboard session means only a signed-in user in the Xuda dashboard can call it, and an API key cannot. No phone method currently carries this label.
  • Availability: Public endpoint means no authentication at all. No phone method currently carries this label. The product does expose unauthenticated HTTP routes, but those are carrier and model webhooks signed by the provider rather than callable methods. They are listed under Webhooks.
  • Availability: Operator only means Xuda staff. The method carries clearance: "admin" and is re-checked against the platform superuser list inside the module. Five phone methods carry this label and are documented here for completeness.

Method Index

Method What It Does
get_voice_service_status Reports backend readiness and the account's provider subaccount state.
activate_voice_service Idempotently creates and verifies the account's own provider subaccount.
get_voice_country_catalog Lists the countries and number types the server allows, with capabilities.
get_voice_plans Reads the account phone plan ladder, the current tier and its entitlements.
set_voice_plan Activates, upgrades or downgrades the account's phone plan.
get_voice_compliance_status Reports everything deciding whether this account may buy in one country.
accept_voice_terms Records a versioned acceptance of the phone and messaging policies.
get_voice_identity_requirements Returns the entity types, identity fields and documents a country requires.
update_profile_business_identity Stores the business identity that stands behind the account's numbers.
submit_voice_compliance Snapshots the identity for review and starts the AI investigation.
get_voice_number_rates Live per-minute and per-segment rates plus the machine-readable switch policy.
search_voice_numbers Searches carrier inventory inside the account's own subaccount.
quote_voice_number Creates an expiring retail quote for one candidate number.
purchase_voice_number Redeems a quote as a billed, provisioned, webhook-bound number.
list_voice_numbers Lists the account's live numbers with routing and retail billing.
release_voice_number Permanently releases a number and stops its recurring subscription.
attach_voice_number Makes a number the line of one non-main profile.
detach_voice_number Removes the profile binding without releasing the number or changing its billing.
get_voice_number_setup One read of everything deciding how a single number answers.
update_voice_number_setup Saves profile, AI switch, voice and answering rules in a single write.
get_profile_answering_rules Reads stored and effective answering rules plus the editor option lists.
update_profile_answering_rules Saves hours, ring targets, forwarding, voicemail and recording.
get_voice_agent_options Returns the ten voices, four personalities and the caller-notice switches.
set_voice_agent Sets the AI voice, personality and the transcript and recording switches.
preview_voice Returns a spoken sample of one voice and personality pairing.
share_voice_profile Adds another Xuda user as a member who can take the line's calls.
list_voice_profile_members Lists who may register, ring, transfer and open calls on a profile.
revoke_voice_profile_member Removes a member from a profile the caller owns.
get_voice_browser_token Mints a short-lived browser softphone token and its registered identity.
create_voice_call_intent Creates a one-time server-authorized outbound call intent.
list_voice_calls Returns inbound and outbound call history, newest first.
get_voice_call_transcript Returns one call's transcript turns and its call metadata.
takeover_voice_call Moves a live call off the AI and onto the owner's own browser.
list_voice_transfer_targets Lists who a live call may be transferred to, with reachability.
transfer_voice_call Transfers a live call to another person on the line.
send_voice_message Sends a one-to-one SMS from an owned, SMS-capable number.
list_voice_message_threads Lists SMS conversations with unread counts and opt-out state.
list_voice_messages Returns one SMS conversation in chronological order.
mark_voice_message_thread_read Clears the unread counter on one conversation.
get_voice_usage Estimated versus settled usage for a window, with the spend cap.
ops_list_voice_compliance Operator queue of customer compliance records.
review_voice_compliance Operator write recording the KYB and regulatory bundle decisions.
investigate_voice_compliance Runs the web-searching identity investigation and escalates.
reconcile_voice_usage Settles estimated usage rows against the carrier's final price.
adopt_voice_number Assigns a platform-held number to a customer without a purchase.

get_voice_service_status

Get Phone Service Status

Returns backend readiness and the authenticated account's provider subaccount provisioning state. This is the first call any phone screen makes. It reports whether the phone product is switched on for this environment, whether the platform's provider management credentials are configured, whether the AI half is ready and what is missing if it is not, whether the account is on a paid Xuda membership, and the status of the account's own provider subaccount with only the last six characters of its identifier.

Availability: API key

Parameters

This method takes no parameters.

Notes

  • Auth: clearance: user. Any signed-in identity may call it.
  • Call this before anything else. In production the product is switched off, so this method is how you discover that rather than by failing a purchase.
  • Provider credentials are never returned. Only the last six characters of the subaccount identifier are exposed.

activate_voice_service

Activate Phone Service

Idempotently creates or reuses exactly one provider subaccount for the authenticated Xuda customer, verifies against the live provider API that it really is a child of the Xuda parent and is active, and records it on the account. Refuses when the phone product is switched off for the environment, and requires a paid Xuda membership.

Availability: API key

Parameters

This method takes no parameters.

Notes

  • Auth: clearance: user.
  • Plan gate: requires a paid Xuda membership. An account on membership_plan: 'free' is refused with voice_account_not_paid. Xuda's own internal account ids are exempt.
  • Idempotency: exactly one subaccount per customer. A second call while one is already in flight is refused with twilio_subaccount_provisioning rather than creating a duplicate.
  • Verification is not optional. The new subaccount is checked against the live provider API as a genuine child of the Xuda parent before it is recorded.
  • Answers voice_service_disabled when the environment has the product switched off, which is the case in production today.

get_voice_country_catalog

Get Phone Country Catalog

Returns the backend-controlled country and number-type availability catalog, with the wholesale provider pricing removed. Each country reports its state (disabled, internal or open), whether it is a pilot, the number types it offers with their voice, SMS and MMS capability flags, its prerequisites, when it was last reviewed and its policy version. It also reports whether the caller is an internal Xuda account, which is what unlocks a country still in the internal state.

Availability: API key

Parameters

This method takes no parameters.

Notes

  • Auth: clearance: user.
  • This catalog, not the raw carrier inventory, is the authority. A country and a number type must both be enabled here before search, rates, quote or purchase will touch the provider.
  • A country in the internal state answers country_internal_only to anyone outside the internal account list. A disabled country answers country_not_enabled.
  • Two-way SMS is required by configuration in both environments, so a number type whose catalog entry is not SMS-capable is refused at the gate even though it appears in the catalog.

get_voice_plans

Get Voice Plans

Returns the account's phone plan ladder: every purchasable tier with its price, tagline, feature bullets, rank and cumulative entitlement flags, which tier the account is currently on, its price, whether the plan has been activated, how many live numbers the account holds, a billing note explaining that one plan covers every number, and whether the account is on a paid Xuda plan with the sentence to show if it is not.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Ignored. Accepted so a pre-account-wide screen keeps working.

Notes

  • Auth: clearance: user.
  • The plan is per account, not per profile and not per number. One plan covers every number the account holds and its fee is charged once.
  • Entitlements are cumulative up the ladder, so the Business tier carries everything the Free, Phone and Transcript tiers carry.
  • Two retired AI tiers still resolve for numbers already sold on them but are never listed here, because they are off sale.

set_voice_plan

Set Voice Plan

Activates, upgrades or downgrades the account's phone plan, which covers every number it holds. Accepts either tier (for example phone) or the module plan id (profile_phone_phone), so the phone checkout and the generic module switch call it the same way. One of the two is required and neither defaults, because a silent default to free would turn a malformed call into an activation.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Ignored. Accepted for backward compatibility.
tier string No One of free, phone, transcript, business. Required unless plan_id is given.
plan_id string No The module plan id, for example profile_phone_phone. Required unless tier is given.

Notes

  • Auth: clearance: user.
  • Plan gate: requires a paid Xuda membership, or the call answers voice_account_not_paid.
  • Billing side effect: the plan fee is charged once and rides the oldest live number's subscription, where it is repriced with proration. If the reprice fails the tier does not move, so the account can never hold a tier it is not paying for.
  • Retired tiers are refused with voice_plan_retired.
  • A downgrade does not erase saved settings. Entitlements are re-applied at call time, so the behavior stops on the very next call while the stored configuration waits for an upgrade.

get_voice_compliance_status

Get Phone Compliance Status

Returns everything that decides whether this account may buy a number in one country: the policy version in force, the list of required acceptances, whether terms have been accepted and at which version, the KYB status, the regulatory bundle status, an overall ready flag, the entity type and identity currently on file, suggested prefill values taken from the account (kept separate from what is saved, so completeness is judged only on saved values), which identity fields are still missing, which documents will be required, and the AI investigation verdict and summary if one has run.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional. Used only to find an approval granted under the older per-profile key.
country string Yes Two-letter ISO country code.

Notes

  • Auth: clearance: user. Scoped to the caller's own account.
  • The ready flag is the gate purchase_voice_number checks. It only turns true once both the KYB status and the regulatory bundle status are approved.
  • Prefill suggestions are returned separately from saved values on purpose. A suggestion never counts toward completeness.

accept_voice_terms

Accept Phone Terms

Records a versioned acceptance of the Xuda phone, messaging, abuse and downstream-provider terms for one country. The submitted policy_version must match the version the server currently holds for that country, accepted must be exactly true, and every acceptance the platform requires must be present in acceptances. The acceptance is written against the account, with its timestamp and the full required list.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional, for compatibility with an older per-profile record.
country string Yes Two-letter ISO country code.
policy_version string Yes Must equal the country's current policy version.
accepted boolean Yes Must be true.
acceptances array Yes Every required acceptance id. The eight required today are communications_terms, acceptable_use, anti_fraud_and_traffic_pumping, consent_and_opt_out, recording_and_ai_disclosure, emergency_services_limitation, number_portability_and_release, usage_billing_and_carrier_fees.

Notes

  • Auth: clearance: user.
  • An incomplete list, a mismatched policy version or an accepted value that is not exactly true is refused with voice_terms_not_accepted.
  • Read the current policy version from get_voice_compliance_status immediately before calling, rather than caching it. A version bump invalidates an old acceptance.

get_voice_identity_requirements

Get Phone Identity Requirements

Returns the entity types a country allows and, per entity type, the identity fields it requires and the documents it will eventually ask for, so a business verification form is built from the backend rule rather than from a hard-coded field list that drifts per country. It also reports that documents are declared now and collected later.

Availability: API key

Parameters

Name Type Required Description
country string Yes Two-letter ISO country code.

Notes

  • Auth: clearance: user.
  • Build your submission from this response rather than from a fixed field list. Requirements are per country and per entity type.
  • Documents are declared at this stage and collected afterward by email, not uploaded through this method.

update_profile_business_identity

Update Profile Business Identity

Stores the business identity that will stand behind the account's numbers and reports, per country in the catalog, which required fields are still missing and which documents will be needed. Values are merged onto whatever is already on file, stripped of control characters and capped at 300 characters per field. The recognized fields are legal_name, registration_number, tax_id, address_line, city, region, postal_code, country, contact_name, contact_email, contact_phone and website. Despite the method name, the identity is stored on the account. A profile that was verified under the older model is still read as a fallback, so nobody is asked for their paperwork twice.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional. Used to read an identity captured under the older per-profile model.
entity_type string Yes business or individual. Anything else is coerced to business.
identity object Yes The identity fields listed above.

Notes

  • Auth: clearance: user.
  • Values are merged, not replaced, so a partial save is safe and will not blank a field you did not send.
  • Each field is capped at 300 characters and stripped of control characters on the way in.
  • Editing the identity after submission does not change what a reviewer sees. submit_voice_compliance snapshots it, and the investigation reads that snapshot.

submit_voice_compliance

Submit Phone Compliance

Snapshots the identity currently on file onto the country's compliance record, so an approval stays auditable against exactly what was reviewed even if the identity is edited later, marks KYB as pending, and starts the AI investigation in the background so the customer does not wait on a web-searching model.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional, for an identity captured under the older per-profile model.
country string Yes Two-letter ISO country code.

Notes

  • Auth: clearance: user.
  • Refused with voice_identity_required when no entity type is set, and voice_entity_type_not_allowed when the country does not accept that entity type.
  • Returns voice_identity_incomplete together with the list of missing fields when the form is not finished, so you can name them back to the submitter.
  • Submission does not approve. Compliance auto-approval is switched off in both environments, so every verdict escalates to a human reviewer.
  • Side effect: the AI investigation is queued in the background and may raise an operations notification when it escalates.

get_voice_number_rates

Get Phone Number Rates

Fetches live call and message rates from the provider's pricing API for one country and number type, applies the Xuda usage markup, and returns them alongside the capabilities that will be fixed at purchase and a machine-readable switching policy. The policy is returned as data on purpose, so a checkout screen renders whatever the rule currently is rather than hard-coding it: capabilities are fixed at purchase, SMS cannot be added later, changing means releasing and re-buying, a release is permanent, the current month is not prorated, the new number will be different, and the alternatives list names the other enabled types in that country with their capabilities. Voice rates are returned as an inbound per minute figure plus an outbound range across destination prefixes. SMS rates are returned only when the type supports SMS.

Availability: API key

Parameters

Name Type Required Description
country string Yes Two-letter ISO country code.
type string Yes local, mobile, tollFree or national.

Notes

  • Auth: clearance: user.
  • Rates are retail. The usage markup is a 1.5 multiplier with a minimum markup of zero, rounded up at four decimal places so that sub-cent rates are not rounded away to zero.
  • Render the returned switch policy rather than restating it in your own copy. It is versioned data and it is the reason a customer cannot claim they were not told a release is permanent.
  • Wholesale provider cost is never returned.

search_voice_numbers

Search Phone Numbers

Searches the carrier's available inventory, inside the customer's own provider subaccount, restricted to the countries and number types the server catalog enables. Results carry the number, a friendly name, locality, region, postal code and the provider's own capability object, which arrives in mixed casing ({"MMS": false, "SMS": true, "voice": true}).

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional. Validated as owned if supplied.
country string Yes Two-letter ISO country code.
type string Yes local, mobile, tollFree or national.
area_code string No Digits only, up to 8 characters.
contains string No Digit or wildcard pattern the number must contain, up to 20 characters.
capabilities object No { voice, sms, mms } booleans. Narrows the search only.
limit number No 1 to 50, default 20.

Notes

  • Auth: clearance: user. Triggers subaccount provisioning if the account has none.
  • The capabilities filter can only ever narrow a search, never widen it. Asking for SMS on a type the catalog marks as SMS-incapable is refused with number_type_no_sms before any provider work happens.
  • Rate shape: at most 50 results per query.
  • Search results are inventory, not a reservation. Nothing is held for you until you quote and purchase.

quote_voice_number

Quote Phone Number

Creates an expiring retail quote for one candidate number, with the provider's live price marked up, the account's phone plan fee added only if no other live number is already carrying it, and the pricing version snapshotted so the price cannot move under an in-flight checkout. It checks the account's number allowance before pricing anything, so a customer is told to upgrade rather than shown a price they cannot buy at. It reports plan_already_paid so a checkout can explain a zero plan line rather than showing it bare.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional. If given it must be owned, and the purchase must use the same value.
country string Yes Two-letter ISO country code.
type string Yes local, mobile, tollFree or national.
phone_number string Yes The candidate number in E.164.

Notes

  • Auth: clearance: user. Requires a paid Xuda membership.
  • The quote expires after 300 seconds. Redeem it or re-quote.
  • The number rental is the provider's live price marked up by a 1.5 multiplier or a minimum markup of $1, whichever is larger, rounded up to the cent. Wholesale cost stays server-side.
  • Exceeding the plan's number allowance is refused here with voice_number_allowance_reached, before any price is computed.
  • Whatever profile_id you quote with, including an empty one, must be passed identically to purchase_voice_number.

purchase_voice_number

Purchase Phone Number

Charges the recurring Xuda phone rental, acquires the quoted number inside the customer's provider subaccount, binds its inbound voice and, where supported, message webhooks, and persists it, rolling every step back if a later one fails. Before anything is spent it checks the identity verification gate, the paid-membership rule, the binding invariant (a number belongs to exactly one profile and never the main profile), the plan's number allowance, that the entity on file is a business, and that the quote is still valid, unexpired, unused, owned by the caller, priced in USD and for the same number.

Availability: API key

Parameters

Name Type Required Description
quote_id string Yes The quote to redeem.
profile_id string No Must match the quote's profile exactly, including when both are empty.
phone_number string Yes Must match the quoted candidate number.
payment_method_id string No A Stripe payment method to attach and use as the subscription default.

Notes

  • Auth: clearance: user. Requires a paid Xuda membership and an approved compliance record for the country.
  • Idempotency: a duplicate submission while a purchase is in flight is refused with voice_purchase_in_progress, and a repeat of a purchase that already completed returns the existing result rather than buying a second number.
  • The purchase runs as a compensating saga: subscription first, carrier acquisition second, local persistence third. If a later step fails the number is released and the subscription is canceled and refunded, with the outcome recorded on the order document.
  • Billing side effect: one subscription is created per number, priced inline at the number's monthly total. The plan fee rides only the account's oldest live number, so a second number adds its rental and nothing else.
  • profile_id is optional. A number bought without one belongs to the account and answers on its own settings; attach it to a profile later with attach_voice_number. The subscription records the profile only when the number was bought for one.
  • Capabilities are fixed at purchase. SMS cannot be added to a number later.

list_voice_numbers

List Phone Numbers

Lists the authenticated customer's numbers that have not been released, with the profile they are attached to, capabilities, routing state, retail billing (rental, plan fee share, monthly total, currency, pricing version and billing status), whether the line has been set up on its own yet, and whether the AI answers it. Provider credentials and identifiers are never included.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Restrict to the numbers attached to one profile.
limit number No 1 to 100, default 50.

Notes

  • Auth: clearance: user. Scoped to the caller's own numbers.
  • Released numbers are excluded. This is the live inventory, not an audit log.
  • The monthly_total on each row is rental plus the plan fee share, and the plan fee only appears on the account's oldest live number.

release_voice_number

Release Phone Number

Releases an owned number back to the carrier, stops its recurring subscription, removes the profile binding and, if this number was the one carrying the account's plan fee, moves that fee onto the next oldest live number so the plan does not silently stop being billed.

Availability: API key

Parameters

Name Type Required Description
voice_number_id string Yes The number to release.

Notes

  • Auth: clearance: user. Scoped to the caller's own numbers.
  • Releasing is permanent. The current month is not prorated and the same number may not be obtainable again.
  • Idempotency: a repeat call while a release is in flight is refused with voice_number_release_in_progress.
  • Billing side effect: the number's own subscription stops, and the account plan fee is re-homed onto the next oldest live number rather than disappearing.
  • A number the platform adopted rather than sold is returned to the platform account instead of being released to the carrier.

attach_voice_number

Attach Voice Number

Attaches one of the account's numbers to a profile, giving that profile a line: its members become ring targets and the AI is told who staffs it.

Availability: API key

Parameters

Name Type Required Description
voice_number_id string Yes The number to attach.
profile_id string Yes The owned, non-main profile to attach it to.

Notes

  • Auth: clearance: user. Owner-gated on both the number and the profile.
  • A number can be attached to one profile at a time, a profile can hold at most one number, and the main profile can never hold one.
  • Idempotency: attaching a number that is already on that profile is a no-op that reports unchanged.

detach_voice_number

Detach Voice Number

Detaches a number from the profile it is attached to. The number is not released and its billing does not change. It simply stops being any profile's line and keeps ringing on its own settings.

Availability: API key

Parameters

Name Type Required Description
voice_number_id string Yes The number to detach.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • If the line had been answering with settings inherited from that profile, those settings are copied onto the number first, so detaching never silently changes how the line answers.
  • No billing change. Use release_voice_number if you actually want to stop paying for the number.

get_voice_number_setup

Get Voice Number Setup

Everything that decides how one number answers, in a single read: the number itself with its country, type, status, capabilities and billing; the profile it is attached to and that profile's name; the account's current tier and its cumulative entitlement flags; whether the settings are the number's own yet or still inherited from a profile; whether the AI picks up; the voice and personality; the stored answering rules and the effective version of the same rules reduced to what will actually run on the next call under the current plan; the list of people this line may ring; and the option lists behind the editor (ring targets, closed actions, forwarding modes, ring timeout bounds, voicemail maximum, timezones, voices and personalities with their defaults).

Availability: API key

Parameters

Name Type Required Description
voice_number_id string Yes The number to read.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • Read effective when you want to know what will happen on the next call, and the stored rules when you want to know what the customer configured. They differ whenever the plan does not cover a saved setting.
  • Build any editor from the returned option lists rather than from your own constants, so a picker can never offer a value the server would reject.

update_voice_number_setup

Update Voice Number Setup

Saves the setup for one number in a single write. Each section is only touched when it is actually sent, so saving the voice never resets the opening hours. On the first save of a line that was inheriting from a profile, the inherited settings are copied onto the number so that nothing changes silently.

Availability: API key

Parameters

Name Type Required Description
voice_number_id string Yes The number to save.
ai_answer boolean No Whether the AI picks up this line.
voice_agent object No { voice, tone, tone_custom, transcript, record }. An empty string clears a field back to the platform default; tone_custom is capped at 600 characters.
answering_rules object No { ring, business_hours, forward, voicemail, recording } as described under update_profile_answering_rules.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • Plan gate: a setting the account's plan does not include is refused with voice_plan_upgrade_required rather than silently dropped, so your client can offer the upgrade instead of appearing to save something that will never run.
  • Partial saves are the intended pattern. Send only the sections you are changing.
  • ai_answer is declared only on a retired tier, so on every currently purchasable plan this switch answers voice_plan_upgrade_required.

get_profile_answering_rules

Get Answering Rules

Returns the answering rules for one line together with everything an editor needs: the stored rules (sanitized but not stripped by entitlement, so a business that downgrades and upgrades again gets its opening hours back rather than a blank form), the effective rules that will actually run on the next call under the current plan, the account tier and its entitlement flags, the people this line may ring, and the option lists including the full timezone list. Address the line either by voice_number_id, or by profile_id, which resolves to that profile's active number.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Resolves to the active number attached to this profile. Required if voice_number_id is not given.
voice_number_id string No The line to read. Required if profile_id is not given.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • One of the two addressing parameters is required.
  • Stored rules survive a downgrade untouched. Only the effective view narrows, and it widens again on an upgrade.

update_profile_answering_rules

Update Answering Rules

Saves the answering rules onto a line. It is strict on purpose: a setting the plan does not include is refused rather than dropped. Recording is mirrored onto the line's voice settings so that the two surfaces can never disagree.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Resolves to the active number attached to this profile. Required if voice_number_id is not given.
voice_number_id string No The line to save. Required if profile_id is not given.
rules object Yes ring: { timeout_sec 5 to 120, targets 'owner'|'all'|'selected', member_uids[] }, business_hours: { enabled, timezone, week[7][] of { start, end } in HH:MM, closed_action 'voicemail'|'forward'|'ai'|'message', closed_message }, forward: { enabled, number, when 'no_answer'|'always'|'closed' }, voicemail: { enabled, greeting, max_length_sec up to 300, transcribe }, recording: { enabled }.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • Plan gate: anything the plan does not include is refused with voice_plan_upgrade_required.
  • A ring list may only name people who are actually on the line, meaning the account owner plus the profile's members, or the save is refused with voice_member_not_found. A stale user id would otherwise produce a call that rings into a void indistinguishable from nobody answering.
  • An enabled mobile forward must carry a valid E.164 number.
  • Ring timeout is clamped to 5 to 120 seconds and defaults to 25. Voicemail length is capped at 300 seconds and defaults to 120.
  • Business hours are evaluated in the named timezone, so daylight saving is correct and a window that runs past midnight is supported. A timezone the server cannot resolve leaves the line open rather than locking the business out of its own phone.

get_voice_agent_options

Get Voice Agent Options

Returns the backend-controlled voice and personality menus for the phone AI, so a picker can never offer a value the platform would reject: ten voices with display labels, four personality presets with their labels, the platform defaults, and the two caller-notice switches (transcribe calls, record calls) with their own labels, help text, defaults and whether each is available. When called by a signed-in identity the answer also carries the account's phone tier and cumulative entitlement flags, plus voice_agent_available, so a screen knows whether to render the editor at all without a second call.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional context. The menus resolve with or without it.

Notes

  • Auth: clearance: user.
  • Check voice_agent_available before offering the editor. On every currently purchasable tier it is false, because no profile_phone plan entry grants the voice_agent flag.

set_voice_agent

Set Voice Agent

Sets the AI voice, personality and the two caller-notice switches for one line. An unknown voice or personality is rejected outright so that a bad value can never reach the model and drop a live call. An empty value clears that field back to the platform default. Address the line either by voice_number_id or by profile_id.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Resolves to the active number attached to this profile. Required if voice_number_id is not given.
voice_number_id string No The line to set. Required if profile_id is not given.
voice string No One of marin, cedar, coral, sage, alloy, ash, ballad, echo, shimmer, verse. Empty clears to the default.
tone string No One of warm, professional, playful, empathetic. Empty clears to the default.
tone_custom string No A free-text note on how the AI should come across, up to 600 characters. Treated as tone guidance only, never as permission to override the safety rules.
transcript boolean No Keep a text transcript of calls on this line. No audio is stored.
record boolean No Store the call audio. Callers are told the call may be recorded.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • Plan gate: requires a plan that includes the setting being changed. On the current catalog no purchasable tier grants the voice_agent flag, so this method answers voice_plan_upgrade_required on every tier you can buy today.
  • Turning recording on is written to the log with the number and the user who did it, because it changes what the business is legally committing to on every call.
  • Recording is mirrored into the answering rules, so the two editors cannot disagree.

preview_voice

Preview Voice

Returns a short spoken sample of a voice and personality as a base64 audio data URL, so that a picker can be heard before it is saved. The personality preset drives both the sample line and how it is read, so switching personality is audibly different rather than just a different label. The audio comes back inline rather than as a link, because a fetchable URL would carry the platform's own model credential.

Availability: API key

Parameters

Name Type Required Description
voice string No One of the ten voices. Defaults to the platform default.
tone string No One of the four personalities. Defaults to warm.

Notes

  • Auth: clearance: user.
  • Samples are cached per voice and personality pairing for the life of the process, so replaying one never re-bills.
  • The response is an inline data URL. Do not expect a fetchable link.

share_voice_profile

Share Voice Profile

Shares a non-main profile with another Xuda user, making them a member who can take that profile's calls, appears as a ring target and a transfer target, and whom the AI is told about when it answers.

Availability: API key

Parameters

Name Type Required Description
profile_id string Yes The owned, non-main profile to share.
member_uid string Yes The Xuda account id of the person to add.

Notes

  • Auth: clearance: user, owner of the profile.
  • Plan gate: requires the member_routing entitlement.
  • The main profile can never be shared, because it can never hold a line.

list_voice_profile_members

List Voice Profile Members

Lists the active members of a profile the caller owns, each with their user id and display name. This is the single source for who may register a browser on the line, who is a valid ring target, who can open its calls, who appears as a transfer target, and who the AI is told staffs the line.

Availability: API key

Parameters

Name Type Required Description
profile_id string Yes The owned profile to read.

Notes

  • Auth: clearance: user, owner of the profile.
  • Use this to populate a ring list. update_profile_answering_rules refuses any member id that is not on the line.

revoke_voice_profile_member

Revoke Voice Profile Member

Removes a member from a profile the caller owns, marking the membership record revoked with a timestamp.

Availability: API key

Parameters

Name Type Required Description
profile_id string Yes The owned profile.
member_uid string Yes The member to remove.

Notes

  • Auth: clearance: user, owner of the profile.
  • The membership record is marked revoked rather than deleted, so the history of who was on a line stays readable.

get_voice_browser_token

Get Browser Phone Token

Returns a short-lived Twilio Voice SDK access token plus the browser identity it is issued for, scoped to the account that actually holds the number and to a line the caller is entitled to. The identity is a hash of the user and the resolved profile, computed the same way the transfer engine computes it, so a transfer always rings an identity that is really registered.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Optional. If given it must match the number's attached profile.
voice_number_id string Yes The line to register the browser against.

Notes

  • Auth: clearance: user. The owner of the number may always register, and anyone the attached profile is shared with may register too.
  • Default token lifetime is 600 seconds, clamped server-side to between 60 and 3600 seconds. Re-mint rather than caching.
  • The token is a browser softphone credential. Treat it as a secret and never log it.

create_voice_call_intent

Create Phone Call Intent

Creates a one-time, short-lived, server-authorized outbound call intent for the browser dialer. The browser hands only the intent id to the SDK and the destination is resolved server-side from the intent, so a browser can never dial an arbitrary number on the account's caller ID.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Validated as owned if supplied.
voice_number_id string Yes The line to call from, which becomes the caller ID.
to string Yes The destination in E.164.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • The intent expires after 60 seconds and can be consumed exactly once.
  • The destination is normalized to E.164 and checked against the outbound allowlist and the blocked-prefix list. The allowlist is empty in production, meaning no restriction, and is limited to +972 and +1 on the development environment.
  • Spend cap: the account's monthly retail total is checked before the intent is issued. At or above the cap the call is refused with voice_spend_cap_reached.

list_voice_calls

List Phone Calls

Returns the authenticated customer's inbound and outbound call history, newest first, with direction, the two numbers, status, duration, start and end timestamps, how many transcript turns the call has, and whether a recording exists with its duration.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Restrict to one profile.
voice_number_id string No Restrict to one line.
limit number No 1 to 100, default 50.

Notes

  • Auth: clearance: user. Scoped to the caller's own calls.
  • No provider credentials or media URLs are ever included. Transcripts are fetched one call at a time, and a recording's media link is credentialed and stays server-side.
  • Call legs bill in whole minutes, the way carriers charge, so a duration in seconds will not divide evenly into the usage total.

get_voice_call_transcript

Get Call Transcript

Returns the text transcript of one call as an ordered list of turns, each with the speaker role, the text and a timestamp, together with the call's direction, numbers, status, duration, timestamps, who handled it, the turn count and recording metadata if audio was stored.

Availability: API key

Parameters

Name Type Required Description
call_id string Yes The call to read, in the form voice_call_<provider call sid>.

Notes

  • Auth: clearance: user. Scoped to the caller's own calls.
  • Text only. Nothing is recorded on the AI-answered path unless recording was explicitly switched on, and the transcript itself never contains audio.
  • The call is fetched by id and then checked against the caller's account, so a guessed id belonging to another account returns not-found rather than text.
  • Transcripts are capped at 400 turns or 40,000 characters per call, whichever comes first.
  • Plan gate: transcription is a Transcript-tier entitlement. A call on a lower tier will have no turns to return.

takeover_voice_call

Take Over Call

Moves a live call off the AI receptionist and onto the caller's own browser by replacing the instructions on the parent provider call. The call record is stamped as handled by a member and the dashboard is re-notified so a card swaps from "the AI is answering" to a ringing card immediately.

Availability: API key

Parameters

Name Type Required Description
call_id string Yes The live call to take over.

Notes

  • Auth: clearance: user, owner of the call.
  • Deliberately not gated on the warm transfer entitlement. Taking your own call back is not a team feature, and the AI answering is a convenience the owner must always be able to override.
  • Refused if the call has already ended.
  • A call that does not exist and a call that is not yours return the same error, so the method cannot be used to probe which ids are real.

list_voice_transfer_targets

List Voice Transfer Targets

Lists who a live call can be transferred to: the account owner plus the members of the call's profile, excluding whoever is asking. Each entry carries the person's id, display name, whether they are also reachable on a phone, and whether they have do not disturb switched on.

Availability: API key

Parameters

Name Type Required Description
call_id string Yes The live call.

Notes

  • Auth: clearance: user, and the caller must be the owner of the call or a member of its profile.
  • The phone number itself is never exposed, only whether the person is reachable on one.
  • Any participant on the call may read this, which lets a shared member act without being able to enumerate the owner's other profiles.

transfer_voice_call

Transfer Voice Call

Transfers a live call to another person on the line. The transfer replaces the instructions on the parent provider call: the target's browser rings first for 20 seconds, then the target's mobile rings for 25 seconds unless they have do not disturb on. If nobody is available the caller hears a spoken apology rather than silence.

Availability: API key

Parameters

Name Type Required Description
call_id string Yes The live call.
member_uid string Yes The person to transfer to, from list_voice_transfer_targets.

Notes

  • Auth: clearance: user, and the caller must be the owner of the call or a member of its profile.
  • Plan gate: requires the warm_transfer entitlement, checked against the account that pays for the line rather than against whoever pressed the button.
  • Do not disturb suppresses the mobile leg only. The browser leg still rings.
  • Take the target from list_voice_transfer_targets rather than from your own directory, so the identity you name is one that is actually registered.

send_voice_message

Send Phone Message

Sends a one-to-one SMS from an owned, SMS-capable number. The message body is segmented server-side using the same rule the composer shows: 160 characters per GSM-7 segment, 153 when concatenated, 70 for UCS-2, 67 when concatenated, and a single Hebrew character or emoji forces UCS-2 for the whole message. Messages are sent from the account that actually holds the number, so a number kept in the platform account still sends correctly.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Validated as owned if supplied.
voice_number_id string Yes The SMS-capable line to send from.
to string Yes The recipient in E.164.
body string Yes The message text. Must not be empty, maximum 10 segments.
idempotency_key string No Strongly recommended. The server claims this key so a retry returns the original message instead of sending a second one.

Notes

  • Auth: clearance: user. Owner-gated on the number.
  • Idempotency: always send an idempotency_key. Without one, a retry sends and bills a second message.
  • Opt-out is enforced server-side. A contact who has sent STOP is refused with voice_recipient_opted_out regardless of what the client does. STOP, START and HELP keywords are recognized in both launch languages.
  • A send over 10 segments is refused with voice_message_too_long. Count segments before you send, because one emoji can triple the cost of a message.
  • The destination is checked against the outbound allowlist and the blocked-prefix list.
  • Spend cap: the account's monthly retail total is checked first. At or above the cap the send is refused with voice_spend_cap_reached.
  • Billing side effect: a usage row is written at send time, because segment count is known immediately.

list_voice_message_threads

List Phone Message Threads

Lists SMS conversations for the authenticated customer, most recent first, each with its thread id, the profile and line it belongs to, the contact's number, the last message body and direction, the last timestamp, the unread count and the opt-out state with the time it was set.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Restrict to one profile.
voice_number_id string No Restrict to one line.
limit number No 1 to 100, default 50.

Notes

  • Auth: clearance: user. Scoped to the caller's own threads.
  • Threads are derived from the number and the contact rather than allocated, so an inbound message and an outbound reply always land in the same conversation with no race.
  • Check opted_out before offering a reply composer. The send will be refused anyway, but a locked composer is a better experience than a failed send.

list_voice_messages

List Phone Messages

Returns one SMS conversation in chronological order together with the thread's own state. Each message carries its id, direction, the two numbers, the body, delivery status, segment count, encoding, any provider error code and its timestamps.

Availability: API key

Parameters

Name Type Required Description
thread_id string Yes The conversation to read.
limit number No 1 to 200, default 100. Returns the most recent messages.

Notes

  • Auth: clearance: user. The thread must belong to the caller.
  • The per-message segments and encoding fields are the real billing unit, not the character count.

mark_voice_message_thread_read

Mark Phone Thread Read

Clears the unread counter on one SMS conversation and returns the updated thread.

Availability: API key

Parameters

Name Type Required Description
thread_id string Yes The conversation to mark read.

Notes

  • Auth: clearance: user. The thread must belong to the caller.
  • Safe to repeat. Marking an already-read thread simply returns it.

get_voice_usage

Get Phone Usage

Returns the caller's call and message usage for a time window, with estimated and settled amounts kept separate because a figure that is still an estimate should not be presented as a bill. It breaks the total down by usage kind with quantities, amounts and event counts, reports the pricing version in force, the monthly spend cap and how much of it is left, and whether every row in the window has settled.

Availability: API key

Parameters

Name Type Required Description
profile_id string No Restrict to one profile.
from_ts number No Window start in epoch milliseconds. Defaults to the start of the current calendar month in UTC.
to_ts number No Window end in epoch milliseconds. Defaults to now.

Notes

  • Auth: clearance: user. Scoped to the caller's own usage.
  • Number rental is excluded, and the response says so explicitly. Rental is billed as a subscription rather than as usage.
  • Do not present an estimated amount as a bill. Rows settle against the carrier's final published price a few minutes after the event, and the reconciliation sweep runs every 15 minutes.
  • The usage kinds are voice_inbound and voice_outbound (per minute), sms_inbound and sms_outbound (per segment), and transcription (per minute).
  • The monthly spend cap is $50 of retail usage. Reaching it refuses new outbound calls and new sends with voice_spend_cap_reached.

ops_list_voice_compliance

List Phone Compliance Queue

Operator queue of customer phone compliance records, newest first. Each row carries the customer's account id, email and name, the country and policy version, whether terms were accepted and whether that acceptance is still current, the entity type, the identity snapshot that was actually submitted, the declared documents, the AI investigation verdict, confidence, summary, model and check time, the KYB and regulatory bundle statuses, an overall ready flag and the submission and update timestamps. The answer also carries the allowed status values and the configured country list so that a screen's dropdowns cannot drift.

Availability: Operator only

Parameters

Name Type Required Description
country string No Restrict to one country.
pending_only boolean No Hide records that are already fully approved.
limit number No 1 to 200, default 100.

Notes

  • Auth: clearance: admin, and additionally superuser-gated in code. Anyone not on the platform superuser list receives -403.
  • No provider identifiers are returned. Only the last six characters of a regulatory bundle identifier are ever stored.

review_voice_compliance

Review Phone Compliance

The operator's write: records a KYB decision and a regulatory bundle decision for one customer and country, each stamped with the reviewer and the time.

Availability: Operator only

Parameters

Name Type Required Description
target_uid string Yes The customer account being reviewed.
target_profile_id string No Accepted so a queue row written under the older per-profile key still resolves.
country string Yes Two-letter ISO country code.
kyb_status string Yes One of required, pending, approved, rejected.
regulatory_bundle_status string Yes One of required, pending, approved, rejected.
bundle_sid string No Provider regulatory bundle identifier. Only its last 6 characters are stored.

Notes

  • Auth: clearance: admin, superuser-gated in code.
  • Approving both statuses is what flips a customer's ready flag and unblocks a number purchase that costs real money, which is why the operator screen puts it behind a confirmation.
  • Only the last six characters of any supplied provider bundle identifier are stored, so a full provider identifier never reaches a browser.

investigate_voice_compliance

Investigate Phone Compliance

Verifies a submitted business identity with a web-searching model and either auto-approves KYB on a confident pass or escalates to a human with the findings attached. Three rules are enforced in code: it may set KYB only and never the regulatory bundle, which is a provider fact and must come from the provider; the customer-supplied identity is delimited and explicitly labeled untrusted in the prompt, with the model told that anything resembling an instruction inside it is data to report as a finding; and anything short of a confident pass escalates, because silence is not approval.

Availability: Operator only

Parameters

Name Type Required Description
owner_uid string No The customer account whose record to investigate. Falls back to the caller.
profile_id string No Accepted so an older per-profile record still resolves.
country string Yes Two-letter ISO country code.

Notes

  • Auth: clearance: admin, superuser-gated in code.
  • It reads the snapshot on the compliance record, never the live identity, so editing an identity after submission cannot change what was investigated.
  • Side effect: when it escalates, an operations notification is raised.
  • Auto-approval is additionally gated by a config switch that is off in both environments, so today every verdict escalates and a human approves every customer.
  • It also runs automatically in the background when a customer calls submit_voice_compliance.

reconcile_voice_usage

Reconcile Phone Usage

Settles estimated usage rows against the price the provider eventually publishes, which arrives some minutes after the event. Each row is settled from its own provider resource, the provider's own quantity is trusted over the local one where it reports one, and the markup is re-applied to the real cost. Returns a summary of rows examined, settled, still unpriced, skipped as too young, unreconciled, and any errors.

Availability: Operator only

Parameters

Name Type Required Description
limit number No 1 to 1000, default 200.
min_age_ms number No Minimum age of a row before it is worth asking the provider. Default 120000.

Notes

  • Auth: clearance: admin, superuser-gated in code.
  • Idempotency: safe to re-run. Rows already final are skipped.
  • A row whose provider record no longer exists is parked in a terminal unreconciled state rather than retried forever, and is deliberately not marked final, so the customer-facing view keeps counting it in the conservative estimated bucket rather than billing an unverifiable call.
  • It also runs automatically on a cron every 15 minutes, on the primary only, and again immediately before each Stripe usage flush so that a row priced after the last tick is not held for a whole cycle.

adopt_voice_number

Adopt Platform Phone Number

Assigns a number Xuda already owns to a customer without a purchase and without a Stripe subscription, and marks it so that a later release returns it to the platform account rather than destroying it at the carrier. This is the port-in path and the way a number survives an environment move: an adopted number has no billing state to migrate, whereas a number purchased on a test-mode environment carries a subscription that cannot follow it.

Availability: Operator only

Parameters

Name Type Required Description
target_uid string Yes The customer account to assign the number to.
profile_id string No Optional. The number can sit on the account and be attached later.
phone_number string Yes The platform-held number in E.164.
country string No Two-letter ISO country code. Defaults to US.
number_type string No Defaults to tollFree.
keep_in_parent boolean No Leave the number in the platform provider account and only repoint its webhooks.

Notes

  • Auth: clearance: admin, superuser-gated in code.
  • It deliberately does not require an approved compliance record, because the number is already provisioned and approved under the platform's own account. That is exactly why the method is operator-gated.
  • No Stripe subscription is created, so an adopted number carries no rental billing.
  • keep_in_parent is for the cases where the provider refuses a transfer, such as a number carrying an emergency address, or where moving it would risk an approved toll-free verification.

Plans, Entitlements And Limits

The phone plan is per account, not per profile and not per number. One plan covers every number the account holds and its fee is charged once. Entitlements are cumulative, so each tier carries everything below it.

Plan id Name Price Entitlement flags it adds Number allowance
profile_phone_free Phone Free $0 / mo browser_calling, dialer, call_history 1
profile_phone_phone Phone $9 / mo answering_rules, cell_forwarding, voicemail, member_routing, warm_transfer, recording 25
profile_phone_transcript Transcript $19 / mo transcript, transcript_all_calls, call_search 25
profile_phone_business Business $39 / mo business_hours 50

Two tiers, profile_phone_ai_receptionist and profile_phone_ai_team, are retired. They still resolve for numbers already sold on them, but set_voice_plan refuses to move anything onto them with voice_plan_retired and they are never listed by get_voice_plans.

Three honest caveats for anyone planning an integration:

  • No min_plan gate exists on any voice method. All 45 registered methods carry only clearance, 40 user and 5 admin. Every plan decision happens inside the module against the account's phone tier and surfaces as voice_plan_upgrade_required, not at the API registry.
  • The phone product is an add-on to a paid Xuda membership. An account on the free membership plan is refused with voice_account_not_paid on set_voice_plan, quote_voice_number, purchase_voice_number and activate_voice_service.
  • voice_agent and ai_answer are unreachable on every purchasable tier. No profile_phone plan entry grants either flag, so set_voice_agent answers voice_plan_upgrade_required on the current catalog and the per-line AI switch cannot be turned on through the phone plan.

Hard limits and quotas:

Limit Value
Monthly spend cap $50 of retail usage across calls and messages
Numbers per profile 1
Numbers per account The plan's allowance: 1, 25 or 50
SMS maximum length 10 segments per send
Quote lifetime 300 seconds
Browser token lifetime 600 seconds, clamped to 60 to 3600
Outbound call intent lifetime 60 seconds, single use
Ring timeout 5 to 120 seconds, default 25
Voicemail maximum length Up to 300 seconds, default 120
Transcript caps 400 turns or 40,000 characters per call, whichever comes first
Custom personality note 600 characters
Identity field length 300 characters per field
Search results Up to 50 per query
Provider request timeout 20 seconds
Outbound destination allowlist Empty in production (no restriction); +972 and +1 only on the development environment
Voices 10
Personalities 4

Usage pricing. Calls and messages are metered on top of the rental and the plan fee, with a 1.5 multiplier and a minimum markup of zero, rounded up at four decimal places so sub-cent rates are not zeroed. Call legs bill in whole minutes. Until the provider publishes a final price, a row carries a configured estimate in retail dollars per unit: voice_inbound $0.03 a minute, voice_outbound $0.15 a minute, sms_inbound $0.02 a segment, sms_outbound $0.40 a segment, transcription $0.075 a minute.

Number rental is the provider's live price for that country and number type, marked up by a 1.5 multiplier or a minimum markup of $1, whichever is larger, rounded up to the cent. The invoice total for a number is its rental plus the plan fee, and the plan fee only rides the account's oldest live number.

Errors

Every failure returns { code: -1, data: "<error_code>" }, with the code drawn from a fixed allowlist so that provider detail never leaks. The operator methods additionally return -403 to a caller outside the platform superuser list.

Code Meaning
voice_service_disabled The phone product is switched off for this environment.
voice_account_not_paid The account is on the free Xuda membership and the phone product needs a paid one.
twilio_subaccount_provisioning A subaccount is already being created for this account. Do not retry in a loop.
country_not_enabled The country is disabled in the server catalog.
country_internal_only The country is in the internal state and the caller is not an internal account.
number_type_no_sms An SMS capability was requested on a number type the catalog marks as SMS-incapable.
voice_terms_not_accepted The acceptance list, the policy version or the accepted flag did not satisfy the requirement.
voice_identity_required No entity type is set on the account.
voice_entity_type_not_allowed The country does not accept that entity type.
voice_identity_incomplete Required identity fields are missing. The missing list is returned with it.
voice_number_allowance_reached The plan's number allowance is already used up.
voice_purchase_in_progress A purchase for this quote is already running.
voice_payment_failed The billing side refused. This is also what an empty profile_id on purchase surfaces as today.
voice_number_release_in_progress A release for this number is already running.
voice_plan_upgrade_required The account's phone tier does not include the setting or action being requested.
voice_plan_retired The requested tier is off sale and cannot be moved onto.
voice_member_not_found A ring or transfer target named someone who is not on the line.
voice_recipient_opted_out The contact has sent STOP and may not be messaged.
voice_message_too_long The message exceeds 10 segments.
voice_spend_cap_reached The account's monthly retail usage total has hit the $50 cap.
-403 Returned by the five operator methods to any caller outside the platform superuser list.

Webhooks

The phone product does not publish outbound webhooks to customer endpoints. What it does have is a set of inbound HTTP routes that the carrier and the model provider call, plus a set of socket events pushed to the dashboard. Neither is a callable method and neither can be subscribed to with an API key.

Inbound provider routes, hosted through router_module under /voice/... and answered with TwiML except the last one. Carrier requests are authenticated by validating the X-Twilio-Signature HMAC against the owning subaccount's auth token, and the model provider's webhooks are verified with the Standard Webhooks scheme including a 300 second timestamp tolerance, because this endpoint answers a live phone call and a replay would be a real call.

Route What Calls It
/voice/incoming Inbound call. Returns the answering TwiML.
/voice/outbound Browser dialer leg. Consumes the call intent.
/voice/status Call lifecycle. Writes duration and meters the leg.
/voice/recording Recording completed. Stores the reference and duration.
/voice/transcription Real-time transcription events for human-answered calls. Meters transcription minutes.
/voice/voicemail Voicemail stored.
/voice/voicemail-transcription Voicemail transcription text.
/voice/incoming-message Inbound SMS. Thread upsert, STOP and START handling, usage row.
/voice/message-status Outbound SMS delivery status.
/voice/openai Model provider realtime call incoming. Accepts the session with the line's instructions and voice.

Socket events emitted to the dashboard. The service name is the event name and the payload is the data object, with no wrapper: voice_incoming_call, voice_call_status, voice_incoming_message, voice_message_status, voice_voicemail.

Crons. Usage reconciliation runs every 15 minutes on the primary only, under a configured superuser identity, and is inert when the phone product is switched off or no superuser is configured. The Stripe usage flush also runs a reconcile immediately before billing.

A Note On The Rest Of The Surface

Beyond the 45 registered methods above, the module exports four functions that are not registered as CPI methods and therefore cannot be called from a client. Two of them, twilio_voice_webhook and openai_realtime_webhook, are reached over HTTP through the router as the provider routes listed under Webhooks. The other two, get_voice_do_not_disturb and set_voice_do_not_disturb, are exported and wrapped in the dashboard but are not registered in the method catalog in either environment, so a call to either will not resolve to the module today. Do not build against them.