Create binding

POST /v1/Services/{ServiceSid}/Bindings

TODO: Resource-level docs

Path parameters

Body

  • Address string Required

    The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format.

  • BindingType string Required

    The transport technology to use for the Binding. Can be: apn, fcm, gcm, sms, or facebook-messenger.

    Values are apn, gcm, sms, fcm, facebook-messenger, or alexa.

  • The SID of the Credential resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only apn, fcm, and gcm type Bindings.

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

  • Endpoint string

    Deprecated.

  • Identity string Required

    The identity value that uniquely identifies the new resource's User within the Service. Up to 20 Bindings can be created for the same Identity in a given Service.

  • The protocol version to use to send the notification. This defaults to the value of default_xxxx_notification_protocol_version for the protocol in the Service. The current version is "3" for apn, fcm, and gcm type Bindings. The parameter is not applicable to sms and facebook-messenger type Bindings as the data format is fixed.

  • Tag array[string]

    A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags.

Responses

  • Created

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

      The SID of the Account that created the resource

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

    • address string | null

      The channel-specific address

    • binding_type string | null

      The type of the Binding

    • credential_sid string | null

      The SID of the Credential resource to be used to send notifications to this Binding

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

    • date_created string(date-time) | null

      The RFC 2822 date and time in GMT when the resource was created

    • date_updated string(date-time) | null

      The RFC 2822 date and time in GMT when the resource was last updated

    • endpoint string | null

      Deprecated

    • identity string | null

      The identity value that identifies the new resource's User

    • The protocol version to use to send the notification

    • service_sid string | null

      The SID of the Service that the resource is associated with

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

    • sid string | null

      The unique string that identifies the resource

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

    • tags array[string] | null

      The list of tags associated with this Binding

    • url string(uri) | null

      The absolute URL of the Binding resource

POST /v1/Services/{ServiceSid}/Bindings
curl \
 -X POST https://notify.twilio.com/v1/Services/{ServiceSid}/Bindings \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'Address=string&BindingType=apn&CredentialSid=string&Endpoint=string&Identity=string&NotificationProtocolVersion=string&Tag=string'
Request example
{
  "Address": "string",
  "BindingType": "apn",
  "CredentialSid": "string",
  "Endpoint": "string",
  "Identity": "string",
  "NotificationProtocolVersion": "string",
  "Tag": [
    "string"
  ]
}
Request examples
{
  "Address": "string",
  "BindingType": "apn",
  "CredentialSid": "string",
  "Endpoint": "string",
  "Identity": "string",
  "NotificationProtocolVersion": "string",
  "Tag": [
    "string"
  ]
}
Response examples (201)
{
  "account_sid": "string",
  "address": "string",
  "binding_type": "string",
  "credential_sid": "string",
  "date_created": "2023-05-04T09:42:00+00:00",
  "date_updated": "2023-05-04T09:42:00+00:00",
  "endpoint": "string",
  "identity": "string",
  "links": {},
  "notification_protocol_version": "string",
  "service_sid": "string",
  "sid": "string",
  "tags": [
    "string"
  ],
  "url": "https://example.com"
}
Response examples (201)
{
  "account_sid": "string",
  "address": "string",
  "binding_type": "string",
  "credential_sid": "string",
  "date_created": "2024-05-04T09:42:00+00:00",
  "date_updated": "2024-05-04T09:42:00+00:00",
  "endpoint": "string",
  "identity": "string",
  "links": {},
  "notification_protocol_version": "string",
  "service_sid": "string",
  "sid": "string",
  "tags": [
    "string"
  ],
  "url": "https://example.com"
}