Place a REST call with the voice AI agent definition and wait for the callee to speak before the agent responds.
Also called AI outbound calling, automated outbound AI calls
outbound
The claim
POST /api/calling/calls with command: dial and the SWML dial variant, which the vendored REST spec defines with from and swml required. The document is an ordinary AgentBase rendered with _render_swml(). Two entries in its ai.params do two different jobs. The ai params reference says direction “forces the direction of the call to the assistant”. It says wait_for_user: true means the “agent will wait for the user to speak first”.
How it works
class ReminderAgent(AgentBase):
def __init__(self):
super().__init__(name="reminder", route="/reminder")
self.prompt_add_section("Role", "You are calling from Ridgeline Cycles ...")
self.set_params({"direction": "outbound", "wait_for_user": True,
"outbound_attention_timeout": 20000})
def place(to):
return client.calling.dial(**{
"from": FROM, "to": to, "swml": json.loads(agent._render_swml()),
"status_url": f"{PUBLIC_URL}/call-status",
"status_events": ["ringing", "answered", "ended"], "timeout": 25})
The bundled schema bounds outbound_attention_timeout to 10,000 through 600,000, and the verifier reads that range from the schema. The spec has a second dial variant, Calling.CallCreateParamsURL, that takes url in place of swml; this recipe inlines the document instead. The swml/ surface is a plain-SWML version of the document with the same two params. The agent’s rendering opens with answer and carries a pom prompt, which the verifier asserts.
Limitations
The verifier proves the request. What the callee hears, and when the agent first speaks, is a live call.
This agent has no tools, which is what lets the document travel inline. An agent with tools renders each tool’s web_hook_url from its own host (agent_base.py, _build_webhook_url), so it has to be running somewhere the platform can reach.
What to change first
Remove "direction": "outbound" from set_params and run the verifier. The params assertion fails, which is the point: the param is what tells the platform which side of the call the assistant is on.