Menu

Expand
Rate this page:

Webhook Configuration Resource

The Webhook Configuration resource allows you to precisely control the effects of account-scoped webhooks. Sending a POST request to the Webhook Configuration endpoint is equivalent to configuring session webhooks in the Twilio Console.

Good applications of the configured webhooks in Conversations include:

  • Implementing an archival system for all Conversations
  • Feeding messages into Elasticsearch
  • Implementing a profanity filter across all Conversations

Note: You can send pre-hooks and post-hooks to different targets.

Our guide to Conversations Webhooks includes the specific pre- and post-event webhooks that fire, as well as the webhook payloads.

ConfigurationWebhook properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The unique ID of the Account responsible for this conversation.

method
enum:method Not PII

The HTTP method to be used when sending a webhook request.

filters
string[] Not PII

The list of webhook event triggers that are enabled for this Service: onMessageAdded, onMessageUpdated, onMessageRemoved, onConversationUpdated, onConversationRemoved, onParticipantAdded, onParticipantUpdated, onParticipantRemoved

pre_webhook_url
string Not PII

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

post_webhook_url
string Not PII

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

target
enum:target Not PII

The routing target of the webhook. Can be ordinary or route internally to Flex

url
url Not PII

An absolute API resource API resource URL for this webhook.

Fetch a ConfigurationWebhook resource

get
https://conversations.twilio.com/v1/Configuration/Webhooks
Example 1
Loading Code Sample...
        
        

        FETCH: Retrieve a Webhook Configuration Resource

        Update a ConfigurationWebhook resource

        post
        https://conversations.twilio.com/v1/Configuration/Webhooks
        Parameters
        Parameters in REST API format
        method
        Optional
        post string Not PII

        The HTTP method to be used when sending a webhook request.

        filters
        Optional
        post string[] Not PII

        The list of webhook event triggers that are enabled for this Service: onMessageAdded, onMessageUpdated, onMessageRemoved, onConversationUpdated, onConversationRemoved, onParticipantAdded, onParticipantUpdated, onParticipantRemoved

        pre_webhook_url
        Optional
        post string Not PII

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

        post_webhook_url
        Optional
        post string Not PII

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

        target
        Optional
        post ienum:target Not PII

        The routing target of the webhook.

        Example 1
        Loading Code Sample...
              
              
              Enable for "onConversationUpdated" & "onMessageRemoved" events

              UPDATE: Enable all Webhooks with filters

              Enable for "onConversationUpdated" & "onMessageRemoved" events
              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.

              Loading Code Sample...
                    
                    
                    

                    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!

                    thanks-feedback-gif