Insurance Pre-Authorization
Gather all required clinical and demographic data from patients to complete prior authorization requests, reducing administrative burden on clinical staff.
Why this matters
HIPAA-compliant voice automation for patient engagement, scheduling, and clinical workflows. This example shows you how to automate insurance pre-authorization calls end-to-end with Guava's SDK — no telephony plumbing, no prompt engineering, just Python.
Installation
Install from Guava's private PyPI index. A public package is coming soon — the install command will simplify to pip install guava.
# Step 1: Install Guava
pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
# Public PyPI package coming soon — the install command will simplify to:
# pip install guava
# Step 2: Set your credentials
export GUAVA_API_KEY="..."
export GUAVA_AGENT_NUMBER="..."How it's built
Every Guava agent is a Python class. Walk through the key sections below, then grab the complete file at the end.
Imports
Import the Guava SDK and any helpers you need. guava.CallController is the base class for every voice agent.
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import osAgent setup
set_persona() defines how the agent presents itself. set_task() gives it its mission in plain English. The checklist drives the conversation — Guava works through it top-to-bottom, collecting Field values and speaking Say items as it goes.
class PreAuthBot(guava.CallController):
def __init__(self, patient_name: str, procedure: str, insurance: str):
super().__init__()
self.set_persona(
organization_name="Summit Orthopedic Group",
agent_name="Dana",
)
self.set_task(
objective=f"Collect information from {patient_name} to complete pre-authorization for {procedure} with {insurance}",
checklist=[
f"Introduce yourself and explain you're calling to gather info for {procedure} pre-auth.",
guava.Field(
key="insurance_id",
field_type="text",
description="Patient's insurance member ID",
),
guava.Field(
key="group_number",
field_type="text",
description="Insurance group number",
),
guava.Field(
key="primary_care_physician",
field_type="text",
description="Name of primary care physician for referral coordination",
),
guava.Field(
key="symptoms_duration",
field_type="text",
description="How long has the patient been experiencing symptoms?",
),
guava.Field(
key="prior_treatments",
field_type="text",
description="Any prior treatments or conservative care attempted?",
),
"Thank the patient and advise them the office will follow up within 2 business days.",
],
on_complete=lambda fields: print(f"Pre-auth data collected: {fields}"),
)
guava.dial(
controller=PreAuthBot,
controller_args={"patient_name": "Marcus Webb", "procedure": "MRI of left knee",
"insurance": "BlueCross BlueShield"},
to=os.environ["PATIENT_PHONE"],
agent_number=os.environ["GUAVA_AGENT_NUMBER"],
api_key=os.environ["GUAVA_API_KEY"],
)Platform performance
<1s
Response time
99.99%
Uptime SLA
13+
Industries served
Full example
The complete file — copy it, save it as example.py, and run it.
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os
class PreAuthBot(guava.CallController):
def __init__(self, patient_name: str, procedure: str, insurance: str):
super().__init__()
self.set_persona(
organization_name="Summit Orthopedic Group",
agent_name="Dana",
)
self.set_task(
objective=f"Collect information from {patient_name} to complete pre-authorization for {procedure} with {insurance}",
checklist=[
f"Introduce yourself and explain you're calling to gather info for {procedure} pre-auth.",
guava.Field(
key="insurance_id",
field_type="text",
description="Patient's insurance member ID",
),
guava.Field(
key="group_number",
field_type="text",
description="Insurance group number",
),
guava.Field(
key="primary_care_physician",
field_type="text",
description="Name of primary care physician for referral coordination",
),
guava.Field(
key="symptoms_duration",
field_type="text",
description="How long has the patient been experiencing symptoms?",
),
guava.Field(
key="prior_treatments",
field_type="text",
description="Any prior treatments or conservative care attempted?",
),
"Thank the patient and advise them the office will follow up within 2 business days.",
],
on_complete=lambda fields: print(f"Pre-auth data collected: {fields}"),
)
guava.dial(
controller=PreAuthBot,
controller_args={"patient_name": "Marcus Webb", "procedure": "MRI of left knee",
"insurance": "BlueCross BlueShield"},
to=os.environ["PATIENT_PHONE"],
agent_number=os.environ["GUAVA_AGENT_NUMBER"],
api_key=os.environ["GUAVA_API_KEY"],
)Run it
Start the agent. It will connect to Guava's infrastructure and begin accepting calls on your assigned number.
python example.py