Skip to contentSkip to navigationSkip to topbar
On this page

Test User


Test Users are the contact addresses (e.g. phone numbers, Chat identities) who can test the latest drafts of a Flow even if they aren't yet published.

Update the Test User resource of a Flow to allow the contacts that need to perform tests of unpublished drafts.


TestUser Properties

testuser-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<FW>Optional
Not PII

Unique identifier of the flow.

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

test_usersarray[string]Optional

List of test user identities that can test draft versions of the flow.


urlstring<uri>Optional

The URL of this resource.


Fetch a TestUser resource

fetch-a-testuser-resource page anchor
GET https://studio.twilio.com/v2/Flows/{Sid}/TestUsers

Path parameters

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

Unique identifier of the flow.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34
Fetch Test UsersLink to code sample: Fetch Test Users
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 fetchTestUser() {
11
const testUser = await client.studio.v2
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.testUsers()
14
.fetch();
15
16
console.log(testUser.sid);
17
}
18
19
fetchTestUser();

Output

1
{
2
"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"test_users": [
4
"user1",
5
"user2"
6
],
7
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TestUsers"
8
}

Update a TestUser resource

update-a-testuser-resource page anchor
POST https://studio.twilio.com/v2/Flows/{Sid}/TestUsers

Each Test User identity can be up to 300 bytes.

Property nameTypeRequiredPIIDescription
SidSID<FW>required

Unique identifier of the flow.

Pattern: ^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
TestUsersarray[string]required

List of test user identities that can test draft versions of the 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 updateTestUser() {
11
const testUser = await client.studio.v2
12
.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.testUsers()
14
.update({ testUsers: ["+14155551212", "+14155551213"] });
15
16
console.log(testUser.sid);
17
}
18
19
updateTestUser();

Output

1
{
2
"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"test_users": [
4
"user1",
5
"user2"
6
],
7
"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TestUsers"
8
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.