Make an outbound AI call
You need a secret key (af_sk_test_...) and the id of an assistant (agt_..., listed in the console and at GET /v1/agents).
Start the call
Section titled “Start the call”curl https://api.airfone.app/v1/calls \ -H "Authorization: Bearer af_sk_test_..." \ -H "Idempotency-Key: order-1042-reminder" \ -H "Content-Type: application/json" \ -d '{ "to": "+9779800000001", "agent_id": "agt_7Qm2", "context": { "order_id": "1042", "delivery_date": "2026-10-06" }, "metadata": { "crm_ticket": "T-881" } }'{ "id": "call_9f3a", "status": "queued", "to": "+9779800000001", "livemode": false }context is given to the assistant for this call only. metadata is yours. It comes back on every webhook about the call.
In test mode the call is simulated: no phone rings, and the assistant talks to a scripted caller. You get the same webhooks as a real call.
Follow the call
Section titled “Follow the call”Subscribe to call.started, call.ended and call.transferred (Receive webhooks), or poll GET /v1/calls/call_9f3a. When the call ends, fetch the transcript:
curl https://api.airfone.app/v1/calls/call_9f3a/transcript -H "Authorization: Bearer af_sk_test_..."Control a live call
Section titled “Control a live call”POST /v1/calls/{id}/transferwith{"to": "+9771..."}hands the call to a person.POST /v1/calls/{id}/endends it.