# Conversation Scoped Webhook Resource

**Conversation Scoped Webhooks** provide a way to attach a unique monitor, bot, or other integration to each conversation.

Each individual Conversation can have as many as five such webhooks, as needed for your use case. This is your go-to tool for adding integrations with third-party bots or [Twilio Studio](/docs/studio).

For bot integrations, in particular, pay specific attention to the `ReplayAfter` parameter to ensure that you don't miss any messages that arrive while you're configuring the integration.

> \[!NOTE]
>
> Only post-event webhooks are supported by the Conversation-Scoped Webhooks.

## API Base URL

All URLs in the reference documentation use the following base URL:

```bash
https://conversations.twilio.com/v1
```

### Using the shortened base URL

Using the REST API, you can interact with Conversation Scoped Webhook resources in the **default Conversation Service** instance via a "shortened" URL that does not include the Conversation Service instance SID ("ISXXX..."). If you are only using one Conversation Service (the default), you do not need to include the Conversation Service SID in your URL, e.g.

```bash
GET /v1/Conversations/CHxxx/Webhooks

```

For Conversations applications that build on more than one Conversation Service instance, you will need to specify the Conversation Service SID in the REST API call:

```bash
GET /v1/Services/ISxx/Conversations/CHxx/Webhooks
```

## Webhook Properties

```json
{"type":"object","refName":"conversations.v1.conversation.conversation_scoped_webhook","modelName":"conversations_v1_conversation_conversation_scoped_webhook","properties":{"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^WH[0-9a-fA-F]{32}$","nullable":true,"description":"A 34 character string that uniquely identifies this resource."},"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The unique ID of the [Account](/docs/iam/api/account) responsible for this conversation."},"conversation_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^CH[0-9a-fA-F]{32}$","nullable":true,"description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this webhook."},"target":{"type":"string","nullable":true,"description":"The target of this webhook: `webhook`, `studio`, `trigger`"},"url":{"type":"string","format":"uri","nullable":true,"description":"An absolute API resource URL for this webhook."},"configuration":{"nullable":true,"description":"The configuration of this webhook. Is defined based on target."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date that this resource was created."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date that this resource was last updated."}}}
```

## Create a ConversationScopedWebhook resource

`POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Webhooks`

### Path parameters

```json
[{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this webhook.","schema":{"type":"string"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateConversationScopedWebhookRequest","required":["Target"],"properties":{"Target":{"type":"string","enum":["webhook","trigger","studio"],"description":"The target of this webhook: `webhook`, `studio`, `trigger`","refName":"conversation_scoped_webhook_enum_target","modelName":"conversation_scoped_webhook_enum_target"},"Configuration.Url":{"type":"string","description":"The absolute url the webhook request should be sent to."},"Configuration.Method":{"type":"string","enum":["get","post"],"refName":"conversation_scoped_webhook_enum_method","modelName":"conversation_scoped_webhook_enum_method"},"Configuration.Filters":{"type":"array","description":"The list of events, firing webhook event for this Conversation.","items":{"type":"string"}},"Configuration.Triggers":{"type":"array","description":"The list of keywords, firing webhook event for this Conversation.","items":{"type":"string"}},"Configuration.FlowSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^FW[0-9a-fA-F]{32}$","description":"The studio flow SID, where the webhook should be sent to."},"Configuration.ReplayAfter":{"type":"integer","description":"The message index for which and it's successors the webhook will be replayed. Not set by default"}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"Target\": \"webhook\",\n  \"Configuration.Url\": \"https://example.com\",\n  \"Configuration.Method\": \"get\",\n  \"Configuration.Filters\": [\n    \"onMessageSent\",\n    \"onConversationDestroyed\"\n  ],\n  \"Configuration.ReplayAfter\": 7\n}","meta":"","code":"{\n  \"Target\": \"webhook\",\n  \"Configuration.Url\": \"https://example.com\",\n  \"Configuration.Method\": \"get\",\n  \"Configuration.Filters\": [\n    \"onMessageSent\",\n    \"onConversationDestroyed\"\n  ],\n  \"Configuration.ReplayAfter\": 7\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Target\"","#7EE787"],[":","#C9D1D9"]," ",["\"webhook\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Configuration.Url\"","#7EE787"],[":","#C9D1D9"]," ",["\"https://example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Configuration.Method\"","#7EE787"],[":","#C9D1D9"]," ",["\"get\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Configuration.Filters\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["\"onMessageSent\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"onConversationDestroyed\"","#A5D6FF"],"\n  ",["],","#C9D1D9"],"\n  ",["\"Configuration.ReplayAfter\"","#7EE787"],[":","#C9D1D9"]," ",["7","#79C0FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

CREATE: Attach a new Conversation Scoped Webhook

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createConversationScopedWebhook() {
  const webhook = await client.conversations.v1
    .conversations("ConversationSid")
    .webhooks.create({
      "configuration.filters": ["onMessageAdded", "onConversationRemoved"],
      "configuration.method": "get",
      "configuration.url": "https://example.com",
      target: "webhook",
    });

  console.log(webhook.sid);
}

createConversationScopedWebhook();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

webhook = client.conversations.v1.conversations(
    "ConversationSid"
).webhooks.create(
    target="webhook",
    configuration_method="get",
    configuration_filters=["onMessageAdded", "onConversationRemoved"],
    configuration_url="https://example.com",
)

print(webhook.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Conversation;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var webhook = await WebhookResource.CreateAsync(
            target: WebhookResource.TargetEnum.Webhook,
            configurationMethod: WebhookResource.MethodEnum.Get,
            configurationFilters: new List<string> { "onMessageAdded", "onConversationRemoved" },
            configurationUrl: "https://example.com",
            pathConversationSid: "ConversationSid");

        Console.WriteLine(webhook.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.Arrays;
import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.conversation.Webhook;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Webhook webhook = Webhook.creator("ConversationSid", Webhook.Target.WEBHOOK)
                              .setConfigurationMethod(Webhook.Method.GET)
                              .setConfigurationFilters(Arrays.asList("onMessageAdded", "onConversationRemoved"))
                              .setConfigurationUrl("https://example.com")
                              .create();

        System.out.println(webhook.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.CreateConversationScopedWebhookParams{}
	params.SetTarget("webhook")
	params.SetConfigurationMethod("get")
	params.SetConfigurationFilters([]string{
		"onMessageAdded",
		"onConversationRemoved",
	})
	params.SetConfigurationUrl("https://example.com")

	resp, err := client.ConversationsV1.CreateConversationScopedWebhook("ConversationSid",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$webhook = $twilio->conversations->v1
    ->conversations("ConversationSid")
    ->webhooks->create(
        "webhook", // Target
        [
            "configurationMethod" => "get",
            "configurationFilters" => [
                "onMessageAdded",
                "onConversationRemoved",
            ],
            "configurationUrl" => "https://example.com",
        ]
    );

print $webhook->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

webhook = @client
          .conversations
          .v1
          .conversations('ConversationSid')
          .webhooks
          .create(
            target: 'webhook',
            configuration_method: 'get',
            configuration_filters: [
              'onMessageAdded',
              'onConversationRemoved'
            ],
            configuration_url: 'https://example.com'
          )

puts webhook.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:conversations:webhooks:create \
   --conversation-sid ConversationSid \
   --target webhook \
   --configuration.method get \
   --configuration.filters onMessageAdded onConversationRemoved \
   --configuration.url https://example.com
```

```bash
curl -X POST "https://conversations.twilio.com/v1/Conversations/ConversationSid/Webhooks" \
--data-urlencode "Target=webhook" \
--data-urlencode "Configuration.Method=get" \
--data-urlencode "Configuration.Filters=onMessageAdded" \
--data-urlencode "Configuration.Filters=onConversationRemoved" \
--data-urlencode "Configuration.Url=https://example.com" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "conversation_sid": "ConversationSid",
  "sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "target": "webhook",
  "configuration": {
    "url": "https://example.com",
    "method": "get",
    "filters": [
      "onMessageSent",
      "onConversationDestroyed"
    ]
  },
  "date_created": "2016-03-24T21:05:50Z",
  "date_updated": "2016-03-24T21:05:50Z",
  "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Fetch a ConversationScopedWebhook resource

`GET https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Webhooks/{Sid}`

### Path parameters

```json
[{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this webhook.","schema":{"type":"string"},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^WH[0-9a-fA-F]{32}$"},"required":true}]
```

FETCH: Retrieve a Conversation Scoped Webhook

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchConversationScopedWebhook() {
  const webhook = await client.conversations.v1
    .conversations("ConversationSid")
    .webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch();

  console.log(webhook.sid);
}

fetchConversationScopedWebhook();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

webhook = (
    client.conversations.v1.conversations("ConversationSid")
    .webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch()
)

print(webhook.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var webhook = await WebhookResource.FetchAsync(
            pathConversationSid: "ConversationSid", pathSid: "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(webhook.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.conversation.Webhook;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Webhook webhook = Webhook.fetcher("ConversationSid", "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch();

        System.out.println(webhook.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.ConversationsV1.FetchConversationScopedWebhook("ConversationSid",
		"WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$webhook = $twilio->conversations->v1
    ->conversations("ConversationSid")
    ->webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->fetch();

print $webhook->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

webhook = @client
          .conversations
          .v1
          .conversations('ConversationSid')
          .webhooks('WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .fetch

puts webhook.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:conversations:webhooks:fetch \
   --conversation-sid ConversationSid \
   --sid WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://conversations.twilio.com/v1/Conversations/ConversationSid/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "conversation_sid": "ConversationSid",
  "sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "target": "studio",
  "configuration": {
    "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "date_created": "2016-03-24T21:05:50Z",
  "date_updated": "2016-03-24T21:05:50Z",
  "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Read multiple ConversationScopedWebhook resources

`GET https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Webhooks`

### Path parameters

```json
[{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this webhook.","schema":{"type":"string"},"required":true}]
```

### Query parameters

```json
[{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 5, and the maximum is 5.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":5}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

READ: List all Conversation Scoped Webhooks

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listConversationScopedWebhook() {
  const webhooks = await client.conversations.v1
    .conversations("ConversationSid")
    .webhooks.list({ limit: 5 });

  webhooks.forEach((w) => console.log(w.sid));
}

listConversationScopedWebhook();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

webhooks = client.conversations.v1.conversations(
    "ConversationSid"
).webhooks.list(limit=5)

for record in webhooks:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var webhooks =
            await WebhookResource.ReadAsync(pathConversationSid: "ConversationSid", limit: 5);

        foreach (var record in webhooks) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.conversation.Webhook;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<Webhook> webhooks = Webhook.reader("ConversationSid").limit(5).read();

        for (Webhook record : webhooks) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.ListConversationScopedWebhookParams{}
	params.SetLimit(5)

	resp, err := client.ConversationsV1.ListConversationScopedWebhook("ConversationSid",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$webhooks = $twilio->conversations->v1
    ->conversations("ConversationSid")
    ->webhooks->read(5);

foreach ($webhooks as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

webhooks = @client
           .conversations
           .v1
           .conversations('ConversationSid')
           .webhooks
           .list(limit: 5)

webhooks.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:conversations:webhooks:list \
   --conversation-sid ConversationSid
```

```bash
curl -X GET "https://conversations.twilio.com/v1/Conversations/ConversationSid/Webhooks?PageSize=5" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "meta": {
    "page": 0,
    "page_size": 5,
    "first_page_url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0",
    "previous_page_url": null,
    "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0",
    "next_page_url": null,
    "key": "webhooks"
  },
  "webhooks": [
    {
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "target": "webhook",
      "configuration": {
        "url": "https://example.com",
        "method": "get",
        "filters": [
          "onMessageSent",
          "onConversationDestroyed"
        ]
      },
      "date_created": "2016-03-24T21:05:50Z",
      "date_updated": "2016-03-24T21:05:50Z",
      "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    },
    {
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "target": "trigger",
      "configuration": {
        "url": "https://example.com",
        "method": "post",
        "filters": [
          "keyword1",
          "keyword2"
        ]
      },
      "date_created": "2016-03-24T21:05:50Z",
      "date_updated": "2016-03-24T21:05:50Z",
      "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    },
    {
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "target": "studio",
      "configuration": {
        "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      "date_created": "2016-03-24T21:05:50Z",
      "date_updated": "2016-03-24T21:05:50Z",
      "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ]
}
```

## Update a ConversationScopedWebhook resource

`POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Webhooks/{Sid}`

### Path parameters

```json
[{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this webhook.","schema":{"type":"string"},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^WH[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateConversationScopedWebhookRequest","properties":{"Configuration.Url":{"type":"string","description":"The absolute url the webhook request should be sent to."},"Configuration.Method":{"type":"string","enum":["get","post"],"refName":"conversation_scoped_webhook_enum_method","modelName":"conversation_scoped_webhook_enum_method"},"Configuration.Filters":{"type":"array","description":"The list of events, firing webhook event for this Conversation.","items":{"type":"string"}},"Configuration.Triggers":{"type":"array","description":"The list of keywords, firing webhook event for this Conversation.","items":{"type":"string"}},"Configuration.FlowSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^FW[0-9a-fA-F]{32}$","description":"The studio flow SID, where the webhook should be sent to."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"Configuration.Url\": \"https://example.com\",\n  \"Configuration.Method\": \"post\",\n  \"Configuration.Triggers\": [\n    \"keyword1\",\n    \"keyword2\"\n  ]\n}","meta":"","code":"{\n  \"Configuration.Url\": \"https://example.com\",\n  \"Configuration.Method\": \"post\",\n  \"Configuration.Triggers\": [\n    \"keyword1\",\n    \"keyword2\"\n  ]\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Configuration.Url\"","#7EE787"],[":","#C9D1D9"]," ",["\"https://example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Configuration.Method\"","#7EE787"],[":","#C9D1D9"]," ",["\"post\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Configuration.Triggers\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["\"keyword1\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"keyword2\"","#A5D6FF"],"\n  ",["]","#C9D1D9"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

UPDATE: Configure a Conversation Scoped Webhook

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateConversationScopedWebhook() {
  const webhook = await client.conversations.v1
    .conversations("ConversationSid")
    .webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update({ "configuration.filters": ["keyword1", "keyword2"] });

  console.log(webhook.configuration);
}

updateConversationScopedWebhook();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

conversation_scoped_webhook = (
    client.conversations.v1.conversations("ConversationSid")
    .webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update(configuration_filters=["keyword1", "keyword2"])
)

print(conversation_scoped_webhook.configuration)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Conversation;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var webhook = await WebhookResource.UpdateAsync(
            configurationFilters: new List<string> { "keyword1", "keyword2" },
            pathConversationSid: "ConversationSid",
            pathSid: "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(webhook.Configuration);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.Arrays;
import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.conversation.Webhook;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Webhook webhook = Webhook.updater("ConversationSid", "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
                              .setConfigurationFilters(Arrays.asList("keyword1", "keyword2"))
                              .update();

        System.out.println(webhook.getConfiguration());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.UpdateConversationScopedWebhookParams{}
	params.SetConfigurationFilters([]string{
		"keyword1",
		"keyword2",
	})

	resp, err := client.ConversationsV1.UpdateConversationScopedWebhook("ConversationSid",
		"WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Configuration != nil {
			fmt.Println(*resp.Configuration)
		} else {
			fmt.Println(resp.Configuration)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$conversation_scoped_webhook = $twilio->conversations->v1
    ->conversations("ConversationSid")
    ->webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->update(["configurationFilters" => ["keyword1", "keyword2"]]);

print $conversation_scoped_webhook->configuration;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

webhook = @client
          .conversations
          .v1
          .conversations('ConversationSid')
          .webhooks('WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .update(
            configuration_filters: [
              'keyword1',
              'keyword2'
            ]
          )

puts webhook.configuration
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:conversations:webhooks:update \
   --conversation-sid ConversationSid \
   --sid WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --configuration.filters keyword1 keyword2
```

```bash
curl -X POST "https://conversations.twilio.com/v1/Conversations/ConversationSid/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--data-urlencode "Configuration.Filters=keyword1" \
--data-urlencode "Configuration.Filters=keyword2" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "conversation_sid": "ConversationSid",
  "sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "target": "trigger",
  "configuration": {
    "url": "https://example.com",
    "method": "post",
    "filters": [
      "keyword1",
      "keyword2"
    ]
  },
  "date_created": "2016-03-24T21:05:50Z",
  "date_updated": "2016-03-24T21:05:51Z",
  "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Delete a ConversationScopedWebhook resource

`DELETE https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Webhooks/{Sid}`

### Path parameters

```json
[{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this webhook.","schema":{"type":"string"},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^WH[0-9a-fA-F]{32}$"},"required":true}]
```

DELETE: Detach a Conversation Scoped Webhook

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteConversationScopedWebhook() {
  await client.conversations.v1
    .conversations("ConversationSid")
    .webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .remove();
}

deleteConversationScopedWebhook();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.conversations.v1.conversations("ConversationSid").webhooks(
    "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await WebhookResource.DeleteAsync(
            pathConversationSid: "ConversationSid", pathSid: "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.conversation.Webhook;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Webhook.deleter("ConversationSid", "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	err := client.ConversationsV1.DeleteConversationScopedWebhook("ConversationSid",
		"WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->conversations->v1
    ->conversations("ConversationSid")
    ->webhooks("WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .conversations
  .v1
  .conversations('ConversationSid')
  .webhooks('WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:conversations:webhooks:remove \
   --conversation-sid ConversationSid \
   --sid WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X DELETE "https://conversations.twilio.com/v1/Conversations/ConversationSid/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
