Initiate an outbound call
Initiate an outbound call
https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/callUse this endpoint to initiate an outbound call to the specified number and create an agent that joins the target RTC channel. The agent waits for the callee to answer.
Request
Path parameters
The App ID of the project.
Request body
BODYrequired
- name stringrequired
The name identifier of the call session.
- sip objectrequired
SIP (Session Initiation Protocol) call configuration object.
Show propertiesHide properties
- to_number stringrequired
Called number (target phone number), in E.164 format.
- from_number stringrequired
Caller ID (the number that initiated the call), in E.164 format.
- sip_rtc_uid stringrequired
The RTC UID used by the SIP gateway.
- sip_rtc_token stringrequired
The RTC token used by the SIP gateway.
- pipeline_id string
The unique ID of a published project in AI Studio.
- properties objectrequired
Call attribute configuration. The content of this field varies depending on the invocation method:
- Using pipeline ID: Simply pass in
channel,token, andagent_rtc_uid. - Using complete configuration: Pass in the complete parameters of the Start a conversational AI agent
properties, including all required fields such aschannel,token,agent_rtc_uid,remote_rtc_uids,tts, andllm.
Show propertiesHide properties
- channel stringrequired
RTC channel name.
- token stringrequired
RTC Channel Token.
- agent_rtc_uid stringrequired
The agent's user ID in the RTC channel.
- Using pipeline ID: Simply pass in
Response
-
If the returned status code is
200, the request was successful. The response body contains the result of the request.OK
- agent_id string
Unique ID of the agent instance. Use it to query call status, control call flow, and perform other operations.
-
If the returned status code is not
200, the request failed. The response body includes the error code and description. Refer to status codes to understand the possible reasons for failure.Error Response
- error_type string
The type of error that occurred.
- description string
A detailed description of the error.