Flows Revisions track every change made to a Flow resource. Revisions are automatically created when a Flow is created or updated. Each revision is read-only and immutable (cannot be updated or deleted).
For convenience, the latest Revision and latest published Revision can be fetched using the magic identifiers LatestPublished
and LatestRevision
in place of an integer.
Fetching the parent Flow resource will always return the latest Flow Revision.
The unique string that we created to identify the Flow resource.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Flow resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The status of the Flow. Can be: draft
or published
.
draft
published
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 absolute URL of the resource.
GET https://studio.twilio.com/v2/Flows/{Sid}/Revisions/{Revision}
The SID of the Flow resource to fetch.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Specific Revision number or can be LatestPublished
and LatestRevision
.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchFlowRevision() {11const revision = await client.studio.v212.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.revisions("1")14.fetch();1516console.log(revision.sid);17}1819fetchFlowRevision();
1{2"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"definition": {5"initial_state": "Trigger"6},7"friendly_name": "Test Flow",8"status": "published",9"revision": "1",10"commit_message": null,11"valid": true,12"errors": [],13"date_created": "2017-11-06T12:00:00Z",14"date_updated": null,15"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1"16}
GET https://studio.twilio.com/v2/Flows/{Sid}/Revisions
The SID of the Flow resource to fetch.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listFlowRevision() {11const revisions = await client.studio.v212.flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.revisions.list({ limit: 20 });1415revisions.forEach((r) => console.log(r.sid));16}1718listFlowRevision();
1{2"meta": {3"previous_page_url": null,4"next_page_url": null,5"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions?PageSize=50&Page=0",6"page": 0,7"first_page_url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions?PageSize=50&Page=0",8"page_size": 50,9"key": "revisions"10},11"revisions": [12{13"sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"friendly_name": "Test Flow",16"status": "published",17"revision": 1,18"definition": null,19"commit_message": null,20"valid": null,21"errors": null,22"date_created": "2017-11-06T12:00:00Z",23"date_updated": "2017-11-06T12:00:00Z",24"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1"25}26]27}