Initiate a call with an AI agent to a specified phone number
Initiate an outbound call from an AI agent to a specified phone number.
This endpoint requires an API key with the can_initiate_calls
permission.
Parameter | Type | Required | Description |
---|---|---|---|
phone_number | string | Yes | The phone number to call in E.164 format (e.g., +15551234567) |
agent_id | string/integer | Yes | The ID of the AI agent to use (can be database ID or assistant_id) |
contact_id | integer | No | The ID of an existing contact (if known) |
variables | object | No | Context variables to be used in the call |
Status Code | Error Code | Description |
---|---|---|
400 | missing_phone_number | Phone number is required |
400 | missing_agent_id | Agent ID is required |
400 | invalid_phone_number | The provided phone number is not valid |
400 | invalid_json | Invalid JSON payload |
401 | authentication_required | No API key was provided |
401 | invalid_key | The API key is invalid or inactive |
402 | insufficient_funds | Insufficient funds to make call |
403 | permission_denied | The API key doesn’t have the required permission |
403 | do_not_call | The phone number is on your Do Not Call list |
404 | agent_not_found | AI agent not found or you do not have access |
404 | no_phone_number | The agent does not have an assigned phone number |
500 | server_error | An unexpected server error occurred |
This endpoint requires that your account has sufficient wallet balance to initiate a call. If your balance is insufficient, you’ll receive a 402 Payment Required
response with details about your current balance and the required rate.
The API validates phone numbers to ensure they’re in a proper format. We recommend using the E.164 format (e.g., +15551234567) for all phone numbers.
You can provide context variables to the agent for personalized conversations. These variables can be referenced in the agent’s instructions using the {{variable_name}}
syntax.
Common variable uses:
customer_name
, company
, etc.)appointment_time
, appointment_type
, etc.)