Voice Applications
Voice Applications
Bundle a set of webhook URLs into a reusable Voice Application that you can attach to phone numbers and SIP endpoints.
A Voice Application is a named bundle of webhook URLs (answer_url, fallback_url, hangup_url) that defines call behaviour. Instead of repeating the same URLs on every phone number you provision, you create one Application and attach it to many numbers and SIP endpoints. Edit the Application once, every attached resource updates.
You don't have to use Applications — every call API also accepts inline answer_url etc. Applications exist for the case where you want to manage call routing centrally.
What an Application is
An Application has:
name— your label.answer_url/answer_method— the URL TryVoxPOSTs to (orGETs from) when a call comes in or starts ringing. Returns VoxML.fallback_url/fallback_method— used ifanswer_urlfails or returns invalid VoxML.hangup_url/hangup_method— fired when the call ends with the final disposition.status_callback_url/status_callback_method— fired on call state transitions (ringing,answered,hangup).webhook_secret— optional, write-only secret used to sign the requests TryVox sends during this application's calls, including Gather and Redirect callbacks. Set it through the API or from the dashboard; responses reportwebhook_secret_setinstead of the value.status—active, orinactiveonce the Application has been deleted.
Endpoints
All paths are scoped to the authenticated account. You don't pass auth_id in the URL; the API key's tenant is derived from the credentials. Every Applications request requires approved KYC (403 KYC_REQUIRED otherwise).
| Method | Path | Purpose |
|---|---|---|
POST | /v1/voice/applications | Create an Application |
GET | /v1/voice/applications | List Applications |
GET | /v1/voice/applications/{id} | Get one Application |
PATCH | /v1/voice/applications/{id} | Update an Application |
DELETE | /v1/voice/applications/{id} | Delete an Application |
GET | /v1/voice/applications/{id}/usage | Numbers assigned to an Application |
* | /v1/voice/endpoints[...] | Manage SIP endpoints — register a SIP softphone or PBX trunk to an Application. |
Lifecycle
CREATE ───► ATTACH to number / SIP endpoint ───► receives calls
│
▼
UPDATE the URLs anytime
│
▼
DELETE when retiredAttaching to a number
After creating an Application, attach it to a phone number you own:
curl -X POST https://api.tryvox.io/v1/account/$TRYVOX_AUTH_ID/numbers/+919876543210/application \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H "Content-Type: application/json" \
-d '{"application_id": "8f7a4b2e-91c2-4f3d-9a1e-2c4b6d8f0a1c"}'See Configure a Number for the full request shape.
Attaching to a SIP endpoint
A SIP endpoint represents a registered softphone or PBX. Each endpoint has its own credentials and an application_id pointer — calls placed by that endpoint are routed through the Application.
See SIP Endpoints.
Quick example
Create an Application and pull it back to confirm:
# Create
APP=$(curl -s -X POST https://api.tryvox.io/v1/voice/applications \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H "Content-Type: application/json" \
-d '{
"name": "Main IVR",
"answer_url": "https://your-app.com/answer",
"answer_method": "POST",
"fallback_url": "https://your-app.com/fallback",
"hangup_url": "https://your-app.com/hangup"
}')
echo "$APP"
# Pull the ID back out of the response
APP_ID=$(echo "$APP" | jq -r .data.id)
# Verify
curl -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
https://api.tryvox.io/v1/voice/applications/$APP_IDNotes
- Update is a
PATCH, notPUT. Pass only the fields you want to change. - Deleting an Application that numbers are still assigned to is refused with
409 APPLICATION_IN_USEunless you pass?unassign_all=true, which detaches those numbers first. See Delete. - Deleted Applications cannot be restored. They disappear from the list and their
statusbecomesinactive. answer_methoddefaults toPOSTif you don't set it. Same for the other_methodfields.