AI Voice Agent Examples and Testing
This page shows copy-pasteable AI Voice Agent scenarios. Use the examples as integration fixtures, then replace IDs and phone numbers with your own customer resources.
Simple Receptionist
Business scenario: a caller reaches a front desk DID, asks for sales or support, and the AI agent collects basic details before ending the call.
Flow:
Customer calls DID
↓
DID routes to AI agent
↓
Agent greets caller
↓
Caller says Sales or Support
↓
Agent collects details
↓
Agent ends call or transfers
Create the agent:
curl -sS https://api.minivoice.eu/v1/ai/agents \
-X POST \
-H 'Authorization: Bearer $MINIVOICE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Receptionist",
"greeting": "Thanks for calling Acme. Are you calling for sales or support?",
"instructions": "Route callers conversationally. For sales, ask for company name and team size. For support, ask for account email and issue summary. Keep responses short.",
"voice": "alloy",
"runtime_limits": {
"max_turns": 8,
"max_call_seconds": 300
}
}'
Route the DID:
curl -sS https://api.minivoice.eu/v1/dids/did_123/routing \
-X PATCH \
-H 'Authorization: Bearer $MINIVOICE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"route_mode": "ai_agent",
"ai_agent_id": "agent_20260707T120000.000000000"
}'
Expected result: inbound callers hear the AI greeting and an AI session appears in GET /v1/ai/sessions.
Appointment Confirmation
Business scenario: call a customer and confirm tomorrow's appointment.
curl -sS https://api.minivoice.eu/v1/ai/calls \
-X POST \
-H 'Authorization: Bearer $MINIVOICE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "agent_20260707T120000.000000000",
"from": "+15551230002",
"to": "+15551230001",
"context": {
"customer_name": "Jordan Lee",
"appointment_time": "2026-07-08T15:30:00Z",
"location": "Downtown Clinic",
"goal": "Confirm whether the customer can attend."
}
}'
Expected result:
{
"data": {
"status": "dialing",
"runtime_type": "auto",
"media_mode": "turn_based"
}
}
After the call, read the session and store campaign_confirmed, callback_requested, and human_requested if present.
Transfer to Human
Business scenario: AI answers common questions but transfers billing calls to a human.
{
"name": "Billing Receptionist",
"greeting": "Thanks for calling. I can help with billing questions or connect you to the billing team.",
"instructions": "Answer simple payment questions. If the caller asks to speak with a person, transfer to Billing.",
"transfer_tool_description": "Transfer when the caller asks for a person, billing specialist, invoice dispute, or payment problem.",
"transfer_destinations": [
{
"id": "billing",
"label": "Billing",
"type": "phone",
"value": "+15551230010"
}
]
}
Expected session result:
{
"data": {
"completion_reason": "transferred",
"transfer_target": "+15551230010"
}
}
Failure Tests
| Test | Request | Expected result |
|---|---|---|
| Paused agent outbound | POST /v1/ai/calls with paused agent_id | ai_agent_not_available |
| Invalid caller ID | from not owned by the customer | invalid_from |
| Oversized context | Context larger than 4096 bytes | invalid_context |
| Missing trunk | No active outbound trunk | no_active_trunk |
| Bad transfer destination | transfer_destinations[].type is not phone or sip | invalid_ai_agent |
Manual Checklist
- Create an agent and save the returned
id. - Fetch
/v1/ai/modelsand/v1/ai/voicesto verify your selected model and voice. - Route a DID to the agent and place an inbound call.
- Create an outbound AI call with realistic
context. - Fetch the returned AI session.
- Confirm session fields are stored without relying on internal provider fields.
- Run one failure test for each integration path before going live.