Address Configuration Resource
The Address Configuration resource manages the configurations related to a unique address within the Conversations (classic) product, allowing you to specify which addresses should auto-create a Conversation upon receiving an inbound message.
The unique address must be a single address (i.e. a WhatsApp or SMS phone number) that belongs to your Twilio Account.
The configuration can optionally include automatically attaching a Conversation-scoped Webhook to the auto-created conversations.
A 34 character string that uniquely identifies this resource.
^IG[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique ID of the Account the address belongs to
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique address to be configured. The address can be a whatsapp address or phone number
The human-readable name of this configuration, limited to 256 characters. Optional.
An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
POST https://conversations.twilio.com/v1/Configuration/Addresses
application/x-www-form-urlencodedType of Address, value can be whatsapp or sms.
smswhatsappmessengergbmemailrcsapplechatThe unique address to be configured. The address can be a whatsapp address or phone number
The human-readable name of this configuration, limited to 256 characters. Optional.
Enable/Disable auto-creating conversations for messages to this address
Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service.
^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34The list of events, firing webhook event for this Conversation. Values can be any of the following: onMessageAdded, onMessageUpdated, onMessageRemoved, onConversationUpdated, onConversationStateUpdated, onConversationRemoved, onParticipantAdded, onParticipantUpdated, onParticipantRemoved, onDeliveryUpdated
For type studio, the studio flow SID where the webhook should be sent to.
^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34For type studio, number of times to retry the webhook request
An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
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 createConfigurationAddress() {14const addressConfiguration =15await client.conversations.v1.addressConfigurations.create({16address: "+37256123457",17"autoCreation.conversationServiceSid": "ISXXXXXXXXXXXXXXXXXXXXXX",18"autoCreation.enabled": true,19"autoCreation.type": "webhook",20"autoCreation.webhookFilters": ["onParticipantAdded", "onMessageAdded"],21"autoCreation.webhookMethod": "get",22"autoCreation.webhookUrl": "https://example.com",23friendlyName: "My Test Configuration",24type: "sms",25});2627console.log(addressConfiguration.sid);28}2930createConfigurationAddress();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"address": "+37256123457",5"type": "sms",6"friendly_name": "My Test Configuration",7"address_country": "CA",8"auto_creation": {9"enabled": true,10"type": "webhook",11"conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",12"webhook_url": "https://example.com",13"webhook_method": "POST",14"webhook_filters": [15"onParticipantAdded",16"onMessageAdded"17]18},19"date_created": "2016-03-24T21:05:50Z",20"date_updated": "2016-03-24T21:05:50Z",21"url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"22}
GET https://conversations.twilio.com/v1/Configuration/Addresses/{Sid}
The SID of the Address Configuration resource. This value can be either the sid or the address of the configuration
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 fetchConfigurationAddress() {14const addressConfiguration = await client.conversations.v115.addressConfigurations("IGXXXXXXXXXXXXXXXXXXXXXXXX")16.fetch();1718console.log(addressConfiguration.sid);19}2021fetchConfigurationAddress();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"sid": "IGXXXXXXXXXXXXXXXXXXXXXXXX",4"address": "+37256123457",5"type": "sms",6"friendly_name": "My Test Configuration",7"address_country": "CA",8"auto_creation": {9"enabled": true,10"type": "webhook",11"conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",12"webhook_url": "https://example.com",13"webhook_method": "POST",14"webhook_filters": [15"onParticipantAdded",16"onMessageAdded"17]18},19"date_created": "2016-03-24T21:05:50Z",20"date_updated": "2016-03-24T21:05:50Z",21"url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"22}
GET https://conversations.twilio.com/v1/Configuration/Addresses
Filter the address configurations by its type. This value can be one of: whatsapp, sms.
How many resources to return in each list page. The default is 50, and the maximum is 50.
1Maximum: 50The page token. This is provided by the API.
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 listConfigurationAddress() {14const addressConfigurations =15await client.conversations.v1.addressConfigurations.list({ limit: 20 });1617addressConfigurations.forEach((a) => console.log(a.sid));18}1920listConfigurationAddress();
Response
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://conversations.twilio.com/v1/Configuration/Addresses?PageSize=50&Page=0",6"previous_page_url": null,7"url": "https://conversations.twilio.com/v1/Configuration/Addresses?PageSize=50&Page=0",8"next_page_url": null,9"key": "address_configurations"10},11"address_configurations": [12{13"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"address": "+37256123457",16"type": "sms",17"friendly_name": "My Test Configuration",18"address_country": "CA",19"auto_creation": {20"enabled": true,21"type": "webhook",22"conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"webhook_url": "https://example.com",24"webhook_method": "POST",25"webhook_filters": [26"onParticipantAdded",27"onMessageAdded"28]29},30"date_created": "2016-03-24T21:05:50Z",31"date_updated": "2016-03-24T21:05:50Z",32"url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"33},34{35"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",36"sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",37"address": "+37256123458",38"type": "sms",39"friendly_name": "Studio Test Configuration",40"address_country": "US",41"auto_creation": {42"enabled": false,43"type": "studio",44"conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",45"studio_flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",46"studio_retry_count": 347},48"date_created": "2016-03-24T21:05:50Z",49"date_updated": "2016-03-24T21:05:50Z",50"url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"51},52{53"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",54"sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac",55"address": "+37256123459",56"type": "sms",57"friendly_name": "Default Test Configuration",58"address_country": "NG",59"auto_creation": {60"enabled": true,61"type": "default"62},63"date_created": "2016-03-24T21:05:50Z",64"date_updated": "2016-03-24T21:05:50Z",65"url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac"66}67]68}
POST https://conversations.twilio.com/v1/Configuration/Addresses/{Sid}
The SID of the Address Configuration resource. This value can be either the sid or the address of the configuration
application/x-www-form-urlencodedThe human-readable name of this configuration, limited to 256 characters. Optional.
Enable/Disable auto-creating conversations for messages to this address
Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service.
^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34The list of events, firing webhook event for this Conversation. Values can be any of the following: onMessageAdded, onMessageUpdated, onMessageRemoved, onConversationUpdated, onConversationStateUpdated, onConversationRemoved, onParticipantAdded, onParticipantUpdated, onParticipantRemoved, onDeliveryUpdated
For type studio, the studio flow SID where the webhook should be sent to.
^FW[0-9a-fA-F]{32}$Min length: 34Max length: 34For type studio, number of times to retry the webhook request
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 updateConfigurationAddress() {14const addressConfiguration = await client.conversations.v115.addressConfigurations("IGXXXXXXXXXXXXXXXXXXXXXXX")16.update({17"autoCreation.enabled": false,18"autoCreation.studioFlowSid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXX",19"autoCreation.studioRetryCount": 3,20"autoCreation.type": "studio",21friendlyName: "My Test Configuration Updated",22});2324console.log(addressConfiguration.sid);25}2627updateConfigurationAddress();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"sid": "IGXXXXXXXXXXXXXXXXXXXXXXX",4"address": "+37256123457",5"type": "sms",6"friendly_name": "My Test Configuration Updated",7"address_country": "CA",8"auto_creation": {9"enabled": false,10"type": "studio",11"conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",12"studio_flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"studio_retry_count": 314},15"date_created": "2016-03-24T21:05:50Z",16"date_updated": "2016-03-24T21:05:51Z",17"url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"18}
DELETE https://conversations.twilio.com/v1/Configuration/Addresses/{Sid}
The SID of the Address Configuration resource. This value can be either the sid or the address of the configuration
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 deleteConfigurationAddress() {14await client.conversations.v115.addressConfigurations("IGXXXXXXXXXXXXXXXXXXX")16.remove();17}1819deleteConfigurationAddress();