Quickstart
This guide walks you through creating your first voice agent and making a call — all from the command line.
Prerequisites
- A Levrage.AI account (sign up)
- Your API key (Dashboard → Settings → Developers → API Keys)
- A source phone number (available in Dashboard → Numbers)
Step 1: Verify Your API Key
Test that your API key works:
Expected response:
Step 2: Browse Available Industries
Discover what agent types are available:
Step 3: Create a Voice Agent
Save the id from the response — you’ll need it for the next step.
The agent is automatically created with a production-ready prompt based on the agent_type and language you chose. You can also pass a custom prompt field to override it.
Step 4: Make a Call
The call will be initiated immediately. You can track its status via the call history endpoint.
Calls go out between 9 AM and 9 PM in the called person’s own time. A call asked for outside those hours — say a “payment failed” event at 1 AM — is queued: the answer is 202 with status: "queued", the queued call’s id and scheduled_for, and the call is placed when the hours open. Another request for the same number on the same agent before then joins it (one call, the latest metadata). Follow it with GET /calls/queued/{id}, cancel it with DELETE /calls/queued/{id} (e.g. the customer paid in the meantime), or send "queue_outside_hours": false to be refused with 422 OUTSIDE_CALLING_HOURS instead. Once placed, its metadata carries queued_call_id, so your webhook can match the call to the request.
Call again if not answered. Add "retry": {"max_retries": 3, "interval_value": 30, "interval_unit": "minutes"} — the same settings as a campaign’s retries — and a call that gets no answer, a busy line or voicemail (on_statuses) is called again, up to max_retries times and always inside calling hours. Or switch it on once for every API call to an agent with voice_response_settings.api_call_retry (dashboard: the agent’s call settings), and leave your requests as they are; "retry": {"enabled": false} skips it for one call. A call that rang out answers status: "handled" with the queued call’s id and scheduled_for (the next try); each retry’s metadata carries queued_call_id and call_attempt. A newer call to the same person on the same agent replaces retries still to come, and DELETE /calls/queued/{id} stops them.
Step 5: Check Call History
Each call record includes:
- status —
completed,no_answer,failed,voicemail - duration — Call length in seconds
- transcript — Full conversation transcript
- recording_url — Link to the call recording
- sentiment — AI-analyzed sentiment of the call
- details_collection — Any data the agent collected
Step 6: Run a Batch Campaign (Optional)
Scale to multiple calls with a campaign:
What’s Next?
- Agents Guide — Deep dive into agent configuration
- Campaigns Guide — Advanced campaign features (scheduling, retries, blackouts)
- Webhooks Guide — Get real-time notifications when calls end
- Error Handling — Handle errors and retries like a pro
- API Reference — Full endpoint documentation
