Skip to main content

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​

TestRequestExpected result
Paused agent outboundPOST /v1/ai/calls with paused agent_idai_agent_not_available
Invalid caller IDfrom not owned by the customerinvalid_from
Oversized contextContext larger than 4096 bytesinvalid_context
Missing trunkNo active outbound trunkno_active_trunk
Bad transfer destinationtransfer_destinations[].type is not phone or sipinvalid_ai_agent

Manual Checklist​

  1. Create an agent and save the returned id.
  2. Fetch /v1/ai/models and /v1/ai/voices to verify your selected model and voice.
  3. Route a DID to the agent and place an inbound call.
  4. Create an outbound AI call with realistic context.
  5. Fetch the returned AI session.
  6. Confirm session fields are stored without relying on internal provider fields.
  7. Run one failure test for each integration path before going live.