The phone delivery settings endpoints provide the ability to configure different accounts which could be used for sending an SMS message (and possibly a Voice message in the future). They implement operations to create, update, read and delete phone delivery settings resources for an environment.

Configure your own Twilio account

  1. Create a Twilio phone delivery settings resource using the POST /environments/{envId}/notificationsSettings/phoneDeliverySettings operation. For example:
{
  "sid": "someSid",
  "authToken": "someAuthToken",
  "provider": "CUSTOM_TWILIO"
}
  1. Use the PUT /environments/{envId}/notificationsSettings/phoneDeliverySettings/{id} to select the numbers you would like to use for sending messages, by marking them as selected. For example:
{
  "id": "someTwilioPhoneDeliverySettingsId",
  "sid": "someSid",
  "provider": "CUSTOM_TWILIO",
  "numbers": [
    {
      "type": "SHORT_CODE",
      "capabilities": [
        "SMS"
      ],
      "selected": true,
      "available": true,
      "number": "894546"
    },
    {
      "type": "TOLL_FREE",
      "capabilities": [
        "SMS"
      ],
      "selected": false,
      "available": true,
      "number": "+18544440098"
    },
    {
      "type": "PHONE_NUMBER",
      "capabilities": [
        "SMS",
        "VOICE"
      ],
      "selected": true,
      "available": true,
      "number": "+172544440091"
    }
  ]
}

The sequence of SMS providers in the notification settings resource’s smsProvidersFallbackChain comprises the notification fallback sequence, in the event of a primary or subsequent provider failing to send a notification. See Notifications Settings for details on configuring an SMS provider fallback chain.

Phone delivery settings properties

Property Description
id A string that specifies the auto-generated ID of the phone delivery settings.
environment.id A string that specifies the relationship of the phone delivery settings to the environment.
provider A string that specifies the ID of the provider of phone delivery service. Possible values: CUSTOM_TWILIO and PINGONE_TWILIO
createdAt The time the resource was created.
updatedAt The time the resource was last updated.

Twilio phone delivery settings properties

The phoneDeliverySettings instance that supports Twilio accounts

Property Description
id A string that specifies the auto-generated ID of the phone delivery settings.
environment.id A string that specifies the relationship of the phone delivery settings to the environment.
sid A string that specifies the public ID of the Twilio account.
authToken A string that specifies the secret key of the Twilio account.
provider A string that specifies the ID of the provider of phone deliveryservice. In this case it has the value: CUSTOM_TWILIO
createdAt The time the resource was created.
updatedAt The time the resource was last updated.
numbers A collection of Twilio numbers to use when sending a notification.

Twilio numbers properties

Property Description
type A string that specifies the type of phone number. Possible values: SHORT_CODE, TOLL_FREE, PHONE_NUMBER
selected A boolean that specifies whether the number is selected by the admin for sending messages.
createdAt The time the resource was created.
number A string that specifies the phone number, toll-free number or short code.
available A boolean that specifies whether the number is currently available in the Twilio account.
capabilities A collection of Twilio capabilities.

Twilio capabilities properties

Property Description
capability A string that specifies the type of phone delivery service capability. Possible values: VOICE, SMS

Phone delivery settings response codes

Code Message
200 Successful operation.
201 Successfully created.
400 The request could not be completed.
401 You do not have access to this resource.
403 You do not have permissions or are not licensed to make this request.
404 The requested resource was not found.