Provisional Voice API Agents with Telnyx Telnyx launched a Provisional Agents pattern that combines a reusable AI Assistant with runtime business instructions selected by the called phone number, enabling business-specific voice agents on a single communications platform. The Node.js example maps inbound calls to business configs, renders appointment-scheduling instructions, and starts the AI Assistant with runtime greetings and instructions. This approach allows developers to attach AI voice assistants to live calls without multi-vendor handoffs. | name | provisional-telnyx-voice-api-agents | || |---|---|---|---| | title | Provisional Agents with Telnyx Voice API | || | description | Start one reusable Telnyx AI Assistant on Telnyx Voice API calls with runtime business instructions selected by the called phone number. | || | language | nodejs | || | framework | express | || | telnyx products | | || | channel | | Start one reusable Telnyx AI Assistant on Telnyx Voice API calls with runtime business instructions selected by the called phone number. This example shows a Provisional Agents with Telnyx Voice API pattern: base Telnyx AI Assistant + Telnyx Voice API call-time business config = business-specific voice agent The server answers inbound Telnyx Voice API calls, waits for the call.answered webhook, maps the called number to a business config, renders appointment-scheduling instructions, and starts the base Telnyx AI Assistant with a runtime greeting and instructions . Answer Call : POST /v2/calls/{call control id}/actions/answer - API reference https://developers.telnyx.com/api-reference/call-commands/answer-call Start AI Assistant : POST /v2/calls/{call control id}/actions/ai assistant start - API reference https://developers.telnyx.com/api-reference/call-commands/start-ai-assistant Create Call : POST /v2/calls - optional outbound test helper caller | v telnyx number | v voice api webhook | v express server | +-- call.initiated - answer call | +-- call.answered | +-- called number - examples/number-routing.json +-- business config - prompt template +-- ai assistant start with runtime instructions and greeting Telnyx is an AI Communications Infrastructure platform that combines Voice API call control and AI Assistants on one communications platform. That lets your webhook answer a call, select context from your own application data, and attach an AI voice assistant to the same live call without handing the call across multiple vendors. Copy .env.example to .env and fill in: | Variable | Type | Example | Required | Description | Where to get it | |---|---|---|---|---|---| TELNYX API KEY | string | KEY your telnyx api key here | yes | Telnyx API v2 key used for Voice API commands | | TELNYX PUBLIC KEY string base64 public key Webhook signing docs https://developers.telnyx.com/docs/api/v2/overview webhook-signing BASE ASSISTANT ID string assistant-... yes for live calls AI Assistants https://portal.telnyx.com/ /ai/assistants PORT number 5000 TELNYX CONNECTION ID string connection-id npm run call Portal https://portal.telnyx.com TELNYX FROM NUMBER string +15551111111 npm run call Numbers https://portal.telnyx.com/numbers/my-numbers TEST TO NUMBER string +15552222222 npm run call Prerequisite: Node.js 18 or newer. git clone https://github.com/team-telnyx/telnyx-code-examples.git cd telnyx-code-examples/provisional-telnyx-voice-api-agents-nodejs cp .env.example .env npm install Create a generic Telnyx AI Assistant for appointment scheduling. Keep it business-agnostic: model, voice, tools, and stable behavior belong on the base assistant. Clinic names, hours, services, and greetings come from runtime config in this example. Set the base assistant id in .env : BASE ASSISTANT ID=assistant-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Preview the generated Telnyx Voice API ai assistant start payload without making a call: npm run preview -- smile-dental Try another config: npm run preview -- northside-medical Start the server: npm start Expose it publicly: ngrok http 5000 Configure your Telnyx Voice API application webhook URL: https://