{"slug": "i-built-a-voice-ai-agent-for-pre-visit-insurance-clearance", "title": "I Built a Voice AI Agent for Pre-Visit Insurance Clearance", "summary": "A developer built a Telnyx voice AI agent that automates pre-visit insurance clearance by turning patient phone calls into structured intake tickets. The agent uses Telnyx's Gather Using AI primitive to collect spoken requests, classify them, confirm details, create tickets, and send SMS confirmations, while routing non-clinical administrative data to billing staff.", "body_md": "Pre-visit insurance clearance is one of those workflows that sounds simple until you see how many phone calls it creates.\n\nA patient calls before an appointment. They need to know whether a procedure, test, or medication requires prior authorization. Staff need to identify the patient, understand what they are asking for, collect payer and provider context, decide how urgent it is, and route the request to the right billing queue.\n\nI built a Telnyx code example that turns that call into a structured intake ticket.\n\nThe code example:\n\n[https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-pre-visit-clearance-voice-agent-python](https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-pre-visit-clearance-voice-agent-python)\n\nA patient calls a Telnyx number. Telnyx sends the inbound call event to a Flask webhook. The app answers with Call Control, then starts `gather_using_ai`\n\nto collect the patient's spoken pre-clearance request as structured fields.\n\nWhen Telnyx finishes collecting those fields, the app receives `call.ai_gather.ended`\n\n. From there, the app classifies the request with AI Inference, confirms the details with the patient, creates a staff-facing ticket, sends the patient an SMS confirmation, and optionally alerts billing staff in Slack.\n\nThe agent is non-clinical. It doesn't give medical advice, approve or deny coverage, or diagnose. It collects administrative data and routes it — which is the bottleneck in a lot of healthcare revenue-cycle work.\n\nThe main Telnyx primitive here is Gather Using AI.\n\nThe app asks Telnyx to gather the fields it needs directly inside the call. The webhook response gives the backend something structured enough to use in a workflow.\n\nThat makes the rest of the app cleaner:\n\n`call.ai_gather.ended`\n\nadvances the workflowThe implementation patterns it covers:\n\n`command_id`\n\non Call Control commands`send_silence_when_idle`\n\nwhen answering\n\n```\ngit clone https://github.com/team-telnyx/telnyx-code-examples.git\ncd telnyx-code-examples/ai-pre-visit-clearance-voice-agent-python\ncp .env.example .env\npip install -r requirements.txt\npython app.py\nngrok http 5000\n```\n\nPoint your Telnyx Call Control Application webhook to:\n\n```\nhttps://<your-ngrok-domain>/webhooks/voice\n```\n\nSeed a patient:\n\n```\ncurl -X POST http://localhost:5000/patients \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"patient_id\":\"P001\",\"name\":\"Jordan Lee\",\"phone\":\"+15551112233\",\"dob\":\"03/15/1990\",\"insurance\":\"Blue Cross\",\"provider\":\"Dr. Smith\"}'\n```\n\nCall the number and say:\n\n```\nI need clearance for an MRI on my lower back.\n```\n\nThe app collects the request, classifies it, confirms the details, creates a ticket, and sends an SMS confirmation.\n\nReplace in-memory storage with your EHR, PMS, or billing system integration. Wire ticket completion into real prior auth submission APIs. Add privacy review and HIPAA-ready operational controls before production use. Queue Slack and SMS side effects so webhook responses stay fast.\n\nThe key boundary should stay the same: the agent collects and routes. Staff and payer systems make the actual coverage decisions.\n\n`call.ai_gather.ended`\n\n:", "url": "https://wpnews.pro/news/i-built-a-voice-ai-agent-for-pre-visit-insurance-clearance", "canonical_source": "https://dev.to/botoclock/i-built-a-voice-ai-agent-for-pre-visit-insurance-clearance-57fh", "published_at": "2026-07-22 22:51:50+00:00", "updated_at": "2026-07-22 23:29:49.663741+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "natural-language-processing", "developer-tools"], "entities": ["Telnyx", "Flask", "Slack"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-voice-ai-agent-for-pre-visit-insurance-clearance", "markdown": "https://wpnews.pro/news/i-built-a-voice-ai-agent-for-pre-visit-insurance-clearance.md", "text": "https://wpnews.pro/news/i-built-a-voice-ai-agent-for-pre-visit-insurance-clearance.txt", "jsonld": "https://wpnews.pro/news/i-built-a-voice-ai-agent-for-pre-visit-insurance-clearance.jsonld"}}