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.
The SID of the Service the Channel Webhook resource is associated with.
The 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.
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
.
The SID of the Channel the new Channel Webhook resource belongs to. This value can be the Channel resource's sid
or unique_name
.
The type of webhook. Can be: webhook
, studio
, or trigger
.
webhook
trigger
studio
The HTTP method used to call configuration.url
. Can be: GET
or POST
and the default is POST
.
GET
POST
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.
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
.
The SID of the Studio Flow to call when an event in configuration.filters
occurs. Used only when type
is studio
.
The 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
.
The SID of the Channel the Channel Webhook resource to fetch belongs to. This value can be the Channel resource's sid
or unique_name
.
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
The SID of the Channel the Channel Webhook resources to read belong to. This value can be the Channel resource's sid
or unique_name
.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
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
.
The SID of the Channel the Channel Webhook resource to update belongs to. This value can be the Channel resource's sid
or unique_name
.
The HTTP method used to call configuration.url
. Can be: GET
or POST
and the default is POST
.
GET
POST
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.
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
.
The SID of the Studio Flow to call when an event in configuration.filters
occurs. Used only when type
= studio
.
The 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
.
The SID of the Channel the Channel Webhook resource to delete belongs to. This value can be the Channel resource's sid
or unique_name
.