Service Configuration Resource
The Configuration Resource represents all of the configuration settings for a Conversation Service, such as the default roles assigned to Users.
The unique string that we created to identify the Service configuration resource.
^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34The conversation-level role assigned to a conversation creator when they join a new conversation. See Conversation Role for more info about roles.
^RL[0-9a-fA-F]{32}$Min length: 34Max length: 34The conversation-level role assigned to users when they are added to a conversation. See Conversation Role for more info about roles.
^RL[0-9a-fA-F]{32}$Min length: 34Max length: 34The service-level role assigned to users when they are added to the service. See Conversation Role for more info about roles.
^RL[0-9a-fA-F]{32}$Min length: 34Max length: 34Contains an absolute API resource URL to access the push notifications configuration of this service.
Whether the Reachability Indicator is enabled for this Conversations Service. The default is false.
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration
The SID of the Service configuration resource to fetch.
^IS[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 fetchServiceConfiguration() {14const configuration = await client.conversations.v115.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.configuration()17.fetch();1819console.log(configuration.chatServiceSid);20}2122fetchServiceConfiguration();
Response
1{2"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"default_conversation_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"default_conversation_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"default_chat_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"reachability_enabled": false,7"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",8"links": {9"notifications": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications",10"webhooks": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Webhooks"11}12}
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration
The SID of the Service configuration resource to update.
^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34application/x-www-form-urlencodedThe conversation-level role assigned to a conversation creator when they join a new conversation. See Conversation Role for more info about roles.
^RL[0-9a-fA-F]{32}$Min length: 34Max length: 34The conversation-level role assigned to users when they are added to a conversation. See Conversation Role for more info about roles.
^RL[0-9a-fA-F]{32}$Min length: 34Max length: 34The service-level role assigned to users when they are added to the service. See Conversation Role for more info about roles.
^RL[0-9a-fA-F]{32}$Min length: 34Max length: 34Whether the Reachability Indicator is enabled for this Conversations Service. The default is false.
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 updateServiceConfiguration() {14const configuration = await client.conversations.v115.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.configuration()17.update({18defaultConversationCreatorRoleSid: "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",19});2021console.log(configuration.chatServiceSid);22}2324updateServiceConfiguration();
Response
1{2"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"default_conversation_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"default_conversation_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"default_chat_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"reachability_enabled": false,7"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",8"links": {9"notifications": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications",10"webhooks": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Webhooks"11}12}