Skip to contentSkip to navigationSkip to topbar
On this page

Webhook Events


(error)

Danger

Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here(link takes you to an external page).

If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.

Programmable Chat sends webhooks for most things that happen in your app, and are designed to allow you to monitor and intercept user actions in your own backend service, in a Function, or in a Studio flow.

The Webhooks configuration page is accessible from the left nav bar when configuring a Chat service.

Webhook targets for the Service instance (the URL that Twilio will invoke) are configured in the Twilio Console. Twilio will fire these webhooks at two different moments:

  • Pre-Event Webhooks will fire before an action has been committed to the Chat instance, blocking publication until a response is received. This gives your backend (or Function) the opportunity to intercept, modify, or reject any action across the instance, making these hooks useful for spam/language filtering, complex permission schemes, or other business logic. Pre-event webhooks are fired only for actions from the Chat SDK; the REST API actions will never fire them.
  • Post-Event Webhooks fire after any action taken on a Chat Service. This means they arrive after messages have been delivered, after channel membership has changed, etc. Post-Event hooks are therefore the right tool for archiving or post-processing. Unlike Pre-Event webhooks, Post-Event webhooks can also be triggered from the REST API if the correct header is passed (see below).

Additionally to global, service-level webhooks, Channel-Scoped Webhooks allow you to configure up to five specific webhooks per channel, optionally triggering them on specific words or phrases.

(information)

Info

Twilio can send your web application an HTTP request when certain events happen, such as an incoming text message to one of your Twilio phone numbers. These requests are called webhooks, or status callbacks. For more, check out our guide to Getting Started with Twilio Webhooks. Find other webhook pages, such as a security guide and an FAQ in the Webhooks section of the docs.


Table of Contents

table-of-contents page anchor

Most events — but not all of them — have both a pre-event and a post-event webhook. The former is fired before the event has been published, and Twilio waits for a response before publishing it. The latter are fired after publication, assuming the event was not rejected by your pre-event webhook response.

The below table enumerates all Chat webhook events in corresponding pairs.

Pre-EventPost-EventDescription (incl. Post-Event)
onMessageSendonMessageSentFires when a new message is posted to a channel.
onMessageRemoveonMessageRemovedFires when a message is deleted from a channel.
onMessageUpdateonMessageUpdatedFires when a posted message's body or any attribute is changed.
onMediaMessageSendonMediaMessageSentFires when a new media message is posted to a channel.
onChannelAddonChannelAddedFires when a new channel, public or private, is created.
onChannelUpdateonChannelUpdatedFires when any attribute of a channel is changed.
onChannelDestroyonChannelDestroyedFires when a channel is removed from the Service.
onMemberAddonMemberAddedFires when a User has joined a Channel as a Member.
onMemberUpdateonMemberUpdatedFires when Member's attributes are updated.
onMemberRemoveonMemberRemovedFires when a User is removed from the set of Channel Members.
(no pre-event webhook)onUserAddedFires when a new User has been created. (cannot be intercepted with a Pre-Event hook)
onUserUpdateonUserUpdatedFires when any configurable attribute of a User is changed. For User's reachability status update only Post-Event webhook is triggered.

Triggering Webhooks for REST API Events

triggering-webhooks-for-rest-api-events page anchor

Upon configuration, only actions from SDK-driven clients (like mobile phones or browsers) will cause webhooks without further action on your part. This includes both Service-level webhooks and Channel-Scoped Webhooks, and as a default behavior helps avoid infinite feedback loops.

Your Post-Event Webhook target, however, may be an important tool for archiving. In this case, you may also want to enable webhook "echoes" from actions you take on the REST API. To do so, you can add a header X-Twilio-Webhook-Enabled=true to any such request. Requests bearing this header will yield webhooks to the configured Post-Event webhook target.

Using Pre-Event Webhooks to Modify or Reject Changes

using-pre-event-webhooks-to-modify-or-reject-changes page anchor

In the case of Pre-Event webhooks, Twilio will wait for a response from your service before publishing a result. The arrival, HTTP status code, and content of your response determines how Programmable Chat will proceed.

Response Status CodeBodyResult
HTTP 200 OK{}(or no content)Chat will publish the change unmodified.
HTTP 200 OK{ "body": "modified message" } (See the list of modifiable fields.)Chat will publish the change with modifications as given in the response. All values are optional, and missing fields will be left unmodified from the original event. See below for which fields can be modified for each data type (Channels, Messages, or Users). If modified values fail validation, the error will be returned to the SDK (or REST client) that triggered the event.
HTTP 403 Forbidden(none)Chat will reject the change and no publication will be made.
HTTP 404 Not Found(none)Chat will publish the change unmodified.
(no response or timeout)Chat will publish the change unmodified.

In all cases, any change to the attributes value will be applied wholly; you cannot partially-update this value by providing only a subset of fields. The new value for attributes, as ever, must be provided as a string with all intervening double-quotes escaped.

Channel Events

channel-events page anchor

In response to the onChannelAdd and onChannelUpdate events, your Pre-Event Webhook response may modify the following properties of the channel:

  • friendly_name
  • unique_name
  • attributes

An example response modifying a channel

1
HTTP 200 OK
2
Content-Type: text/json {
3
"friendly_name": "friendly name of channel",
4
"unique_name": "very unique name",
5
"attributes" : "{\"key\" : \"value\"}"
6
}

In response to onMessageSend and onMessageUpdate events, your Pre-Event Webhook response may modify the following properties of the message:

  • body
  • attributes

An example response modifying a chat message.

1
HTTP 200 OK
2
Content-Type: text/json {
3
"body": "modified message text",
4
"attributes": "{\"key\" : \"value\"}"
5
}

In response to onUserUpdate events, your Pre-Event Webhook response may modify the following properties of the User:

  • friendly_name
  • attributes

An example response modifying a chat User.

1
HTTP 200 OK
2
Content-Type: text/json {
3
"friendly_name": "modified friendly name",
4
"attributes": "{\"key\" : \"value\"}"
5
}

Selective muting for Push notifications

selective-muting-for-push-notifications page anchor

Additionally, in response to onMessageSend, OnMemberAdd and OnMemberRemove the following property can be modified - mute_notification. This allows to suppress Push notification for named events.

1
HTTP 200 OK
2
Content-Type: text/json {
3
"mute_notification": "true"
4
}

Configuring Webhooks with the REST API

configuring-webhooks-with-the-rest-api page anchor

Service-level Webhooks, both Pre-Event and Post-Event, are configured on the Service itself with the following parameters.

Configuration AttributeTypeMeaning
PreWebhookUrlstring (absolute url)The absolute URL where Twilio should send Pre-Event webhook requests.
PostWebhookUrlstring (absolute url)The absolute URL where Twilio should send Post-Event webhook requests.
WebhookMethodstring ("POST" or "GET")Twilio will use this HTTP method when sending webhook requests of all types.
WebhookFiltersstring, repeatableThe list of webhook event triggers that are enabled for this Service. The entire list must be provided on any POST to Service configuration.
PreWebhookRetryCountinteger [0, 3]Pre-Event webhooks that fail after a 5s timeout will be retried according to this setting. The maximum number of retries is 3 (i.e. 4 attempts total).
PostWebhookRetryCountinteger [0, 3]Post-Event webhooks that fail after a 5s timeout will be retried according to this setting. The maximum number of retries is 3 (i.e. 4 attempts total).
Configuring Chat Webhook URLsLink to code sample: Configuring Chat Webhook URLs
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateService() {
11
const service = await client.chat.v2
12
.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({
14
postWebhookUrl: "https://hooks.yoursite.com/post-webhooks",
15
preWebhookUrl: "https://hooks.yoursite.com/pre-webhooks",
16
webhookMethod: "POST",
17
});
18
19
console.log(service.sid);
20
}
21
22
updateService();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"consumption_report_interval": 100,
4
"date_created": "2015-07-30T20:00:00Z",
5
"date_updated": "2015-07-30T20:00:00Z",
6
"default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
"default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"friendly_name": "friendly_name",
10
"limits": {
11
"channel_members": 500,
12
"user_channels": 600
13
},
14
"links": {
15
"channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
16
"users": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users",
17
"roles": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles",
18
"bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings"
19
},
20
"notifications": {
21
"log_enabled": true,
22
"added_to_channel": {
23
"enabled": false,
24
"template": "notifications.added_to_channel.template"
25
},
26
"invited_to_channel": {
27
"enabled": false,
28
"template": "notifications.invited_to_channel.template"
29
},
30
"new_message": {
31
"enabled": false,
32
"template": "notifications.new_message.template",
33
"badge_count_enabled": true
34
},
35
"removed_from_channel": {
36
"enabled": false,
37
"template": "notifications.removed_from_channel.template"
38
}
39
},
40
"post_webhook_url": "https://hooks.yoursite.com/post-webhooks",
41
"pre_webhook_url": "https://hooks.yoursite.com/pre-webhooks",
42
"pre_webhook_retry_count": 2,
43
"post_webhook_retry_count": 3,
44
"reachability_enabled": false,
45
"read_status_enabled": false,
46
"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47
"typing_indicator_timeout": 100,
48
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
49
"webhook_filters": [
50
"webhook_filters"
51
],
52
"webhook_method": "POST",
53
"media": {
54
"size_limit_mb": 150,
55
"compatibility_message": "new media compatibility message"
56
}
57
}
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateService() {
11
const service = await client.chat.v2
12
.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({
14
webhookFilters: [
15
"onMessageSent",
16
"onMessageSend",
17
"onMessageUpdate",
18
"onMessageUpdated",
19
"onMessageRemove",
20
"onMessageRemoved",
21
"onChannelAdd",
22
"onChannelAdded",
23
"onChannelDestroy",
24
"onChannelDestroyed",
25
"onChannelUpdate",
26
"onChannelUpdated",
27
"onMemberAdd",
28
"onMemberAdded",
29
"onMemberRemove",
30
"onMemberRemoved",
31
"onUserUpdate",
32
"onUserUpdated",
33
],
34
});
35
36
console.log(service.sid);
37
}
38
39
updateService();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"consumption_report_interval": 100,
4
"date_created": "2015-07-30T20:00:00Z",
5
"date_updated": "2015-07-30T20:00:00Z",
6
"default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
"default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"friendly_name": "friendly_name",
10
"limits": {
11
"channel_members": 500,
12
"user_channels": 600
13
},
14
"links": {
15
"channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
16
"users": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users",
17
"roles": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles",
18
"bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings"
19
},
20
"notifications": {
21
"log_enabled": true,
22
"added_to_channel": {
23
"enabled": false,
24
"template": "notifications.added_to_channel.template"
25
},
26
"invited_to_channel": {
27
"enabled": false,
28
"template": "notifications.invited_to_channel.template"
29
},
30
"new_message": {
31
"enabled": false,
32
"template": "notifications.new_message.template",
33
"badge_count_enabled": true
34
},
35
"removed_from_channel": {
36
"enabled": false,
37
"template": "notifications.removed_from_channel.template"
38
}
39
},
40
"post_webhook_url": "post_webhook_url",
41
"pre_webhook_url": "pre_webhook_url",
42
"pre_webhook_retry_count": 2,
43
"post_webhook_retry_count": 3,
44
"reachability_enabled": false,
45
"read_status_enabled": false,
46
"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47
"typing_indicator_timeout": 100,
48
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
49
"webhook_filters": [
50
"webhook_filters"
51
],
52
"webhook_method": "webhook_method",
53
"media": {
54
"size_limit_mb": 150,
55
"compatibility_message": "new media compatibility message"
56
}
57
}

Webhook Bodies by Event Type

webhook-bodies page anchor

When Twilio makes an HTTP request to your server, it will include contextual information related to the action that triggered the WebHook call to your backend.

In addition to the event-specific parameters, each request will also contain the following parameters and information:

parameter nametypedescription
AccountSidstring, SIDThe Twilio Account SID which the Service instance belongs to
InstanceSidstring, sidThe Programmable Chat Service instance SID which the action relates to
ClientIdentitystringThe identity string of the SDK client endpoint that triggered the event callback (as taken from the Access Token for the client endpoint).

Note: Each HTTP request is issued with the Content-Type header application/x-www-urlencoded.

Pre-Event Webhook Bodies

webhook-bodies-pre-event page anchor
parameter nametypedescription
EventTypestringAlways onMessageSend
ChannelSidstringChannel SID identifier of the Channel the Message is being sent to
BodystringThe body of message
Attributesstring, optional, valid JSON structure or nullA JSON structure contained in a string. This can be null if attributes are not present in message entity.
FromstringThe author of the message
DateCreateddate stringThe timestamp of creation of the message (DEPRECATED)
TostringChannel String Identifier of the Channel the Message is being sent to (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onMessageRemove
MessageSidstringThe Message SID
ChannelSidstringSID identifier of the Channel the Message is being sent to
BodystringThe body of message
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in message entity.
FromstringThe author of the message
DateCreateddate stringThe timestamp from message creation
RemovedBystringThe remover of the message
TostringChannel String Identifier of the Channel the Message is being sent to (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onMessageUpdate
MessageSidstringThe Message SID
ChannelSidstringSID identifier of the Channel the Message is being sent to
BodystringThe body of message
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in message entity
FromstringThe author of the message
DateCreateddate stringThe timestamp from message creation
ModifiedBystringThe updater/modifier of the message
TostringChannel String Identifier of the Channel the Message is being sent to (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onMediaMessageSend
ChannelSidstringChannel SID identifier of the Channel the Message is being sent to
BodystringThe body of message
Attributesstring, optional, valid JSON structure or nullA JSON structure contained in a string. This can be null if attributes are not present in message entity.
FromstringThe author of the message
MediaFilenamestringThe filename of the underlying media file as specified when uploaded
MediaContentTypestringThe MIME type of the file this media represents.
MediaSidstringMedia SID identifier
MediaSizeintMedia size in bytes
DateCreateddate stringThe timestamp of creation of the message (DEPRECATED)
TostringChannel String Identifier of the Channel the Message is being sent to (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onChannelAdd
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in channel entity
CreatedBystringThe identity of the user that created a channel
FriendlyNamestring, optionalThe friendly name of the channel, if set
UniqueNamestring, optionalThe unique name of the channel, if set
ChannelTypestringThe Channel type. Either private or public
DateCreateddate stringThe date of creation of the channel (DEPRECATED)
Namestring, optionalThe friendly name of the channel, if set (DEPRECATED)
ChannelSidstringChannel String Identifier (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onChannelDestroy
ChannelSidstringChannel String Identifier
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in channel entity
DateCreatedstringThe date of creation of the channel
CreatedBydate stringThe identity of the user that created a channel
FriendlyNamestring, optionalThe friendly name of the channel, if set
UniqueNamestring, optionalThe unique name of the channel, if set
ChannelTypestringThe Channel type. Either private or public
Namestring, optionalThe friendly name of the channel, if set (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onChannelUpdate
ChannelSidstringChannel String Identifier
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in channel entity.
DateCreateddate string,The date of creation of the channel
CreatedBystringThe identity of the user that created a channel
FriendlyNamestring, optionalThe friendly name of the channel, if set
UniqueNamestring, optionalThe unique name of the channel, if set
Namestring, optionalThe friendly name of the channel, if set (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onMemberAdd
ChannelSidstringChannel String Identifier
IdentitystringThe Identity of the User being added to the channel as a Member
RoleSidstring, optionalThe Role SID of added member
ReasonstringThe reason for the addition of the member. Could be: ADDED or JOINED
Rolestring, optionalThe role of added member (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onMemberRemove
ChannelSidstringChannel String Identifier
IdentitystringThe Identity of the User being removed from the channel
MemberSidstringThe member SID of member being removed
RoleSidstring, optionalThe role of removed member
ReasonstringThe reason of the removal of the member. Could be: REMOVED or LEFT
Rolestring, optionalThe role of removed member (DEPRECATED)
parameter nametypedescription
EventTypestringAlways onMemberUpdate
ChannelSidstringChannel String Identifier
IdentitystringThe Identity of the Member being updated
MemberSidstringThe member SID identifier
RoleSidstring, optionalThe role of updated member
DateCreatedstring, ISO8601 timeCreation date of member
AttributesJSON, string, optionalThe optional Attributes (if set) of the Member being updated as a JSON structure in string format
parameter nametypedescription
UserSidstring, SIDThe SID of the User about to be updated
EventTypestringAlways onUserUpdate
IdentitystringThe Identity of the User being updated
FriendlyNamestring, optionalThe optional (if set) FriendlyName of the User being updated
RoleSidstringThe Role SID the user being updated
DateCreatedstring, ISO8601 timeThe date and time of initial User creation
DateUpdatedstring, ISO8601 timeThe date and time the user was last updated
AttributesJSON, string, optionalThe optional Attributes (if set) of the User being updated as a JSON structure in string format.
IsOnlineBoolean, optionaltrue if the user has an active session and can create and receive real-time events. This field is present only if the Reachability Indicator feature is enabled for the Service instance.
IsNotifiableBoolean, optionaltrue if the user has an active session and can create and receive push notifications. This field is present only if the Reachability Indicator and Push Notifications features are enabled for the Service instance. The User must have at least one Push Notification registration for Chat.

Post-Event Webhook Bodies

webhook-bodies-post-event page anchor
parameter nametypedescription
EventTypestringAlways onMessageSent
MessageSidstringThe Message SID of the new Message
IndexintThe index of the Message within the Channel Message list
ChannelSidstringChannel SID identifier of the Channel the Message is being sent to
BodystringThe body of the message
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in message entity
FromstringThe author of the message
DateCreateddate stringThe timestamp of message creation
parameter nametypedescription
EventTypestringAlways onMessageRemoved
MessageSidstringThe Message SID of the removed Message
IndexintThe index of the removed Message within the Channel Message list
ChannelSidstringThe SID identifier of the Channel the Message is being sent to
BodystringThe body of message
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in message entity
FromstringThe author of the message
RemovedBystringThe remover of the message
DateCreateddate stringThe timestamp of message creation
DateRemoveddate stringThe timestamp of removal of the message
parameter nametypedescription
EventTypestringAlways onMessageUpdated
MessageSidstringThe Message SID of the updated Message
IndexintThe index of the updated Message within the Channel Message list
ChannelSidstringSID identifier of the Channel the Message is being sent to
BodystringThe body of message
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in message entity
FromstringThe author of the message
ModifiedBystringThe identity of the user that updated the message
DateCreateddate stringThe timestamp of message creation
DateUpdateddate stringThe timestamp of update of the message
parameter nametypedescription
EventTypestringAlways onMediaMessageSent
MessageSidstringThe Message SID of the new Message
IndexintThe index of the Message within the Channel Message list
ChannelSidstringChannel SID identifier of the Channel the Message is being sent to
BodystringThe body of the message
Attributesstring, optional, valid JSON structure or nullStringified JSON structure. This can be null if attributes are not present in message entity
FromstringThe author of the message
DateCreateddate stringThe timestamp of message creation
MediaFilenamestringThe filename of the underlying media file as specified when uploaded
MediaContentTypestringThe MIME type of the file this media represents.
MediaSidstringMedia SID identifier
MediaSizeintMedia size in bytes
parameter nametypedescription
EventTypestringAlways onChannelAdded
ChannelSidstringThe SID of the newly added Channel
Attributesstring, optional, JSON structureThe arbitrary JSON structure of the channel
DateCreateddate stringThe date of channel creation
CreatedBystringThe identity of the user that created a channel
FriendlyNamestring, optionalThe friendly name of the channel, if set
UniqueNamestring, optionalThe unique name of the channel, if set
ChannelTypestringThe Channel type. Either private or public
parameter nametypedescription
EventTypestringAlways onChannelDestroyed
ChannelSidstringChannel String Identifier
Attributesstring, optional, JSON structureThe arbitrary JSON structure of the channel
DateCreateddate string,The date of creation of the channel
DateDestroyeddate string,The date of destruction of the channel
CreatedBystringThe identity of the user that created a channel
FriendlyNamestring, optionalThe friendly name of the channel, if set
UniqueNamestring, optionalThe unique name of the channel, if set
ChannelTypestringThe Channel type. Either private or public
parameter nametypedescription
EventTypestringAlways onChannelUpdated
ChannelSidstringChannel String Identifier
Attributesstring, optional, JSON structureThe arbitrary JSON structure of the channel
DateCreateddate string,The date of creation of the channel
DateUpdateddate stringThe date of update of the channel
CreatedBystringThe identity of the user that created a channel
FriendlyNamestring, optionalThe friendly name of the channel, if set
UniqueNamestring, optionalThe unique name of the channel, if set
ChannelTypestringThe Channel type. Either private or public
parameter nametypedescription
EventTypestringAlways onMemberAdded
MemberSidstringThe Member SID of the newly added Member
ChannelSidstringChannel String Identifier
IdentitystringThe Identity of the User being added to the channel as a Member
RoleSidstring, optionalThe Role SID of added member
ReasonstringThe reason for the addition of the member. Could be ADDED or JOINED
DateCreateddate stringThe date of Member addition
parameter nametypedescription
EventTypestringAlways onMemberRemoved
ChannelSidstringChannel String Identifier
IdentitystringThe Identity of the User being removed from the channel
MemberSidstringThe Member SID of member being removed
RoleSidstring, optionalThe role of removed member
ReasonstringThe reason for the removal of the member. Could be REMOVED or LEFT
DateCreateddate stringThe date of Member addition
DateRemoveddate stringThe date of Member removal
parameter nametypedescription
EventTypestringAlways onMemberUpdated
ChannelSidstringChannel String Identifier
IdentitystringThe Identity of the updated member
MemberSidstringThe member SID identifier
RoleSidstring, optionalThe role of updated member
DateCreatedstring, ISO8601 timeCreation date of member
DateUpdatedstring, ISO8601 timeThe date when member was last updated
AttributesJSON, string, optionalThe optional Attributes (if set) of the Member being updated as a JSON structure in string format
LastConsumedMessageIndexint, optionalIndex of the last consumed message by the member
parameter nametypedescription
UserSidstring, SIDThe SID of the User that was updated.
EventTypestringAlways onUserUpdated
IdentitystringThe Identity of the User that was updated
FriendlyNamestring, optionalThe optional FriendlyName (if set) of the updated User
RoleSidstringThe Role SID the User that was updated
DateCreatedstring, ISO8601 timeThe date and time the User was first created
DateUpdatedstring, ISO8601 timeThe date and time the User was updated
AttributesJSON, string, optionalThe optional Attributes of the updated user (if set). JSON structure in string format.
IsOnlineBoolean, optionaltrue if the user has an active session and can create and receive real-time events. This field is present only if Reachability Indicator feature is enabled for the Service instance.
IsNotifiableBoolean, optionaltrue if the user has an active session and can create and receive push notifications. This field is present only if the Reachability Indicator and Push Notifications features are enabled for the Service instance. The User must also have at least one Push Notification registration for Chat.
parameter nametypedescription
UserSidstring, SIDThe SID of the User that was updated.
EventTypestringAlways onUserAdded
IdentitystringThe Identity of the User that was updated
FriendlyNamestring, optionalThe optional FriendlyName (if set) of the updated User
RoleSidstringThe Role SID the User that was updated
DateCreatedstring, ISO8601 timeThe date and time the User was first created
AttributesJSON, string, optionalThe optional Attributes of the updated user (if set). JSON structure in string format.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.