Voice API

Call Actions

Perform actions on an active call — transfer, record, play audio, speak text, send DTMF.

Operate on calls that are already in progress. Every action endpoint is fire-and-forget: TryVox returns 204 No Content on success and the side effect happens asynchronously on the media server. There is no synchronous "operation completed" response — use hangup_url, status_callback_url, and the Recordings API to observe results.

{call_uuid} in every URL is the request_uuid returned when the call was created (or the call_uuid in the inbound answer_url payload).

Transfer Call

Bridge an active call to somewhere else — a phone number, or several phone numbers at once.

aleg_url is a destination, not a URL, despite the name. It takes an E.164 number such as +919876543210 or a SIP dial string. Passing an https:// address is rejected with is not a valid number or dial string — transferring to a VoxML script is not something this endpoint does. The parameter name is inherited and kept for compatibility; prefer destinations in new integrations.

Endpoint

POSThttps://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/transfer

Request body

ParameterTypeRequiredDescription
destinationsstring[]conditionalWhere to send the call. Required unless aleg_url is given; wins when both are. Max 20, no duplicates.
aleg_urlstringconditionalA single destination. The older form of destinations — equivalent to a one-element list.
strategystringnosequential (default) tries each destination in turn. simultaneous rings them all at once.
timeout_secsintegernoHow long destinations ring. Defaults to 45 for simultaneous, and to the carrier's own timer for a single destination.
legsstringnoAccepted for forward compatibility and currently ignored — only a blind transfer of the A leg is implemented.
bleg_urlstringnoAccepted and currently ignored, as above.

Transfer to one number

curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls/650e8400-e29b-41d4-a716-446655440000/transfer \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "destinations": ["+919876543210"]
  }'

Ring several numbers, first to answer wins

Set strategy to simultaneous. Every destination rings at the same time; the first person to pick up is bridged to the caller and the other legs are cancelled automatically. You do not need to cancel them yourself, and there is no callback telling you which one answered.

curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls/$CALL_UUID/transfer \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "destinations": [
      "+919876543210",
      "+919876543211",
      "+919876543212"
    ],
    "strategy": "simultaneous",
    "timeout_secs": 45
  }'

With sequential the same list is a hunt group instead: the second number is only tried once the first fails or times out, so it occupies one channel at a time rather than three.

How many channels a fan-out uses

This is the part that surprises people. A simultaneous transfer uses one channel per destination, for the whole time they ring — plus the channel the original call is already using.

Channels
The original call1
Ringing 5 numbers simultaneously5
Total while ringing6

So ringing 10 numbers needs 11 channels, not 10. A request wider than your remaining concurrency is refused before anything is dialled, with an error that names the numbers:

ringing 10 numbers at once needs 10 free channels; this account has 1 of 10
in use, so 9 are free. Reduce the destination list or add concurrency.

Once someone answers, the other legs drop and you are back to 2 channels — the caller and the person who answered. Only the ring window is expensive.

Originating several legs at once counts against your calls per second limit as well as concurrency, and the two are bought separately — an account with plenty of channels can still have a CPS limit below its fan-out width. A request that would breach it is refused the same way:

ringing 10 numbers at once starts 10 calls in one second, above this
account's limit of 3 per second (0 already used). Reduce the destination
list, use the sequential strategy, or add CPS.

sequential starts one call at a time, so it is unaffected by CPS and is the right choice for a team where you do not expect everyone to answer.

Response

204 No Content on accept — the bridge happens asynchronously on the media server. A rejected request (bad number, duplicate destination, list too long, not enough concurrency) returns 400 with the reason, before any leg is dialled.

If the transfer is accepted but every destination then fails to answer, what the caller hears depends on whether a failover prompt is configured for the platform. With one set, they hear it and the call ends. Without one the call ends immediately and they hear nothing — so with a wide simultaneous transfer, where "nobody picked up" is routine, ask support to configure one.

fallback_url is not consulted on a failed transfer either way — it applies only when fetching VoxML from answer_url fails.


Start Recording

Begin recording an in-progress call. The recording runs asynchronously and ends when you call Stop, the call hangs up, or time_limit elapses. The finished recording is then stored and available from the Recordings API.

Endpoint

POSThttps://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/record

Request body

ParameterTypeRequiredDescription
time_limitintegernoMaximum recording duration in seconds. The recording auto-stops when it elapses.
file_formatstringnomp3 or wav. Default: mp3.
callback_urlstringnoAccepted but not called today — no recording webhook is sent. Use the Recordings API instead.
transcription_type, transcription_url, callback_methodstringnoAccepted for compatibility and ignored.

Example request

curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls/650e8400-e29b-41d4-a716-446655440000/record \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "time_limit": 3600,
    "file_format": "mp3"
  }'

Response

204 No Content. There's no synchronous recording URL. Once the recording finishes, find it with List Recordings filtered by call_uuid.


Stop Recording

End an in-progress recording before time_limit is reached.

Endpoint

DELETEhttps://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/record

Example request

curl -X DELETE https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls/650e8400-e29b-41d4-a716-446655440000/record \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN

Response

204 No Content. The recording finalises asynchronously and then appears in the Recordings API.


Play Audio

Stream one or more audio files into an active call. Multiple URLs are queued in order. Use loop for hold music, mix to overlay (e.g. background ambience while TTS plays).

Endpoint

POSThttps://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/play

Request body

ParameterTypeRequiredDescription
urlsstring[]yesArray of public URLs to mp3/wav files. Played in order.
lengthintegernoAccepted and ignored — playback is not truncated.
legsstringnoaleg, bleg, or both. Default: aleg.
loopbooleannoLoop the playlist indefinitely. Default: false.
mixbooleannoMix with existing audio instead of interrupting. Default: false.

Example request

curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls/650e8400-e29b-41d4-a716-446655440000/play \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://example.com/hold-music.mp3"],
    "loop": true
  }'

Response

204 No Content.


Speak Text

Convert text to speech and play it on the call.

Endpoint

POSThttps://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/speak

Request body

ParameterTypeRequiredDescription
textstringyesText to synthesise. Max 3000 characters.
voicestringnoVoice ID. Default: provider default for language.
languagestringnoBCP-47 language tag (e.g. en-US, en-IN, hi-IN). Default: en-US.
legsstringnoaleg, bleg, or both. Default: aleg.
loopbooleannoRepeat the synthesised audio. Default: false.
mixbooleannoMix with existing audio. Default: false.

Example request

curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls/650e8400-e29b-41d4-a716-446655440000/speak \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -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"
  }'

Response

204 No Content.


Send DTMF

Send DTMF (touch-tone) digits onto a leg of the call. Useful for navigating an IVR after a transfer.

Endpoint

POSThttps://api.tryvox.io/v1/voice/accounts/{auth_id}/calls/{call_uuid}/dtmf

Request body

ParameterTypeRequiredDescription
digitsstringyesSequence of DTMF digits: 0–9, *, #, A–D.
legstringnoaleg or bleg. Default: aleg.
durationintegernoTone duration per digit, in milliseconds.

Example request

curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls/650e8400-e29b-41d4-a716-446655440000/dtmf \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -H "Content-Type: application/json" \
  -d '{"digits": "1234*#"}'

Response

204 No Content.


Notes

  • All actions require the call to be in answered state. Calling them on a queued, ringing, hangup, or failed call returns 400 VALIDATION_FAILED ("call is not in an active state"). An unknown call_uuid returns 404 NOT_FOUND.
  • Actions execute asynchronously; the 204 response means "accepted", not "applied".
  • Newly-started Play or Speak interrupts any in-flight Play or Speak unless mix: true is set.
  • Audio URLs must be publicly reachable.
  • Recordings of both legs are mixed into a single file. There is no per-leg mode currently.
  • A failed transfer drops the caller. fallback_url is not consulted — see Transfer Call above.
  • legs and bleg_url are accepted on Transfer Call but currently ignored; only a blind transfer of the A leg is implemented.

On this page