Menu

Expand
Rate this page:

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
sid<AC> Not PII

The unique ID of the Account responsible for this service.

chat_service_sid
sid<IS> Not PII

The unique ID of the Conversation Service this conversation belongs to.

pre_webhook_url
url Not PII

The absolute url the pre-event webhook request should be sent to.

post_webhook_url
url Not PII

The absolute url the post-event webhook request should be sent to.

filters
string[] Not PII

The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are onParticipantAdd, onParticipantAdded, onDeliveryUpdated, onConversationUpdated, onConversationRemove, onParticipantRemove, onConversationUpdate, onMessageAdd, onMessageRemoved, onParticipantUpdated, onConversationAdded, onMessageAdded, onConversationAdd, onConversationRemoved, onParticipantUpdate, onMessageRemove, onMessageUpdated, onParticipantRemoved, onMessageUpdate or onConversationStateUpdated.

method
enum:method Not PII

The HTTP method to be used when sending a webhook request. One of GET or POST.

url
url Not PII

An absolute API resource URL for this webhook.

Fetch a ServiceWebhookConfiguration resource

get
https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Webhooks
Parameters
Parameters in REST API format
chat_service_sid
Path
get sid<IS> Not PII

The unique ID of the Conversation Service this conversation belongs to.

Example 1
        
        
        

        Update a ServiceWebhookConfiguration resource

        post
        https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Webhooks
        Parameters
        Parameters in REST API format
        chat_service_sid
        Path
        post sid<IS> Not PII

        The unique ID of the Conversation Service this conversation belongs to.

        pre_webhook_url
        Optional
        post url Not PII

        The absolute url the pre-event webhook request should be sent to.

        post_webhook_url
        Optional
        post url Not PII

        The absolute url the post-event webhook request should be sent to.

        filters
        Optional
        post string[] Not PII

        The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are onParticipantAdd, onParticipantAdded, onDeliveryUpdated, onConversationUpdated, onConversationRemove, onParticipantRemove, onConversationUpdate, onMessageAdd, onMessageRemoved, onParticipantUpdated, onConversationAdded, onMessageAdded, onConversationAdd, onConversationRemoved, onParticipantUpdate, onMessageRemove, onMessageUpdated, onParticipantRemoved, onMessageUpdate or onConversationStateUpdated.

        method
        Optional
        post string Not PII

        The HTTP method to be used when sending a webhook request. One of GET or POST.

        Example 1
              
              
              
              Rate this page:

              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.

                    
                    
                    

                    Thank you for your feedback!

                    Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    Refer us and get $10 in 3 simple steps!

                    Step 1

                    Get link

                    Get a free personal referral link here

                    Step 2

                    Give $10

                    Your user signs up and upgrade using link

                    Step 3

                    Get $10

                    1,250 free SMSes
                    OR 1,000 free voice mins
                    OR 12,000 chats
                    OR more