Call Actions
Perform actions on an active call - transfer, record, play audio, speak text, send DTMF.
Call Actions
Perform various actions on active calls including transferring, recording, playing audio, speaking text, and sending DTMF tones.
Transfer Call
Transfer an active call to another phone number.
Endpoint
POST https://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/transferRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | yes | Destination number in E.164 format |
| caller_id | string | no | Caller ID to display (must be a number you own) |
| answer_url | string | no | Webhook URL for the transferred call |
Example Request
curl -X POST https://api.tryvox.io/v1/voice/accounts/your_auth_id/calls/650e8400-e29b-41d4-a716-446655440000/transfer \
-H "Authorization: Bearer tvx_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"to": "+14155559999",
"caller_id": "+14155551234",
"answer_url": "https://example.com/transfer-answer"
}'Response
{
"transfer_uuid": "850e8400-e29b-41d4-a716-446655440000",
"status": "transferring",
"to": "+14155559999"
}Start Recording
Start recording an active call.
Endpoint
POST https://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/recordRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| format | string | no | Recording format: mp3, wav (default: mp3) |
| max_length | integer | no | Maximum recording length in seconds (default: 14400) |
| trim_silence | boolean | no | Trim silence from beginning and end (default: false) |
Example Request
curl -X POST https://api.tryvox.io/v1/voice/accounts/your_auth_id/calls/650e8400-e29b-41d4-a716-446655440000/record \
-H "Authorization: Bearer tvx_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"format": "mp3",
"max_length": 3600,
"trim_silence": true
}'Response
{
"recording_uuid": "950e8400-e29b-41d4-a716-446655440000",
"status": "recording",
"format": "mp3"
}Stop Recording
Stop an active recording.
Endpoint
DELETE https://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/recordExample Request
curl -X DELETE https://api.tryvox.io/v1/voice/accounts/your_auth_id/calls/650e8400-e29b-41d4-a716-446655440000/record \
-H "Authorization: Bearer tvx_sk_live_..."Response
{
"recording_uuid": "950e8400-e29b-41d4-a716-446655440000",
"status": "stopped",
"url": "https://recordings.tryvox.io/950e8400-e29b-41d4-a716-446655440000.mp3",
"duration": 125
}Play Audio
Play an audio file to the caller.
Endpoint
POST https://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/playRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | yes | URL of audio file to play (mp3 or wav) |
| loop | integer | no | Number of times to loop (default: 1, 0 = infinite) |
Example Request
curl -X POST https://api.tryvox.io/v1/voice/accounts/your_auth_id/calls/650e8400-e29b-41d4-a716-446655440000/play \
-H "Authorization: Bearer tvx_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/hold-music.mp3",
"loop": 0
}'Response
{
"play_uuid": "a50e8400-e29b-41d4-a716-446655440000",
"status": "playing",
"url": "https://example.com/hold-music.mp3"
}Speak Text
Convert text to speech and play it to the caller.
Endpoint
POST https://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/speakRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | yes | Text to convert to speech |
| voice | string | no | Voice ID (default: en-US-Standard-A) |
| language | string | no | Language code (default: en-US) |
| engine | string | no | TTS engine: standard, neural (default: neural) |
Example Request
curl -X POST https://api.tryvox.io/v1/voice/accounts/your_auth_id/calls/650e8400-e29b-41d4-a716-446655440000/speak \
-H "Authorization: Bearer tvx_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"text": "Thank you for calling. Please hold while we connect you.",
"voice": "en-US-Neural-Jenny",
"language": "en-US",
"engine": "neural"
}'Response
{
"speak_uuid": "b50e8400-e29b-41d4-a716-446655440000",
"status": "speaking",
"text": "Thank you for calling. Please hold while we connect you."
}Send DTMF
Send DTMF tones (touch-tone digits) during a call.
Endpoint
POST https://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/dtmfRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| digits | string | yes | Digits to send (0-9, *, #) |
Example Request
curl -X POST https://api.tryvox.io/v1/voice/accounts/your_auth_id/calls/650e8400-e29b-41d4-a716-446655440000/dtmf \
-H "Authorization: Bearer tvx_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"digits": "1234*#"
}'Response
{
"dtmf_uuid": "c50e8400-e29b-41d4-a716-446655440000",
"status": "sent",
"digits": "1234*#"
}Notes
General
- All actions require the call to be in
in-progressstatus - Multiple actions can be performed on the same call
- Actions are executed asynchronously
- Some actions (play, speak) will interrupt each other
Recording
- Recordings are available for 30 days by default
- Recording starts from the moment the API is called
- Both sides of the call are recorded
- Recording URLs are provided in the call details and hangup webhook
Transfer
- The original call ends when transfer completes
- Transfer can be blind (immediate) or attended (with confirmation)
- Failed transfers will return the caller to the original call
Audio Playback
- Audio files must be publicly accessible
- Supported formats: mp3, wav
- Playback can be stopped by starting a new action
Text-to-Speech
- Neural voices provide more natural speech
- Maximum text length: 3000 characters
- Multiple languages and voices available
- Speech can be interrupted by DTMF input
DTMF
- Valid digits: 0-9, *, #
- Useful for navigating IVR systems during transferred calls
- Each digit is played for 200ms with 200ms gaps