Skip to contentSkip to navigationSkip to topbar
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.


Revision Properties

revision-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<FW>Optional
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>Optional

The SID of the Account that created the Flow resource.

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

friendly_namestringOptional

The string that you assigned to describe the Flow.


definitionobjectOptional

JSON representation of flow definition.


statusenum<string>Optional

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

Possible values:
draftpublished

revisionintegerOptional

The latest revision number of the Flow's definition.

Default: 0

commit_messagestringOptional

Description of change made in the revision.


validbooleanOptional

Boolean if the flow definition is valid.


errorsarrayOptional

List of error in the flow definition.


date_updatedstring<date-time>Optional

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>Optional

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 RevisionLink to code sample: Fetch Flow Revision
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchFlowRevision() {
11
const revision = await client.studio.v2
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.revisions("1")
14
.fetch();
15
16
console.log(revision.sid);
17
}
18
19
fetchFlowRevision();

Output

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
}

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.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listFlowRevision() {
11
const revisions = await client.studio.v2
12
.flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.revisions.list({ limit: 20 });
14
15
revisions.forEach((r) => console.log(r.sid));
16
}
17
18
listFlowRevision();

Output

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
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.