Skip to contentSkip to navigationSkip to topbar
On this page

Flow


Flows are individual workflows that you create. They can handle one or more use cases.


Flow Properties

flow-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.


statusenum<string>Optional

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

Possible values:
draftpublished

versionintegerOptional

The latest version number of the Flow's definition.

Default: 0

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.


linksobject<uri-map>Optional

The URLs of the Flow's nested resources.


GET https://studio.twilio.com/v1/Flows/{Sid}

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
Fetch FlowLink to code sample: Fetch Flow
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 fetchFlow() {
11
const flow = await client.studio.v1
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.fetch();
14
15
console.log(flow.sid);
16
}
17
18
fetchFlow();

Output

1
{
2
"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "Test Flow",
5
"status": "published",
6
"version": 1,
7
"date_created": "2017-11-06T12:00:00Z",
8
"date_updated": null,
9
"url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
10
"links": {
11
"engagements": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements",
12
"executions": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions"
13
}
14
}

GET https://studio.twilio.com/v1/Flows

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 listFlow() {
11
const flows = await client.studio.v1.flows.list({ limit: 20 });
12
13
flows.forEach((f) => console.log(f.sid));
14
}
15
16
listFlow();

Output

1
{
2
"meta": {
3
"previous_page_url": null,
4
"next_page_url": null,
5
"url": "https://studio.twilio.com/v1/Flows?PageSize=50&Page=0",
6
"page": 0,
7
"first_page_url": "https://studio.twilio.com/v1/Flows?PageSize=50&Page=0",
8
"page_size": 50,
9
"key": "flows"
10
},
11
"flows": []
12
}

DELETE https://studio.twilio.com/v1/Flows/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<FW>required

The SID of the Flow resource to delete.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34
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 deleteFlow() {
11
await client.studio.v1.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();
12
}
13
14
deleteFlow();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.