Service-Scoped Notification Resource
The Twilio Conversations Service Notification resource manages a set of settings to determine push notification Service Binding behavior for a specific Conversation Service.
All URLs in the reference documentation use the following base URL:
_10https://conversations.twilio.com/v1
For Conversations applications that build on more than one Conversation Service instance, you will need to specify the Conversation Service SID in the REST API call:
_10GET /v1/Services/ISxx/Conversations/CHxx/Messages
Property nameTypePIIDescription
The unique ID of the Account responsible for this configuration.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Conversation Service the Configuration applies to.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Push Notification configuration for New Messages.
added_to_conversationobject The Push Notification configuration for being added to a Conversation.
removed_from_conversationobject The Push Notification configuration for being removed from a Conversation.
Weather the notification logging is enabled.
An absolute API resource URL for this configuration.
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Notifications
Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required The SID of the Conversation Service the Configuration applies to.
Pattern: ^IS[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 fetchServiceNotification() {
_19 const notification = await client.conversations.v1
_19 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .configuration.notifications()
_19 console.log(notification.accountSid);
_19fetchServiceNotification();
_26 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26 "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26 "log_enabled": false,
_26 "added_to_conversation": {
_26 "template": "You have been added to a Conversation: ${CONVERSATION}",
_26 "template": "You have a new message in ${CONVERSATION} from ${PARTICIPANT}: ${MESSAGE}",
_26 "badge_count_enabled": false,
_26 "template": "You have a new message in ${CONVERSATION} with ${MEDIA_COUNT} media files: ${MEDIA}"
_26 "removed_from_conversation": {
_26 "template": "You have been removed from a Conversation: ${CONVERSATION}",
_26 "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications"
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Notifications
Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required The SID of the Conversation Service the Configuration applies to.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property nameTypeRequiredPIIDescription
LogEnabledbooleanOptional Weather the notification logging is enabled.
NewMessage.EnabledbooleanOptional Whether to send a notification when a new message is added to a conversation. The default is false
.
NewMessage.TemplatestringOptional The template to use to create the notification text displayed when a new message is added to a conversation and new_message.enabled
is true
.
NewMessage.SoundstringOptional The name of the sound to play when a new message is added to a conversation and new_message.enabled
is true
.
NewMessage.BadgeCountEnabledbooleanOptional Whether the new message badge is enabled. The default is false
.
AddedToConversation.EnabledbooleanOptional Whether to send a notification when a participant is added to a conversation. The default is false
.
AddedToConversation.TemplatestringOptional The template to use to create the notification text displayed when a participant is added to a conversation and added_to_conversation.enabled
is true
.
AddedToConversation.SoundstringOptional The name of the sound to play when a participant is added to a conversation and added_to_conversation.enabled
is true
.
RemovedFromConversation.EnabledbooleanOptional Whether to send a notification to a user when they are removed from a conversation. The default is false
.
RemovedFromConversation.TemplatestringOptional The template to use to create the notification text displayed to a user when they are removed from a conversation and removed_from_conversation.enabled
is true
.
RemovedFromConversation.SoundstringOptional The name of the sound to play to a user when they are removed from a conversation and removed_from_conversation.enabled
is true
.
NewMessage.WithMedia.EnabledbooleanOptional Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is false
.
NewMessage.WithMedia.TemplatestringOptional The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and new_message.attachments.enabled
is true
.
_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 updateServiceNotification() {
_19 const notification = await client.conversations.v1
_19 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .configuration.notifications()
_19 .update({ logEnabled: true });
_19 console.log(notification.accountSid);
_19updateServiceNotification();
_26 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26 "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26 "added_to_conversation": {
_26 "template": "You have been added to a Conversation: ${CONVERSATION}",
_26 "template": "You have a new message in ${CONVERSATION} from ${PARTICIPANT}: ${MESSAGE}",
_26 "badge_count_enabled": true,
_26 "template": "You have a new message in ${CONVERSATION} with ${MEDIA_COUNT} media files: ${MEDIA}"
_26 "removed_from_conversation": {
_26 "template": "You have been removed from a Conversation: ${CONVERSATION}",
_26 "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications"