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.
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.
A Channel Webhook resource describes a webhook target that is specific to a Channel. By default, events in a Programmable Chat instance are delivered to a webhook address that is specified for the whole Chat Service. However, you can use this resource to specify up to five unique webhook targets for each channel to handle exceptional cases.
The webhook target can be a Web URL or a Studio Flow.
sid
type: SID<WH>The unique string that we created to identify the Channel Webhook resource.
^WH[0-9a-fA-F]{32}$
34
34
account_sid
type: SID<AC>The SID of the Account that created the Channel Webhook resource.
^AC[0-9a-fA-F]{32}$
34
34
service_sid
type: SID<IS>The SID of the Service the Channel Webhook resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
channel_sid
type: SID<CH>The SID of the Channel the Channel Webhook resource belongs to.
^CH[0-9a-fA-F]{32}$
34
34
configuration
type: objectThe JSON string that describes how the channel webhook is configured. The configuration object contains the url
, method
, filters
, and retry_count
values that are configured by the create and update actions.
date_created
type: string<date-time>The date and time in GMT when the resource was created specified in ISO 8601 format.
POST https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
ServiceSid
type: SID<IS>The SID of the Service with the Channel to create the Webhook resource under.
^IS[0-9a-fA-F]{32}$
34
34
ChannelSid
type: stringThe SID of the Channel the new Channel Webhook resource belongs to. This value can be the Channel resource's sid
or unique_name
.
Type
type: enum<string>RequiredThe type of webhook. Can be: webhook
, studio
, or trigger
.
webhook
trigger
studio
Configuration.Method
type: enum<string>The HTTP method used to call configuration.url
. Can be: GET
or POST
and the default is POST
.
GET
POST
Configuration.Filters
type: array[string]The events that cause us to call the Channel Webhook. Used when type
is webhook
. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see Webhook Event Triggers.
Configuration.Triggers
type: array[string]A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when type
= trigger
.
Configuration.FlowSid
type: SID<FW>The SID of the Studio Flow to call when an event in configuration.filters
occurs. Used only when type
is studio
.
^FW[0-9a-fA-F]{32}$
34
34
Configuration.RetryCount
type: integerThe number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0.
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
ServiceSid
type: SID<IS>The SID of the Service with the Channel to fetch the Webhook resource from.
^IS[0-9a-fA-F]{32}$
34
34
ChannelSid
type: stringThe SID of the Channel the Channel Webhook resource to fetch belongs to. This value can be the Channel resource's sid
or unique_name
.
Sid
type: SID<WH>The SID of the Channel Webhook resource to fetch.
^WH[0-9a-fA-F]{32}$
34
34
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
ServiceSid
type: SID<IS>The SID of the Service with the Channel to read the resources from.
^IS[0-9a-fA-F]{32}$
34
34
ChannelSid
type: stringThe SID of the Channel the Channel Webhook resources to read belong to. This value can be the Channel resource's sid
or unique_name
.
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Page
type: integerThe page index. This value is simply for client state.
0
POST https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
ServiceSid
type: SID<IS>The SID of the Service with the Channel that has the Webhook resource to update.
^IS[0-9a-fA-F]{32}$
34
34
ChannelSid
type: stringThe SID of the Channel the Channel Webhook resource to update belongs to. This value can be the Channel resource's sid
or unique_name
.
Sid
type: SID<WH>The SID of the Channel Webhook resource to update.
^WH[0-9a-fA-F]{32}$
34
34
Configuration.Method
type: enum<string>The HTTP method used to call configuration.url
. Can be: GET
or POST
and the default is POST
.
GET
POST
Configuration.Filters
type: array[string]The events that cause us to call the Channel Webhook. Used when type
is webhook
. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see Webhook Event Triggers.
Configuration.Triggers
type: array[string]A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when type
= trigger
.
Configuration.FlowSid
type: SID<FW>The SID of the Studio Flow to call when an event in configuration.filters
occurs. Used only when type
= studio
.
^FW[0-9a-fA-F]{32}$
34
34
Configuration.RetryCount
type: integerThe number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0.
DELETE https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
ServiceSid
type: SID<IS>The SID of the Service with the Channel to delete the Webhook resource from.
^IS[0-9a-fA-F]{32}$
34
34
ChannelSid
type: stringThe SID of the Channel the Channel Webhook resource to delete belongs to. This value can be the Channel resource's sid
or unique_name
.
Sid
type: SID<WH>The SID of the Channel Webhook resource to delete.
^WH[0-9a-fA-F]{32}$
34
34