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"
}'
const response = await fetch(
"https://app.talkturo.com/api/assistants/6f8f2a40-89bf-4fd8-94ab-c7c8a7d1e190/telephony/test-call",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Cookie": "sb-access-token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example; sb-refresh-token=rt_example_93kmd8pz"
},
body: JSON.stringify({
accountSlug: "acme-sales",
fromNumber: "+14155550120",
toNumber: "+14155550199"
})
}
);
const data = await response.json();
console.log(data);
{
"success": true,
"roomName": "assistant-6f8f2a40-89bf-4fd8-94ab-c7c8a7d1e190-test-call-9d2a7e4b",
"sipCallId": "sip_7f3db90ac44e",
"message": "Test call initiated successfully"
}
{
"success": false,
"error": "Insufficient credits"
}
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
| Method | Path | Purpose |
|---|---|---|
POST | /api/assistants/[assistantId]/telephony/test-call | Start a test outbound SIP call |
POST | /api/assistants/[assistantId]/telephony/inbound | Toggle inbound calling on or off |
POST | /api/assistants/[assistantId]/telephony/outbound | Toggle outbound calling on or off |
POST | /api/assistants/[assistantId]/telephony/settings | Save full telephony settings |
GET PATCH | /api/assistants/[assistantId]/telephony/phone-numbers | List or assign phone numbers |
POST | /api/assistants/[assistantId]/telephony/assign-phone-numbers | Assign phone numbers to the assistant |
GET | /api/assistants/[assistantId]/telephony/compliance-templates | List 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
Assistant UUID.
Request body
Account slug used to validate account membership and resolve the billing context for the call.
The outbound phone number the assistant should call from. The number must be active and already assigned to the assistant.
The destination phone number to dial for the test call.
Request example
Response fields
Whether the test call was created successfully.
LiveKit room name created for the call session.
Identifier for the outbound SIP call participant.
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. fromNumberis active.fromNumberis 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:
- Create a LiveKit room.
- Dispatch the assistant agent into the room.
- 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
Assistant UUID.
Body parameters
The workspace slug.
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
Returns true when the toggle completes.
Updated assistant record.
Current inbound enabled state.
LiveKit inbound trunk ID. null when inbound is disabled.
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
Assistant UUID.
Body parameters
The workspace slug.
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
Returns true when the toggle completes.
Updated assistant record.
Current outbound enabled state.
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
Assistant UUID.
Body parameters
Workspace slug.
Array of phone-number UUIDs to assign to the assistant.
Toggle inbound calling.
Toggle outbound calling.
Company UUID for inbound routing. Required at runtime when inboundEnabled is true.
Telnyx FQDN connection ID. Nullable because Twilio-based assistants do not use it.
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.
Voicemail detection settings. Omit to leave unchanged.
Enable voicemail detection.
Voicemail action, max 40 characters.
Voicemail message text, max 2000 characters.
Compliance briefing settings. Omit to leave unchanged.
Enable compliance briefing.
Compliance template UUID.
Compliance briefing text, max 2000 characters.
Briefing language, max 20 characters.
Require caller acknowledgment.
Fallback policy when acknowledgment fails. Allowed values: retry, block, continue.
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
Returns true when settings are saved.
Updated assistant record with inbound_enabled, outbound_enabled, telnyx_fqdn_connection_id, inbound_company_id, and destination_country.
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
Assistant UUID.
GET query parameters
Optional account slug override. When using API key auth, this overrides the key's associated account.
PATCH body parameters
Optional account slug override.
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
Returns true.
Array of phone number objects. Each includes id, phone_number, status, is_trial, assistant_id, provider, accountKey, accountLabel, and accountSid.
PATCH response fields
Returns true when assignment completes.
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
Assistant UUID.
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
Assistant UUID.
Response fields
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:
- Configure inbound or outbound settings for the assistant.
- Attach or assign the phone numbers the assistant will use.
- Fetch compliance templates if your setup requires regulated number provisioning.
- Run a test outbound call to verify the assistant, number assignment, and trunk configuration together.
Common failure cases
401or403— 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
fromNumberis not active and assigned to the assistant.
Related telephony context
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
| Method | Path | Purpose | Auth |
|---|---|---|---|
GET | /api/telephony/account | Get telephony provider account configuration | Session cookie |
POST | /api/telephony/account | Create telephony provider account configuration | Session cookie |
PATCH | /api/telephony/account | Update telephony provider account configuration | Session cookie |
GET | /api/telephony/regions | List available regions and providers | Public |
GET | /api/telephony/regulatory | Get regulatory requirements for a country and number type | Session cookie |
POST | /api/telephony/regulatory | Submit regulatory compliance data | Session 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
Telephony provider used by the account.
Provider connection or account identifier.
Provider credentials required to establish the telephony connection. Send only the credential fields required by the selected provider.
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
Whether the account configuration request completed successfully.
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
Country code used to filter available provisioning regions.
Provider name used to filter the available results.
Response fields
Regions available for phone number provisioning.
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
Country code for the phone number being provisioned.
Phone number type used to determine the applicable regulatory requirements.
POST body parameters
Country code for the phone number being provisioned.
Phone number type associated with the compliance submission.
Regulatory information required for the selected country and number type.
Response fields
Regulatory requirements for the requested country and number type.
Whether the compliance submission was accepted.