This Twilio product is currently available as a pilot release. Some features are not yet implemented and others may be changed before the product is declared as Generally Available. Pilot and beta products are not covered by a Twilio SLA.
Learn more about how Twilio supports products that are not yet GA.
Studio v2 REST API is currently in pilot and available by invitation only. To receive an invite, contact Twilio Support.
Using the Studio Canvas in Twilio Console, you can quickly build Studio Flows in a visual editing environment. With the new Studio REST API, you can now create, publish, and manage those same Flows programmatically without having to log in to Twilio Console.
Common Use Cases for the Flows API:
- Store Flows in your own version control
- Integrate into CI/CD pipeline to automate Studio deployments
- Programmatically move Flows between accounts or subaccounts
- Swap Flow variables for use in different environments
- Expose editability to end users without having to grant them access to Console
The Studio v2 API mirrors the existing v1 API but provides additional endpoints and methods for managing Flows, including the ability to read, create, update and validate Flow definitions. The Flow definition itself is now standardized as a JSON schema.
Flowsresource in v2 has new Create, Update and Validate endpoints and additional properties.
- The underlying JSON definition of a Flow is exposed as a public JSON Schema instead of an internal representation.
TestUsersresource is available to manage the contact addreses that can be used to test draft revisions of a Flow.
contact_sidis deprecated and will not be available in v2
contact_channel_addressinstead to uniquely track contacts.
Engagementsendpoints were previously deprecated and are not included in v2. Use the
- Flow Import/Export JSON feature within the Studio Console UI is not compatible with the Flows API JSON. Specifically...
- JSON definitions fetched from the API cannot be imported via the Console UI import feature.
- JSON definitions exported from the Console UI export feature cannot be used as the
Definitionin the POST to the Flows API.
- Request body when sending POST to
Flowscannot be larger than 1 MB; thus, the Flow JSON definition itself must be less than 1 MB.
The standard Twilio server-side helper libraries can be used to access the v2 endpoints as of the January 8, 2020 release. To access the v2 endpoints via the Twilio helper libraries, use the v2 namespace when referencing the client.
Example using the Node.js helper library:
const client = require('twilio')(accountSid, authToken); client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fetch() .then(flow => console.log(flow.friendlyName));
All v2 endpoints are available during the pilot.
|Allows you to create, read and update Flows created in your account.|
|Provides complete history of all changes to a Flow.|
|Allows you to validate a Flow definition without creating a new revision.|
|Test User||Allows you to manage the contact addresses that can test draft versions of a Flow.|
|Executions||Mirrors the existing v1 endpoint, allowing Executions to be created on demand and to retrieve historical logs.|
|Execution Context||Mirrors the existing v1 endpoint|
|Step||Mirrors the existing v1 endpoint|
|Step Context||Mirrors the existing v1 endpoint|