Create a new address configuration

POST /v1/Configuration/Addresses

Address Configuration resource manages the configurations related to a unique address within Conversations

Create a new address configuration

application/x-www-form-urlencoded

Body

  • Type string Required

    Type of Address, value can be whatsapp or sms.

    Values are sms, whatsapp, messenger, gbm, email, rcs, apple, or chat.

  • Address string Required

    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 string

    Values are webhook, studio, or default.

  • AutoCreation.ConversationServiceSid string

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

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^IS[0-9a-fA-F]{32}$.

  • AutoCreation.WebhookUrl string

    For type webhook, the url for the webhook request.

  • AutoCreation.WebhookMethod string

    Values are get or 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.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^FW[0-9a-fA-F]{32}$.

  • 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.

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • sid string | null

      A 34 character string that uniquely identifies this resource.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^IG[0-9a-fA-F]{32}$.

    • account_sid string | null

      The unique ID of the Account the address belongs to

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • type string | null

      Type of Address, value can be whatsapp or sms.

    • address string | null

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

    • friendly_name string | null

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

    • auto_creation

      Auto Creation configuration for the address.

    • date_created string(date-time) | null

      The date that this resource was created.

    • date_updated string(date-time) | null

      The date that this resource was last updated.

    • url string(uri) | null

      An absolute API resource URL for this address configuration.

    • address_country string | null

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

POST /v1/Configuration/Addresses
curl \
 --request POST 'https://conversations.twilio.com/v1/Configuration/Addresses' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Type=sms&Address=%2B37256123457&FriendlyName=My+Test+Configuration&AddressCountry=CA&AutoCreation.Type=webhook&AutoCreation.Enabled=true&AutoCreation.WebhookUrl=https%3A%2F%2Fexample.com&AutoCreation.WebhookMethod=post&AutoCreation.WebhookFilters=onParticipantAdded&AutoCreation.WebhookFilters=onMessageAdded&AutoCreation.ConversationServiceSid=ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
{"Type"=>"sms", "Address"=>"+37256123457", "FriendlyName"=>"My Test Configuration", "AddressCountry"=>"CA", "AutoCreation.Type"=>"webhook", "AutoCreation.Enabled"=>true, "AutoCreation.WebhookUrl"=>"https://example.com", "AutoCreation.WebhookMethod"=>"post", "AutoCreation.WebhookFilters"=>["onParticipantAdded", "onMessageAdded"], "AutoCreation.ConversationServiceSid"=>"ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{"Type"=>"apple", "Address"=>"urn:mbid:AQAAYyUbut6E4B3T9FLv5EbG", "FriendlyName"=>"My AMB Test Configuration", "AddressCountry"=>"CA", "AutoCreation.Type"=>"webhook", "AutoCreation.Enabled"=>true, "AutoCreation.WebhookUrl"=>"https://example.com", "AutoCreation.WebhookMethod"=>"post", "AutoCreation.WebhookFilters"=>["onParticipantAdded", "onMessageAdded"], "AutoCreation.ConversationServiceSid"=>"ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{"Type"=>"email", "Address"=>"example@example.com", "FriendlyName"=>"My Email Configuration", "AutoCreation.Type"=>"default", "AutoCreation.Enabled"=>true}
Response examples (201)
{
  "sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "type": "sms",
  "address": "+37256123457",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2016-03-24T21:05:50Z",
  "date_updated": "2016-03-24T21:05:50Z",
  "auto_creation": {
    "type": "webhook",
    "enabled": true,
    "webhook_url": "https://example.com",
    "webhook_method": "POST",
    "webhook_filters": [
      "onParticipantAdded",
      "onMessageAdded"
    ],
    "conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "friendly_name": "My Test Configuration",
  "address_country": "CA"
}
{
  "sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "type": "apple",
  "address": "urn:mbid:AQAAYyUbut6E4B3T9FLv5EbG",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2016-03-24T21:05:50Z",
  "date_updated": "2016-03-24T21:05:50Z",
  "auto_creation": {
    "type": "webhook",
    "enabled": true,
    "webhook_url": "https://example.com",
    "webhook_method": "POST",
    "webhook_filters": [
      "onParticipantAdded",
      "onMessageAdded"
    ],
    "conversation_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "friendly_name": "My AMB Test Configuration",
  "address_country": "CA"
}
{
  "sid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "type": "email",
  "address": "example@example.com",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2016-03-24T21:05:50Z",
  "date_updated": "2016-03-24T21:05:50Z",
  "auto_creation": {
    "type": "default",
    "enabled": true
  },
  "friendly_name": "My Email Configuration",
  "address_country": null
}