Per-Service Webhook Resource
The Per-Service Webhook resource allows you to control the effects of webhooks in a particular Conversation Service. The webhooks will only fire for activity at the service-level.
Services allow you to:
- Create multiple, distinct environments (such as dev, stage, and prod) under a single Twilio account
- Scope access to resources through both the REST and client APIs
- Configure different service instances with specific behaviors
Every service can have unique webhook targets. This means you can include different metadata in the URLs or even trigger different behavior for different services.
Webhook targets for the Service Instance (the URL that Twilio will invoke) are configured in the Twilio Console.
If configured, service-scoped webhooks will override your global webhook settings such that only the service-scoped hooks will fire. This applies only to the services where service-level hooks are configured. See Conversations Webhooks for more information.
ServiceWebhookConfiguration properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The unique ID of the Account responsible for this service. |
chat_service_sid
|
The unique ID of the Conversation Service this conversation belongs to. |
pre_webhook_url
|
The absolute url the pre-event webhook request should be sent to. |
post_webhook_url
|
The absolute url the post-event webhook request should be sent to. |
filters
|
The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are |
method
|
The HTTP method to be used when sending a webhook request. One of |
url
|
An absolute API resource URL for this webhook. |
Fetch a ServiceWebhookConfiguration resource
https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Webhooks
Parameters
Parameters in REST API format | |
---|---|
chat_service_sid
Path
|
The unique ID of the Conversation Service this conversation belongs to. |
Example 1
Update a ServiceWebhookConfiguration resource
https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Webhooks
Parameters
Parameters in REST API format | |
---|---|
chat_service_sid
Path
|
The unique ID of the Conversation Service this conversation belongs to. |
pre_webhook_url
Optional
|
The absolute url the pre-event webhook request should be sent to. |
post_webhook_url
Optional
|
The absolute url the post-event webhook request should be sent to. |
filters
Optional
|
The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are |
method
Optional
|
The HTTP method to be used when sending a webhook request. One of |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.