You can now subscribe to Studio Events for Executions and Steps instead of polling via the REST API. Simplify your data ingestion with Event Streams for Studio.
An Execution represents a specific person's run through a Flow. An execution is active while the user is in the Flow, and it is considered ended when they stop or are kicked out of the Flow.
HTTP requests to Studio's REST API are protected with HTTP Basic authentication. To learn more about how Twilio handles authentication, please see our security documentation. You will use your Twilio account SID as the username and your auth token as the password for HTTP Basic authentication.
When triggering flows with the API, don't forget to also configure your Twilio Phone Number with your Studio Flow. If you don't configure the phone number, users won't be able to reply to your messages or call back to your IVR.
The contact_sid
property has been deprecated and will be replaced with a static placeholder value in the v1 API. Use contact_channel_address
instead to uniquely track contacts. For the best experience and latest features, upgrade to the v2 API.
You can now subscribe to Studio Events for Executions and Steps instead of polling via the REST API. Simplify your data ingestion with Event Streams for Studio.
The unique string that we created to identify the Execution resource.
^FN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Execution resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Contact.
^FC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The phone number, SIP address or Client identifier that triggered the Execution. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formatted as name@company.com
. Client identifiers are formatted client:name
.
The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution.
The status of the Execution. Can be: active
or ended
.
active
ended
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The URLs of nested resources.
POST https://studio.twilio.com/v1/Flows/{FlowSid}/Executions
Studio Rate Limits
Be sure to review Studio's rate limits when building your application.
The SID of the Excecution's Flow.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Contact phone number to start a Studio Flow Execution, available as variable {{contact.channel.address}}
.
The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable {{flow.channel.address}}
. For SMS, this can also be a Messaging Service SID.
JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in Parameters={"name":"Zeke"}
, a widget in your Flow can reference the variable {{flow.data.name}}
, which returns "Zeke". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string.
Create a new Execution with JSON data to be added to your flow's context. You will be able to access these parameters as variables inside your Studio flow.
GET https://studio.twilio.com/v1/Flows/{FlowSid}/Executions/{Sid}
The SID of the Flow with the Execution resource to fetch
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Execution resource to fetch.
^FN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
GET https://studio.twilio.com/v1/Flows/{FlowSid}/Executions
Execution resources are listed in reverse chronological order (most recent is first).
The SID of the Flow with the Execution resources to read.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Only show Execution resources starting on or after this ISO 8601 date-time, given as YYYY-MM-DDThh:mm:ss-hh:mm
.
Only show Execution resources starting before this ISO 8601 date-time, given as YYYY-MM-DDThh:mm:ss-hh:mm
.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
Executions can be filtered by the date they were created (30-day max range).
POST https://studio.twilio.com/v1/Flows/{FlowSid}/Executions/{Sid}
An active Execution can be updated to "ended" using the REST API. Once ended, subsequent widgets in the Flow are not processed, and any new events that Studio receives for that Execution are rejected.
The SID of the Flow with the Execution resources to update.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Execution resource to update.
^FN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The status of the Execution. Can only be ended
.
active
ended
DELETE https://studio.twilio.com/v1/Flows/{FlowSid}/Executions/{Sid}
The SID of the Flow with the Execution resources to delete.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Execution resource to delete.
^FN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34