Config Subresource
You can provide configuration data for specific Microvisor-empowered IoT devices using the Config subresource. Configs are intended as a way to upload data such as API keys, PKI certificates, and other items to the Twilio cloud so they need not be baked into application code. Instead, the application code running on the device retrieves the Config when it needs the information.
Each Config is a key:value pair which your application code can access using Microvisor System Calls.
Keys are text identifiers of up to 100 characters in length. They must be unique for a given device. For example, devices A and B can both have Configs with the key cloud_service_api_key
, but each device can have only one Config with that key.
Values must also be supplied as text, of up to 4096 characters in length. If you wish to make binary data available to your devices, you will need to encode it as text before creating the Config. For example, you might used base64 encoding. Your application must decode the value back to binary after acquiring it from the Twilio cloud.
Config subresources are accessed at these endpoints:
_10https://microvisor.twilio.com/v1/Devices/{sid}/Configs
_10https://microvisor.twilio.com/v1/Devices/{UniqueName}/Configs
Device Configs are accessible only by the specified device. For Configs that are made available to all devices associated with a given account, please see Account-level Configs.
It is possible for anyone with account access to read back the value of any Config. If you have information which, once created, you would not like to be accessible to other account holders, use Device Secrets, which are, from the API perspective, write- and delete-only.
Warning
Configs can't yet be updated. If you need to change a Config's value, delete it first, and then create a new Config with the same key.
Property nameTypePIIDescription
A 34-character string that uniquely identifies the parent Device.
Pattern: ^UV[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The config key; up to 100 characters.
The config value; up to 4096 characters.
date_updatedstring<date-time>
The absolute URL of the Config.
POST https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs
Property nameTypeRequiredPIIDescription
A 34-character string that uniquely identifies the Device.
Property nameTypeRequiredPIIDescription
The config key; up to 100 characters.
The config value; up to 4096 characters.
_21// Download the helper library from https://www.twilio.com/docs/node/install
_21const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21// Find your Account SID and Auth Token at twilio.com/console
_21// and set the environment variables. See http://twil.io/secure
_21const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21const authToken = process.env.TWILIO_AUTH_TOKEN;
_21const client = twilio(accountSid, authToken);
_21async function createDeviceConfig() {
_21 const deviceConfig = await client.microvisor.v1
_21 .devices("UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
_21 .deviceConfigs.create({
_21 console.log(deviceConfig.deviceSid);
_10 "device_sid": "UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_10 "date_updated": "2021-01-01T12:34:56Z",
_10 "url": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configs/first"
GET https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs/{Key}
Property nameTypeRequiredPIIDescription
A 34-character string that uniquely identifies the Device.
The config key; up to 100 characters.
_19// Download the helper library from https://www.twilio.com/docs/node/install
_19const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19// Find your Account SID and Auth Token at twilio.com/console
_19// and set the environment variables. See http://twil.io/secure
_19const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19const authToken = process.env.TWILIO_AUTH_TOKEN;
_19const client = twilio(accountSid, authToken);
_19async function fetchDeviceConfig() {
_19 const deviceConfig = await client.microvisor.v1
_19 .devices("UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
_19 .deviceConfigs("key_name")
_19 console.log(deviceConfig.deviceSid);
_10 "device_sid": "UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_10 "value": "some value",
_10 "date_updated": "2021-01-01T12:34:57Z",
_10 "url": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configs/first"
GET https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs
Property nameTypeRequiredPIIDescription
A 34-character string that uniquely identifies the Device.
Property nameTypeRequiredPIIDescription
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_18// Download the helper library from https://www.twilio.com/docs/node/install
_18const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18// Find your Account SID and Auth Token at twilio.com/console
_18// and set the environment variables. See http://twil.io/secure
_18const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18const authToken = process.env.TWILIO_AUTH_TOKEN;
_18const client = twilio(accountSid, authToken);
_18async function listDeviceConfig() {
_18 const deviceConfigs = await client.microvisor.v1
_18 .devices("UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
_18 .deviceConfigs.list({ limit: 20 });
_18 deviceConfigs.forEach((d) => console.log(d.deviceSid));
_12 "first_page_url": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configs?PageSize=50&Page=0",
_12 "previous_page_url": null,
_12 "url": "https://microvisor.twilio.com/v1/Devices/UVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configs?PageSize=50&Page=0",
_12 "next_page_url": null,
DELETE https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs/{Key}
Property nameTypeRequiredPIIDescription
A 34-character string that uniquely identifies the Device.
The config key; up to 100 characters.
_17// Download the helper library from https://www.twilio.com/docs/node/install
_17const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_17// Find your Account SID and Auth Token at twilio.com/console
_17// and set the environment variables. See http://twil.io/secure
_17const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17const authToken = process.env.TWILIO_AUTH_TOKEN;
_17const client = twilio(accountSid, authToken);
_17async function deleteDeviceConfig() {
_17 await client.microvisor.v1
_17 .devices("UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
_17 .deviceConfigs("key_name")