Objective
Guide developers on the correct architecture for initiating outbound phone calls that run Twilio Studio flows.
Product
Studio Flow
Objective
A frequent mistake is placing an outbound call via the Programmable Voice Calls API (POST /2010-04-01/Accounts/{AccountSid}/Calls.json) with the Url parameter pointed to a Studio Flow Webhook URL (https://webhooks.twilio.com/.../Flows/{FlowSid}).
-
Why this fails: Studio webhook URLs expect a call in the
ringingstate (such as an incoming call). When Voice API places an outbound call, the call is already answered andin-progresswhen instructions are fetched fromUrl. Studio cannot bind an execution to an already-answered call via that webhook, returning anHTTP 400and triggering Error 11200.
Recommended Architecture: Studio Executions REST API
To run an outbound call through Studio, initiate an execution via the Studio REST API and let Studio dial the user via the Make Outgoing Call widget.
Step 1: Configure the Studio Flow
- Open the Studio Canvas.
- Ensure you have a separate flow for outbound logic if your inbound flow handles incoming caller menus.
- Locate the Trigger widget at the top of the canvas.
- Drag a Make Outgoing Call widget onto the canvas.
- Connect the REST API dot on the Trigger widget to the Make Outgoing Call widget.
- Configure the Make Outgoing Call widget:
-
To:
{{flow.data.To}}(or a variable passed via parameters) - From: A Twilio number from your account
- Timeout: Set desired ringing duration (default is 60 seconds).
- Machine Detection: Configure AMD if required.
-
To:
- Connect the Answered transition of the Make Outgoing Call widget to the rest of your call workflow (e.g., Say/Play, Gather, or Connect Call To).
Step 2: Trigger the Execution via REST API
Initiate the call by creating a new execution rather than placing a direct Voice API call:
curl -X POST "https://studio.twilio.com/v2/Flows/{FlowSid}/Executions" \
-u {AccountSid}:{AuthToken} \
--data-urlencode "To=+1234567890" \
--data-urlencode "From=+1098765432" \
--data-urlencode "Parameters={\"customParam\":\"value\",\"alertType\":\"CareGiver\"}"-
ToandFrom: Studio assigns these to the execution context. -
Parameters: Accepts a JSON-encoded string of key-value pairs, accessible inside the flow as{{flow.data.ParameterKey}}.