ConversationsAddress Configuration

Create Configuration Address

POST
/v1/Configuration/Addresses

Create a new address configuration

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Request Body

application/x-www-form-urlencoded

Type*ConfigurationAddressType

Type of Address, value can be whatsapp or sms.

Value in

  • "sms"
  • "whatsapp"
  • "messenger"
  • "gbm"
  • "email"
  • "rcs"
  • "apple"
  • "chat"
Address*string

The unique address to be configured. The address can be a whatsapp address or phone number

FriendlyName?string

The human-readable name of this configuration, limited to 256 characters. Optional.

AutoCreation.Enabled?boolean

Enable/Disable auto-creating conversations for messages to this address

AutoCreation.Type?ConfigurationAddressAutoCreationType

Value in

  • "webhook"
  • "studio"
  • "default"
AutoCreation.ConversationServiceSid?string

Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service.

Match^IS[0-9a-fA-F]{32}$
Length34 <= length <= 34
AutoCreation.WebhookUrl?string

For type webhook, the url for the webhook request.

AutoCreation.WebhookMethod?ConfigurationAddressMethod

Value in

  • "get"
  • "post"
AutoCreation.WebhookFilters?array<string>

The 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

AutoCreation.StudioFlowSid?string

For type studio, the studio flow SID where the webhook should be sent to.

Match^FW[0-9a-fA-F]{32}$
Length34 <= length <= 34
AutoCreation.StudioRetryCount?integer

For type studio, number of times to retry the webhook request

AddressCountry?string

An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.

Response Body

application/json

curl -X POST "https://example.com/v1/Configuration/Addresses" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'Address=%2B37256123457&Type=sms&FriendlyName=My+Test+Configuration&AutoCreation.Enabled=true&AutoCreation.Type=webhook&AutoCreation.ConversationServiceSid=ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AutoCreation.WebhookUrl=https%3A%2F%2Fexample.com&AutoCreation.WebhookMethod=post&AutoCreation.WebhookFilters=onParticipantAdded%2ConMessageAdded&AddressCountry=CA'

{  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "address": "+37256123457",  "type": "sms",  "friendly_name": "My Test Configuration",  "address_country": "CA",  "auto_creation": {    "enabled": true,    "type": "webhook",    "conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",    "webhook_url": "https://example.com",    "webhook_method": "POST",    "webhook_filters": [      "onParticipantAdded",      "onMessageAdded"    ]  },  "date_created": "2016-03-24T21:05:50Z",  "date_updated": "2016-03-24T21:05:50Z",  "url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}