Integrations
Appointment Reminder Calls
Your application calls each customer before their appointment, with an AI agent that knows their name, date and time.
Your application decides when to call. At that time your backend asks TryVox to start an AI call, passing the appointment details, and then checks how the call went.
How it works
your appointment system ── at the scheduled time ──▶ your backend
── POST /v1/ai/integrations/{id}/calls (dynamic_variables, client_ref) ──▶ TryVox ──▶ AI agent ──▶ customer
your backend ── GET /v1/ai/calls/{conversation_id} until it ends ──▶ result saved on the appointmentTryVox has no scheduler or campaign API. Your own scheduler, such as a cron job or a queue worker, triggers each call.
Before you start
- An AI provider connected and a number bound. Use Vapi, ElevenLabs, LiveKit or Bolna. Retell calls are started from Retell instead: see Retell.
- The integration ID in
.envasINTEGRATION_ID, plus the sharedtryvox.js. - An agent prompt that uses the variables, such as
Hi {{customer_name}}, this is {{business_name}} reminding you of your appointment on {{appointment_date}} at {{appointment_time}}.
Example
// Appointment reminder: your app decides when to call; TryVox's AI outbound API
// places the call through your connected AI agent.
// Run: npm run reminder (calls the sample appointment below once)
import { realpathSync } from 'node:fs';
import { pathToFileURL } from 'node:url';
import { env, tryvox } from './tryvox.js';
const { INTEGRATION_ID } = env('INTEGRATION_ID');
// Start the AI call. Your scheduler (cron job, queue worker) calls this at the right time.
export async function sendReminder(appointment) {
// This endpoint answers with the call object itself, not wrapped in "data".
return tryvox('POST', `/v1/ai/integrations/${INTEGRATION_ID}/calls`, {
to: appointment.phone,
dynamic_variables: {
customer_name: appointment.customerName,
appointment_date: appointment.date,
appointment_time: appointment.time,
business_name: appointment.businessName,
},
client_ref: `appointment_${appointment.id}`, // comes back on the call
});
}
// TryVox doesn't push AI call results yet, so check until the call has ended.
export async function waitForResult(conversationId, { everyMs = 15000, timeoutMs = 15 * 60000 } = {}) {
const deadline = Date.now() + timeoutMs;
for (;;) {
const call = await tryvox('GET', `/v1/ai/calls/${encodeURIComponent(conversationId)}`);
if (call.status === 'completed' || call.status === 'failed' || Date.now() > deadline) return call;
await new Promise((r) => setTimeout(r, everyMs));
}
}
// Run directly from the command line?
if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
const appointment = {
id: 12345,
phone: process.env.TEST_PHONE ?? '+919812345678',
customerName: 'Rahul',
date: '4 November',
time: '3:00 PM',
businessName: 'City Dental Clinic',
};
const call = await sendReminder(appointment);
console.log('started', call.conversation_id, call.status);
const result = await waitForResult(call.conversation_id);
console.log(result.client_ref, result.status, `${result.duration ?? 0}s`);
}npm run reminderThe request it sends:
{
"to": "+919812345678",
"dynamic_variables": {
"customer_name": "Rahul",
"appointment_date": "4 November",
"appointment_time": "3:00 PM",
"business_name": "City Dental Clinic"
},
"client_ref": "appointment_12345"
}What happens
- TryVox answers
201withconversation_id,client_ref: "appointment_12345", andstatus: "initiated". - The customer's phone rings from your TryVox number, and the agent reads out their appointment.
waitForResult()checksGET /v1/ai/calls/{conversation_id}untilstatusiscompletedorfailed. The result includesduration, plustranscriptandanalysiswhen your provider reports them. Useclient_refto save it on the right appointment.
started <conversation-id> initiated
appointment_12345 completed 52sProduction note
- Results are polled, not pushed. TryVox doesn't send AI call results to your backend yet, so check periodically, as
waitForResult()does. - Each integration allows 5 calls at once and 30 a minute by default. Spread calls out, and retry a
429 RATE_LIMITEDlater. dynamic_variablesvalues must be strings.
Related docs
- Start an AI Outbound Call: every field and error.
- AI Agents API: call history and limits.