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.
Property nameTypeRequiredPIIDescriptionChild properties
Unique identifier of the flow.
Pattern:
^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34List of test user identities that can test draft versions of the flow.
The URL of this resource.
GET https://studio.twilio.com/v2/Flows/{Sid}/TestUsers
Property nameTypeRequiredPIIDescription
Unique identifier of the flow.
Pattern:
^FW[0-9a-fA-F]{32}$Min length: 34Max length: 341// 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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function fetchTestUser() {14const testUser = await client.studio.v215.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.testUsers()17.fetch();1819console.log(testUser.sid);20}2122fetchTestUser();
Response
1{2"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"test_users": [4"user1",5"user2"6],7"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TestUsers"8}
POST https://studio.twilio.com/v2/Flows/{Sid}/TestUsers
Each Test User identity can be up to 300 bytes.
Property nameTypeRequiredPIIDescription
Unique identifier of the flow.
Pattern:
^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34Encoding type:
application/x-www-form-urlencodedSchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function updateTestUser() {14const testUser = await client.studio.v215.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.testUsers()17.update({ testUsers: ["+14155551212", "+14155551213"] });1819console.log(testUser.sid);20}2122updateTestUser();
Response
1{2"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"test_users": [4"+14155551212",5"+14155551213"6],7"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TestUsers"8}