Place an outbound AI call
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
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})What the platform receives, trimmed:
{"command": "dial",
"params": {"from": "+15550001111", "to": "+15552223333", "timeout": 25,
"swml": {"version": "1.0.0", "sections": {"main": [{"answer": {}},
{"ai": {"prompt": {"pom": [...]},
"params": {"direction": "outbound", "wait_for_user": true,
"outbound_attention_timeout": 20000}}}]}}}}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.
Where this sits
Before this
Seen in a build
One of 6 recipes composed by AI appointment reminder caller: consent, do-not-call and calling hours enforced before the dial.
Seen in a build
One of 3 recipes composed by AI customer survey caller: a prefab agent with validation the handler owns.
Seen in a build
One of 5 recipes composed by AI hiring phone screen: a voice form the candidate cannot reorder or skip.
Seen in a build
One of 6 recipes composed by AI support line with callback: the issue survives the queue and the return call without the model carrying it.
Seen in a build
One of 8 recipes composed by Appointment confirmation by SMS: a text built by the handler and a reply that calls the customer back.
Seen in a build
One of 7 recipes composed by IVR navigator: an AI agent that works through phone menus to reach a human.