Service Binding Resource
A Binding resource in Twilio Conversations represents a Push notification subscription for a User within their Service instance. Bindings are unique per Service instance, User identity, device, and notification channel (such as APNS, GCM, FCM).
Each Binding resource has the following properties:
Property nameTypePIIDescription
A 34 character string that uniquely identifies this resource.
Pattern: ^BS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique ID of the Account responsible for this binding.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Conversation Service the Binding resource is associated with.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
date_createdstring<date-time> The date that this resource was created.
date_updatedstring<date-time> The date that this resource was last updated.
The unique endpoint identifier for the Binding. The format of this value depends on the binding_type
.
message_typesarray[string]
An absolute API resource URL for this binding.
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Bindings/{Sid}
Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required The SID of the Conversation Service the Binding resource is associated with.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A 34 character string that uniquely identifies this resource.
Pattern: ^BS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_19// Download the helper library from https://www.twilio.com/docs/node/install
_19const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19// Find your Account SID and Auth Token at twilio.com/console
_19// and set the environment variables. See http://twil.io/secure
_19const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19const authToken = process.env.TWILIO_AUTH_TOKEN;
_19const client = twilio(accountSid, authToken);
_19async function fetchServiceBinding() {
_19 const binding = await client.conversations.v1
_19 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 console.log(binding.sid);
_19fetchServiceBinding();
_17 "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "date_created": "2016-10-21T11:37:03Z",
_17 "date_updated": "2016-10-21T11:37:03Z",
_17 "endpoint": "TestUser-endpoint",
_17 "identity": "TestUser",
_17 "binding_type": "gcm",
_17 "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "removed_from_conversation",
_17 "added_to_conversation"
_17 "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Bindings
Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required The SID of the Conversation Service the Binding resource is associated with.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property nameTypeRequiredPIIDescription
BindingTypearray[enum<string>]Optional The push technology used by the Binding resources to read. Can be: apn
, gcm
, or fcm
. See push notification configuration for more info.
Possible values: apn
gcm
fcm
Identityarray[string]Optional
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_18// Download the helper library from https://www.twilio.com/docs/node/install
_18const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18// Find your Account SID and Auth Token at twilio.com/console
_18// and set the environment variables. See http://twil.io/secure
_18const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18const authToken = process.env.TWILIO_AUTH_TOKEN;
_18const client = twilio(accountSid, authToken);
_18async function listServiceBinding() {
_18 const bindings = await client.conversations.v1
_18 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 .bindings.list({ limit: 20 });
_18 bindings.forEach((b) => console.log(b.sid));
_30 "first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0",
_30 "previous_page_url": null,
_30 "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0",
_30 "next_page_url": null,
_30 "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30 "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30 "date_created": "2016-10-21T11:37:03Z",
_30 "date_updated": "2016-10-21T11:37:03Z",
_30 "endpoint": "TestUser-endpoint",
_30 "identity": "TestUser",
_30 "binding_type": "gcm",
_30 "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30 "removed_from_conversation",
_30 "added_to_conversation"
_30 "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
DELETE https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Bindings/{Sid}
Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required The SID of the Conversation Service to delete the Binding resource from.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Binding resource to delete.
Pattern: ^BS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_17// Download the helper library from https://www.twilio.com/docs/node/install
_17const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_17// Find your Account SID and Auth Token at twilio.com/console
_17// and set the environment variables. See http://twil.io/secure
_17const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17const authToken = process.env.TWILIO_AUTH_TOKEN;
_17const client = twilio(accountSid, authToken);
_17async function deleteServiceBinding() {
_17 await client.conversations.v1
_17 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_17 .bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_17deleteServiceBinding();