ResourcesTelephony

Telephony

Configure inbound and outbound telephony, assign phone numbers, run test calls, and manage compliance templates for voice assistants via the Talkturo API.

curl -X POST "https://app.talkturo.com/api/assistants/6f8f2a40-89bf-4fd8-94ab-c7c8a7d1e190/telephony/test-call" \
  -H "Content-Type: application/json" \
  -H "Cookie: sb-access-token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example; sb-refresh-token=rt_example_93kmd8pz" \
  --data '{
    "accountSlug": "acme-sales",
    "fromNumber": "+14155550120",
    "toNumber": "+14155550199"
  }'
{
  "success": true,
  "roomName": "assistant-6f8f2a40-89bf-4fd8-94ab-c7c8a7d1e190-test-call-9d2a7e4b",
  "sipCallId": "sip_7f3db90ac44e",
  "message": "Test call initiated successfully"
}

Telephony endpoints

Manage an assistant's calling configuration, attached phone numbers, outbound test calls, and compliance templates from the telephony API. All telephony routes are scoped to a single assistant and require an authenticated browser session.

All endpoints on this page require session cookie authentication. Send requests from an authenticated Talkturo session. These routes are available under /api/assistants/[assistantId]/telephony/.

Base path

/api/assistants/[assistantId]/telephony

Endpoint summary

MethodPathPurpose
POST/api/assistants/[assistantId]/telephony/test-callStart a test outbound SIP call
POST/api/assistants/[assistantId]/telephony/inboundToggle inbound calling on or off
POST/api/assistants/[assistantId]/telephony/outboundToggle outbound calling on or off
POST/api/assistants/[assistantId]/telephony/settingsSave full telephony settings
GET PATCH/api/assistants/[assistantId]/telephony/phone-numbersList or assign phone numbers
POST/api/assistants/[assistantId]/telephony/assign-phone-numbersAssign phone numbers to the assistant
GET/api/assistants/[assistantId]/telephony/compliance-templatesList available compliance templates

POST test-call

Start a test outbound call from a phone number already assigned to the assistant. The endpoint creates a room, dispatches the agent, and then creates the outbound SIP participant.

Path parameters

Request body

body
accountSlugstring
Required

Account slug used to validate account membership and resolve the billing context for the call.

body
fromNumberstring
Required

The outbound phone number the assistant should call from. The number must be active and already assigned to the assistant.

body
toNumberstring
Required

The destination phone number to dial for the test call.

Request example

Response fields

successboolean
Required

Whether the test call was created successfully.

roomNamestring
Required

LiveKit room name created for the call session.

sipCallIdstring
Required

Identifier for the outbound SIP call participant.

messagestring
Required

Human-readable status message describing the result.

POST /telephony/test-call performs a credit pre-flight check before creating the call. If the account balance is below MIN_CREDITS_TO_RUN_OUTBOUND, the API returns 402 and does not create the room or SIP participant.

Validation rules

The test call endpoint rejects requests unless all of the following are true:

  • Outbound calling is enabled for the assistant.
  • The assistant has a valid livekit_outbound_trunk_id.
  • fromNumber is active.
  • fromNumber is assigned to the assistant.
  • The authenticated user has access to the account identified by accountSlug.

Execution flow

When the request passes validation, Talkturo runs the call setup in this order:

  1. Create a LiveKit room.
  2. Dispatch the assistant agent into the room.
  3. Create the outbound SIP participant.

If the request succeeds, the response includes both the room name and SIP call identifier.

POST inbound

Toggle inbound calling on or off for an assistant. When enabled, provisions a LiveKit inbound SIP trunk and dispatch rule. When disabled, tears them down.

Path parameters

Body parameters

body
enabledboolean
Required

Set to true to provision and enable inbound calling; false to deprovision and disable.

When enabled is true, the assistant must have at least one active phone number assigned. The API returns 400 if no active numbers are found.

Response fields

successboolean
Required

Returns true when the toggle completes.

assistantobject
Required

Updated assistant record.

assistant.inbound_enabledboolean
Required

Current inbound enabled state.

assistant.livekit_inbound_trunk_idstring

LiveKit inbound trunk ID. null when inbound is disabled.

assistant.livekit_dispatch_rule_idstring

LiveKit dispatch rule ID. null when inbound is disabled.

POST outbound

Toggle outbound calling on or off for an assistant. When enabled, provisions a LiveKit outbound SIP trunk. When disabled, tears it down.

Path parameters

Body parameters

body
enabledboolean
Required

Set to true to provision and enable outbound calling; false to deprovision and disable.

When enabled is true, the assistant must have at least one active phone number assigned and the telnyx_fqdn_connection_id and outbound voice profile must be configured. The API returns 400 if prerequisites are missing.

Response fields

successboolean
Required

Returns true when the toggle completes.

assistantobject
Required

Updated assistant record.

assistant.outbound_enabledboolean
Required

Current outbound enabled state.

assistant.livekit_outbound_trunk_idstring

LiveKit outbound trunk ID. null when outbound is disabled.

POST settings

The main telephony settings endpoint. Assigns phone numbers, sets the Telnyx FQDN connection, enables or disables inbound and outbound calling, provisions LiveKit SIP trunks, and optionally configures voicemail detection and compliance briefing.

Path parameters

Body parameters

body
phoneNumberIdsarray
Required

Array of phone-number UUIDs to assign to the assistant.

body
inboundEnabledboolean
Required

Toggle inbound calling.

body
outboundEnabledboolean
Required

Toggle outbound calling.

body
inboundCompanyIdstring

Company UUID for inbound routing. Required at runtime when inboundEnabled is true.

body
telnyxConnectionIdstring

Telnyx FQDN connection ID. Nullable because Twilio-based assistants do not use it.

body
destinationCountrystring

ISO country code for LiveKit outbound region pinning. Allowed values: ae, au, br, ch, de, fr, gb, il, in, jp, sa, sg, us, za. Set to null for auto-routing.

body
voicemailobject

Voicemail detection settings. Omit to leave unchanged.

body
voicemail.detectionEnabledboolean

Enable voicemail detection.

body
voicemail.actionstring

Voicemail action, max 40 characters.

body
voicemail.messagestring

Voicemail message text, max 2000 characters.

body
complianceobject

Compliance briefing settings. Omit to leave unchanged.

body
compliance.enabledboolean

Enable compliance briefing.

body
compliance.templateIdstring

Compliance template UUID.

body
compliance.briefingTextstring

Compliance briefing text, max 2000 characters.

body
compliance.languagestring

Briefing language, max 20 characters.

body
compliance.requireAckboolean

Require caller acknowledgment.

body
compliance.fallbackPolicystring

Fallback policy when acknowledgment fails. Allowed values: retry, block, continue.

body
compliance.ackTimeoutSecondsinteger

Acknowledgment timeout in seconds, range 3–60.

When compliance is enabled, either templateId must be non-null or briefingText must be non-empty. The API validates this cross-field requirement before saving.

Response fields

successboolean
Required

Returns true when settings are saved.

assistantobject
Required

Updated assistant record with inbound_enabled, outbound_enabled, telnyx_fqdn_connection_id, inbound_company_id, and destination_country.

assignedActiveinteger
Required

Count of active phone numbers after the save.

GET and PATCH phone-numbers

List phone numbers available to the assistant, or assign phone numbers to the assistant. The GET method returns numbers that are active and either unassigned or already assigned to this assistant. The PATCH method replaces the assistant's phone-number assignments.

The GET and PATCH methods on this endpoint support both session cookie and API key authentication. All other telephony routes on this page require session cookie authentication only.

Path parameters

GET query parameters

query
accountSlugstring

Optional account slug override. When using API key auth, this overrides the key's associated account.

PATCH body parameters

body
accountSlugstring

Optional account slug override.

body
phoneNumberIdsarray
Required

Array of phone-number UUIDs to assign. Replaces all current assignments.

PATCH replaces all current phone-number assignments. Include the full set of UUIDs you want assigned, not just new additions.

GET response fields

successboolean
Required

Returns true.

numbersarray
Required

Array of phone number objects. Each includes id, phone_number, status, is_trial, assistant_id, provider, accountKey, accountLabel, and accountSid.

PATCH response fields

successboolean
Required

Returns true when assignment completes.

messagestring
Required

Confirmation message.

POST assign-phone-numbers

Assign one or more phone numbers to an assistant. Use this endpoint when numbers already exist in the account and need to be attached to a specific assistant for inbound or outbound use.

Path parameters

Expected behavior

Call this route after provisioning or selecting numbers elsewhere in the account. Once a number is assigned and active, you can use it in assistant telephony workflows such as inbound routing and outbound test calls.

GET compliance-templates

Return the compliance templates available for telephony configuration. Use this endpoint when your phone-number or carrier workflow requires a predefined compliance template.

Path parameters

Response fields

templatesarray

List of available compliance templates for the assistant's telephony context.

Expected behavior

Fetch compliance templates before presenting telephony compliance choices in your application. This keeps your UI aligned with the templates currently available in Talkturo.

Common integration notes

A successful telephony integration usually follows this order:

  1. Configure inbound or outbound settings for the assistant.
  2. Attach or assign the phone numbers the assistant will use.
  3. Fetch compliance templates if your setup requires regulated number provisioning.
  4. Run a test outbound call to verify the assistant, number assignment, and trunk configuration together.

Common failure cases

  • 401 or 403 — the request was sent without a valid authenticated session or without access to the target account.
  • 402 — the account does not have enough credits to run an outbound test call.
  • Validation failure on test-call — outbound telephony is disabled, the outbound trunk is missing or invalid, or fromNumber is not active and assigned to the assistant.

Talkturo also exposes an account-level session-auth endpoint outside the assistant telephony namespace:

  • GET /api/assistant-phone-numbers — lists phone numbers attached to an assistant across the account.

Use the assistant-scoped telephony routes on this page for configuration changes tied to one assistant. Use the account-level listing route when you need a broader lookup across the account.

Account-level telephony endpoints

Manage telephony provider configuration, regional availability, and regulatory compliance at the account level. These routes are separate from assistant-scoped telephony endpoints and require session cookie authentication unless noted otherwise.

Endpoint summary

MethodPathPurposeAuth
GET/api/telephony/accountGet telephony provider account configurationSession cookie
POST/api/telephony/accountCreate telephony provider account configurationSession cookie
PATCH/api/telephony/accountUpdate telephony provider account configurationSession cookie
GET/api/telephony/regionsList available regions and providersPublic
GET/api/telephony/regulatoryGet regulatory requirements for a country and number typeSession cookie
POST/api/telephony/regulatorySubmit regulatory compliance dataSession cookie

Telephony account

Use GET, POST, and PATCH on /api/telephony/account to manage the account's telephony provider configuration, including connection IDs, credentials, and provider-specific settings.

Request fields

body
providerstring
Required

Telephony provider used by the account.

body
connectionIdstring

Provider connection or account identifier.

body
credentialsobject

Provider credentials required to establish the telephony connection. Send only the credential fields required by the selected provider.

body
settingsobject

Provider-specific configuration values for the account.

Send account configuration requests from an authenticated Talkturo session. Treat credential values as sensitive and do not expose them in client-side logs.

Response fields

successboolean
Required

Whether the account configuration request completed successfully.

accountobject
Required

Telephony provider account configuration associated with the authenticated account.

Telephony regions

Use GET /api/telephony/regions to retrieve regions and providers available for phone number provisioning. This endpoint is public and accepts country and provider query parameters to narrow the results.

Query parameters

query
countrystring

Country code used to filter available provisioning regions.

query
providerstring

Provider name used to filter the available results.

Response fields

regionsarray
Required

Regions available for phone number provisioning.

providersarray
Required

Providers available for the requested country or region.

Telephony regulatory

Use GET and POST on /api/telephony/regulatory to manage regulatory requirements for phone number provisioning. The GET method retrieves requirements for a country and number type, while POST submits the compliance data needed to satisfy those requirements.

GET query parameters

query
countrystring
Required

Country code for the phone number being provisioned.

query
numberTypestring
Required

Phone number type used to determine the applicable regulatory requirements.

POST body parameters

body
countrystring
Required

Country code for the phone number being provisioned.

body
numberTypestring
Required

Phone number type associated with the compliance submission.

body
complianceDataobject
Required

Regulatory information required for the selected country and number type.

Response fields

requirementsobject
Required

Regulatory requirements for the requested country and number type.

successboolean
Required

Whether the compliance submission was accepted.