Voice API

Make a Call

Place an outbound voice call.

Initiate an outbound voice call. The call dials asynchronously; the response returns as soon as TryVox queues the request.

Your app
POST https://api.tryvox.io/v1/voice/accounts/{auth_id}/calls
request
TryVox
processing
response
Response 201
returned to your app

Endpoint

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

Prerequisites

  • The from number must be an active TryVox number owned by the account identified by {auth_id}. See What happens if from is not yours.
  • KYC must be approved on the account, or the request returns 403 KYC_REQUIRED.
  • Pay-as-you-go calls need a positive wallet balance.

Request body

FieldTypeRequiredDescription
fromstringyesA TryVox number owned by this account, in E.164 format (e.g. +918045671234). A call to a phone number without it returns 400. Optional only when to is a SIP URI.
tostringyesDestination number in E.164 format. The format is not validated when the request is accepted.
answer_urlstringyesURL TryVox POSTs when the call answers. Must return VoxML.
answer_methodstringnoHTTP method for answer_url. Default: POST.
fallback_urlstringnoURL used if answer_url cannot be fetched successfully, such as a timeout or HTTP error.
fallback_methodstringnoHTTP method for fallback_url. Default: POST.
ring_urlstringnoURL called once the destination starts ringing.
ring_methodstringnoHTTP method for ring_url. Default: POST.
hangup_urlstringnoURL called once the call ends, with the final CDR.
hangup_methodstringnoHTTP method for hangup_url. Default: POST.
status_callback_urlstringnoURL called for ringing, answered, and hangup transitions.
status_callback_methodstringnoHTTP method for status_callback_url. Default: POST.
webhook_secretstringnoYour per-account secret used to sign this call's POST requests to Answer, Fallback, Ring, Hangup, and Status URLs. It is write-only.
caller_namestringnoDisplay name to send as caller-name where the carrier supports CNAM. Free-form text.
ring_timeoutintegernoRing timeout in seconds. Default: 60.
time_limitintegernoHard maximum call duration in seconds. Default: 14400 (4 hours).
machine_detectionstringnoNot currently available. Accepted for compatibility but has no effect — every call is treated as answered by a person. See the note below.

Bulk calls

The same endpoint also accepts a bulk request — pass an array of single-call bodies:

{
  "calls": [
    {"from": "+14155551234", "to": "+14155556789", "answer_url": "https://your-app.com/answer"},
    {"from": "+14155551234", "to": "+14155556790", "answer_url": "https://your-app.com/answer"}
  ]
}

Calls in a bulk request are placed one after another, not in parallel. The response wraps each created call in a calls array. A call that fails — validation, balance, or concurrency — is left out of the array without an error, so compare the array against your request to find calls that were not placed. A request with more calls than the platform's bulk cap is rejected with 400 VALIDATION_FAILED ("bulk call limit exceeded").

Example request

curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/calls \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "from": "+14155551234",
    "to": "+14155556789",
    "answer_url": "https://example.com/answer",
    "ring_url": "https://example.com/ringing",
    "hangup_url": "https://example.com/hangup",
    "status_callback_url": "https://example.com/status",
    "webhook_secret": "replace-with-your-account-webhook-secret",
    "ring_timeout": 30,
    "time_limit": 3600
  }'

Response

201 Created:

{
  "data": {
    "request_uuid": "550e8400-e29b-41d4-a716-446655440000",
    "account_id": "TJab12cd34",
    "auth_id": "TJab12cd34",
    "from": "+14155551234",
    "to": "+14155556789",
    "direction": "outbound",
    "status": "queued",
    "start_time": "2026-04-09T10:30:00Z",
    "duration": 0,
    "billsec": 0
  }
}

request_uuid is the stable identifier for the call. Use it on Get Call, Hangup, and Call Actions. Webhook payloads identify the call with CallUUID; lifecycle status payloads also include RequestID.

Webhooks

WebhookWhen
ring_urlDestination starts ringing.
answer_urlCall connects. Must return VoxML to control the call.
fallback_urlanswer_url timed out or returned an HTTP error.
hangup_urlCall ends. Receives final timing, billing, and media-quality fields when available.

For account-level subscriptions to all call.* events, see Webhook Subscriptions.

Errors

StatusCodeReason
400VALIDATION_FAILEDto or answer_url missing, or bulk request over the cap
401INVALID_CREDENTIALSAuth ID / Auth Token bad
402INSUFFICIENT_BALANCEPay-as-you-go call and an available wallet balance under ₹10
403KYC_REQUIREDThe account's KYC is not approved
403FORBIDDENURL auth_id doesn't match the authenticated account
429RATE_LIMITEDConcurrent-call limit reached, or the call could not be admitted within the calls-per-second queue window
502SERVICE_UNAVAILABLENo media server available

What happens if from is not yours

Ownership of from is checked when the call is dialled, not when the request is accepted. A request with a from your account does not own still returns 201 with status: "queued". The call is then never dialled: its status becomes failed, hangup_cause is set to a dispatch failure such as DISPATCH_FAILED or ALL_SERVERS_EXHAUSTED, and no webhook is sent. Check the call with Get Call if a call stays silent.

Notes

  • Phone numbers must be in E.164 format (e.g. +14155551234).
  • Call records are kept for 24 hours. After that, List Calls and Get Call no longer return the call — use Call Records for history.
  • The answer_url must be publicly reachable and respond with valid VoxML within 15 seconds.
  • Answering-machine detection is not available yet. machine_detection is still accepted so existing integrations keep working, but no detection runs and no result is reported. Do not rely on it to skip voicemail. It is not charged.
  • The response field is request_uuid, not call_uuid — there is no separate call UUID today.

On this page