Initiate Call
Initiate an outbound call from an AI agent to a specified phone number.Endpoint
Authentication
This endpoint requires an API key with thecan_initiate_calls
permission.
Request Body
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 |
Example Request Body
Response
Error Codes
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 |
Example Request
Example Response
Wallet Balance Requirements
This endpoint requires that your account has sufficient wallet balance to initiate a call. If your balance is insufficient, you’ll receive a402 Payment Required
response with details about your current balance and the required rate.
Phone Number Validation
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.Context Variables
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 information (
customer_name
,company
, etc.) - Appointment details (
appointment_time
,appointment_type
, etc.) - Custom context for specific business needs