AgentLine is a REST API for phone numbers, hosted AI calls, transcripts and inbound messages. The base URL is https://api.agentline.cloud. Authenticate account operations with Authorization: Bearer followed by your API key. Your application starts the call; AgentLine's hosted voice handles the conversation using the approved prompt.
Before running the examples
These commands use Bash. Store AGENTLINE_API_KEY privately in your shell; never put it in browser code or a public repository. Replace AGENT_ID, CALL_ID and TEST_PHONE with returned identifiers and a phone you control. Number purchases and calls incur charges. Review the number buying guide before provisioning.
Create an agent
curl --fail-with-body -X POST https://api.agentline.cloud/v1/agents -H "Authorization: Bearer $AGENTLINE_API_KEY" -H "Content-Type: application/json" -d '{"name":"Voice test","system_prompt":"You are an AI assistant conducting a short test with the account owner. Ask one question at a time. Do not promise a booking or perform external actions.","initial_greeting":"Hello, this is an AI voice test. Is now a good time?","voice_id":"female-2"}'Save the returned agent identifier. GET /v1/voices lists current voice presets; see the voice API guide for account defaults and overrides.
Provision a US or Canada number
curl --fail-with-body -X POST https://api.agentline.cloud/v1/numbers -H "Authorization: Bearer $AGENTLINE_API_KEY" -H "Content-Type: application/json" -d '{"agent_id":"AGENT_ID","country":"US","number_type":"local"}'Read the response before continuing. Number inventory and account eligibility can affect provisioning. Do not blindly retry a purchase after a timeout; first list GET /v1/numbers to determine whether the requested resource was created.
Place and inspect a call
curl --fail-with-body -X POST https://api.agentline.cloud/v1/calls -H "Authorization: Bearer $AGENTLINE_API_KEY" -H "Content-Type: application/json" -d '{"agent_id":"AGENT_ID","to_number":"TEST_PHONE"}'This places a real call immediately. Save its identifier, then inspect status:
curl --fail-with-body https://api.agentline.cloud/v1/calls/CALL_ID -H "Authorization: Bearer $AGENTLINE_API_KEY"
Wait for a terminal outcome before interpreting the final transcript. If polling, use a bounded timeout and approximately ten-second intervals; handle failure outcomes rather than waiting forever for completed. A network timeout after starting a call is not permission to place a duplicate call. Reconcile call history first.
curl --fail-with-body https://api.agentline.cloud/v1/calls/CALL_ID/transcript -H "Authorization: Bearer $AGENTLINE_API_KEY"
The transcript is evidence of the conversation, not proof that a calendar or CRM changed. Verify any external action against that system's result. GET /v1/calls lists call history. For continuous processing, use the documented webhook events such as call.completed and make your consumer tolerate duplicate deliveries.
Vapi request comparison
Vapi's call API uses its own call configuration. A saved-assistant outbound request can identify assistantId, phoneNumberId and customer.number. AgentLine uses agent_id and to_number with the agent's provisioned number. These are different resource models; do not rename keys in an existing integration and assume the event payloads will also match.
For Vapi, follow its server-event contract. For AgentLine, follow the live API schema. In both cases, keep provider-specific payload parsing at the integration boundary and normalize confirmed outcomes inside your application.
Update instructions and connect tasks
PATCH /v1/agents/{id} updates system_prompt, initial_greeting and voice_id for subsequent calls. A per-call system_prompt supplied to POST /v1/calls replaces the saved prompt for that call. Preserve the complete behavior and escalation rules when overriding it. A live lookup needs a persistent relay or webhook service; return facts and confirmed task results to hosted voice.
AgentLine's published rates are monthly plans from $20 with included US or Canada numbers, call minutes and SMS; beyond the plan, $3.00/month per number, $0.12/minute for calls (per-second after a one-minute minimum; zero-second calls are free), and $0.02 per SMS in either direction. Check pricing and your account's allowances before budgeting. Runtime hosting and external integrations can add costs.
Review AgentLine API schema and agent skill for request fields, current errors and event details. For owner escalation, see live call transfers.