The Studio REST API lets you trigger flows programmatically and also retrieve information about your flows and executions. The Incoming Request Trigger on your flow will fire when you create an Execution via the REST API. Important: When triggering flows with the API, don't forget to also configure your 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 interact with your IVR.
HTTP POST to create an Execution
To trigger a new Execution of your Flow via the REST API, make an HTTP POST request to:
||The Contact phone number to start a Studio Flow Execution, available as variable
||The Twilio phone number to send messages or initiate calls from during the Flow Execution, available as variable
JSON data that will be added to your flow's context and can be accessed as variables inside your flow. For example, if you pass in
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 your JSON string. See curl examples below.
The Executions resource page documents examples in other languages. For information on the other resources, check out the full REST API documentation for each resource below.
|Allows you to retrieve a list of Flows created in your account.|
|Allows you to create Executions that will act on the incoming REST API trigger for the Flow specified.|
|The execution context gives a JSON representation of your flow and its widgets at the time of execution.|
|Each move through your flow is a Step. The Steps resource allows you to retrieve the steps for a given execution.|
|Step context ties a JSON representation of data parsed as part of an individual widget.|
HTTP requests to the REST API are protected with HTTP Basic Authentication like other Twilio REST APIs. To learn more about how Twilio handles authentication, please refer to our security documentation.
To authenticate, you will need your Account SID and Auth Token from the Twilio Console:
You will use your Twilio Account SID as the
username and your Auth Token as the
password for HTTP Basic authentication.
If you use one of our helper libraries for C#, Java, Node.js, PHP, Python, or Ruby; you needn't worry about the URL for the API or how to do HTTP Basic authentication. The helper libraries take care of it for you.
During the beta of Twilio Studio (prior to August 1st 2018), flow Executions were named Engagements, and we had an API available for creating Engagements. We got feedback that the word engagements was confusing, so we've changed it: We have renamed Engagements to Executions across the Studio product and API but maintained support for Engagements during this transition. There is no functional difference between /Engagements and /Executions in the API. The Engagements API endpoint is now deprecated:
- /Engagements will continue to function as is until the end of 2018.
- Customers should move to /Executions (available via REST and in Twilio helper libraries)
- The /Engagements API endpoint will cease to function in January 2019 and be removed from new versions of the Twilio helper libraries at that time.