Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Flow Revision


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.


FlowRevision Properties

flowrevision-properties page anchor
Property nameTypePIIDescription
sidSID<FW>
Not PII

The unique string that we created to identify the Flow resource.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

The SID of the Account that created the Flow resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring

The string that you assigned to describe the Flow.


definitionobject

JSON representation of flow definition.


statusenum<string>

The status of the Flow. Can be: draft or published.

Possible values:
draftpublished

revisioninteger

The latest revision number of the Flow's definition.


commit_messagestring

Description of change made in the revision.


validboolean

Boolean if the flow definition is valid.


errorsarray

List of error in the flow definition.


date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


urlstring<uri>

The absolute URL of the resource.


Fetch a FlowRevision resource

fetch-a-flowrevision-resource page anchor
GET https://studio.twilio.com/v2/Flows/{Sid}/Revisions/{Revision}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
SidSID<FW>required

The SID of the Flow resource to fetch.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34

Revisionstringrequired

Specific Revision number or can be LatestPublished and LatestRevision.

Fetch Flow Revision

fetch-flow-revision page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function fetchFlowRevision() {
_19
const revision = await client.studio.v2
_19
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_19
.revisions("1")
_19
.fetch();
_19
_19
console.log(revision.sid);
_19
}
_19
_19
fetchFlowRevision();

Output

_16
{
_16
"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_16
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16
"definition": {
_16
"initial_state": "Trigger"
_16
},
_16
"friendly_name": "Test Flow",
_16
"status": "published",
_16
"revision": "1",
_16
"commit_message": null,
_16
"valid": true,
_16
"errors": [],
_16
"date_created": "2017-11-06T12:00:00Z",
_16
"date_updated": null,
_16
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1"
_16
}


Read multiple FlowRevision resources

read-multiple-flowrevision-resources page anchor
GET https://studio.twilio.com/v2/Flows/{Sid}/Revisions

Property nameTypeRequiredPIIDescription
SidSID<FW>required

The SID of the Flow resource to fetch.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listFlowRevision() {
_18
const revisions = await client.studio.v2
_18
.flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.revisions.list({ limit: 20 });
_18
_18
revisions.forEach((r) => console.log(r.sid));
_18
}
_18
_18
listFlowRevision();

Output

_27
{
_27
"meta": {
_27
"previous_page_url": null,
_27
"next_page_url": null,
_27
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions?PageSize=50&Page=0",
_27
"page": 0,
_27
"first_page_url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions?PageSize=50&Page=0",
_27
"page_size": 50,
_27
"key": "revisions"
_27
},
_27
"revisions": [
_27
{
_27
"sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"friendly_name": "Test Flow",
_27
"status": "published",
_27
"revision": 1,
_27
"definition": null,
_27
"commit_message": null,
_27
"valid": null,
_27
"errors": null,
_27
"date_created": "2017-11-06T12:00:00Z",
_27
"date_updated": "2017-11-06T12:00:00Z",
_27
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1"
_27
}
_27
]
_27
}


Rate this page: