Update configuration webhook

POST /v1/Configuration/Webhooks

A Webhook resource manages a service-level set of callback URLs and their configuration for receiving all conversation events.

application/x-www-form-urlencoded

Body

  • Method string

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

  • Filters array[string]

    The list of webhook event triggers that are enabled for this Service: onMessageAdded, onMessageUpdated, onMessageRemoved, onMessageAdd, onMessageUpdate, onMessageRemove, onConversationUpdated, onConversationRemoved, onConversationAdd, onConversationAdded, onConversationRemove, onConversationUpdate, onConversationStateUpdated, onParticipantAdded, onParticipantUpdated, onParticipantRemoved, onParticipantAdd, onParticipantRemove, onParticipantUpdate, onDeliveryUpdated, onUserAdded, onUserUpdate, onUserUpdated

  • PreWebhookUrl string

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

  • PostWebhookUrl string

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

  • Target string

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

    Values are webhook or flex.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • account_sid string | null

      The unique ID of the Account responsible for this conversation.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • method string

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

      Values are GET or POST.

    • filters array[string] | null

      The list of webhook event triggers that are enabled for this Service: onMessageAdded, onMessageUpdated, onMessageRemoved, onMessageAdd, onMessageUpdate, onMessageRemove, onConversationUpdated, onConversationRemoved, onConversationAdd, onConversationAdded, onConversationRemove, onConversationUpdate, onConversationStateUpdated, onParticipantAdded, onParticipantUpdated, onParticipantRemoved, onParticipantAdd, onParticipantRemove, onParticipantUpdate, onDeliveryUpdated, onUserAdded, onUserUpdate, onUserUpdated

    • pre_webhook_url string | null

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

    • post_webhook_url string | null

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

    • target string

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

      Values are webhook or flex.

    • url string(uri) | null

      An absolute API resource API resource URL for this webhook.

POST /v1/Configuration/Webhooks
curl \
 --request POST 'https://conversations.twilio.com/v1/Configuration/Webhooks' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Method=GET&Target=webhook&Filters=onConversationUpdated&PreWebhookUrl=https%3A%2F%2Fexample.com%2Fpre&PostWebhookUrl=https%3A%2F%2Fexample.com%2Fpost'
Request example
{"Method"=>"GET", "Target"=>"webhook", "Filters"=>["onConversationUpdated"], "PreWebhookUrl"=>"https://example.com/pre", "PostWebhookUrl"=>"https://example.com/post"}
Response examples (200)
{
  "url": "https://conversations.twilio.com/v1/Configuration/Webhooks",
  "method": "GET",
  "target": "webhook",
  "filters": [
    "onConversationUpdated"
  ],
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "pre_webhook_url": "https://example.com/pre",
  "post_webhook_url": "http://example.com/post"
}