Integrations

Receive Call Events

Get ringing, answered and ended events for your calls on your backend, and check they came from TryVox.

Have TryVox tell your backend when a call rings, is answered, and ends, so you can update your database.

How it works

TryVox ── POST (JSON, signed) ──▶ your /webhooks/tryvox ──▶ check signature ──▶ update database ──▶ 200

There are two ways to receive events. Both send the same JSON and are signed the same way, so one handler serves both.

Per call / per applicationAccount-wide subscription
Set upstatus_callback_url, hangup_url, webhook_secret on Make a Call or a Voice ApplicationPOST /v1/notifications/webhooks with events: ["call.ended"]
Eventsringing, answered, hung up, and the final resultthe final result of every call on the account, AI-agent and SIP-trunk calls included
Good forfollowing one call livekeeping call history in sync

Before you start

  • A public HTTPS URL for your server, for example ngrok http 3000.
  • A secret you choose, such as openssl rand -hex 32. Send it as webhook_secret on the call or application. For a subscription, TryVox returns the secret once when you create it.

Try it

This uses isFromTryVox() from the shared tryvox.js, placed in the same folder.

npm install express
TRYVOX_WEBHOOK_SECRET=your-secret node webhooks-express.js
webhooks-express.js
// Receive TryVox call events with Express. Run: npm run webhooks
import express from 'express';
import { isFromTryVox } from './tryvox.js';

const app = express();

// Replace with your database. Keyed on CallUUID (= request_uuid from Make a Call).
async function saveCall(callUUID, fields) {
  console.log('save', callUUID, fields);
}

// express.raw keeps the exact bytes TryVox signed. Don't use express.json() here.
app.post('/webhooks/tryvox', express.raw({ type: '*/*' }), async (req, res) => {
  if (!isFromTryVox(req.get('X-TryVox-Signature'), req.body)) return res.sendStatus(401);

  const event = JSON.parse(req.body);
  res.sendStatus(200); // answer fast, then do the work

  if (event.Event === 'Hangup') {
    // The call has ended. Status: completed | busy | no-answer | cancelled | failed
    await saveCall(event.CallUUID, {
      status: event.Status,
      reason: event.Reason,
      seconds: event.Billsec ?? 0,
      endedAt: event.EndTime,
    });
  } else {
    // Event "Status" (ringing | answered | hangup) or "Ring"
    await saveCall(event.CallUUID, { liveStatus: event.Status });
  }
});

const port = Number(process.env.PORT ?? 3000);
app.listen(port, () => console.log(`Listening on :${port}/webhooks/tryvox`));

Then place a call that reports to it:

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": "+918045671234",
    "to": "+919812345678",
    "answer_url": "https://api.tryvox.io/voice-test",
    "status_callback_url": "https://abc123.ngrok.app/webhooks/tryvox",
    "hangup_url": "https://abc123.ngrok.app/webhooks/tryvox",
    "webhook_secret": "your-secret"
  }'

Expected result

Your server logs the call progressing, then its result:

save 550e8400-… { liveStatus: 'ringing' }
save 550e8400-… { liveStatus: 'answered' }
save 550e8400-… { liveStatus: 'hangup' }
save 550e8400-… { status: 'completed', reason: 'NORMAL_CLEARING', seconds: 6, … }

The final event looks like this:

{
  "Event": "Hangup",
  "CallUUID": "550e8400-e29b-41d4-a716-446655440000",
  "RequestID": "550e8400-e29b-41d4-a716-446655440000",
  "Timestamp": "2026-10-30T10:35:12Z",
  "From": "+918045671234",
  "To": "+919812345678",
  "Direction": "outbound",
  "Status": "completed",
  "Reason": "NORMAL_CLEARING",
  "AccountId": "TJab12cd34",
  "StartTime": "2026-10-30T10:35:00Z",
  "EndTime": "2026-10-30T10:35:12Z",
  "Duration": 12,
  "Billsec": 6
}

The events

EventSent toStatus
Ringring_urlringing
Statusstatus_callback_urlringing, answered, hangup
Hanguphangup_url, and call.ended subscriptionscompleted, busy, no-answer, cancelled, failed

CallUUID is the request_uuid you got from Make a Call. For inbound calls, it's the call_uuid your answer_url received. To get the audio, look the call up in Recordings with ?call_uuid=.

Only these call events are sent today. Event names you may see listed elsewhere, such as call.started or call.answered subscriptions, are not emitted.

Rules that save you a bug

  • Verify the raw body. The signature covers the exact bytes TryVox sent. Parse the JSON only after checking it.
  • Answer 200 quickly (within 10 seconds), then do your work. Per-call events are retried after about 2, 8 and 25 seconds on a timeout, a 5xx, 408 or 429. Other 4xx responses are not retried.
  • Expect duplicates. A retry, or a call you hung up through the API, can deliver the same Hangup twice. Write the result idempotently, keyed on CallUUID.
  • Without a webhook_secret the events are not signed. Always set one.

Next step

Troubleshooting

ProblemFix
Every request fails the signature checkUse express.raw, not express.json(), on this route. Check the secret matches what you sent, and that your server clock is correct.
No events arriveThe URL must be public HTTPS. Set the URL on the call or application before the call starts.
Hangup arrives twiceExpected. Make the update idempotent.

On this page