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.
Unique identifier of the flow.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
List 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
Unique identifier of the flow.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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 and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchTestUser() {11const testUser = await client.studio.v212.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.testUsers()14.fetch();1516console.log(testUser.sid);17}1819fetchTestUser();
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.
Unique identifier of the flow.
^FW[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
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 and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateTestUser() {11const testUser = await client.studio.v212.flows("FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.testUsers()14.update({ testUsers: ["+14155551212", "+14155551213"] });1516console.log(testUser.sid);17}1819updateTestUser();
1{2"sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"test_users": [4"user1",5"user2"6],7"url": "https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TestUsers"8}