NAME

Twilio::Rest::Conversations::V1::Service::Conversation::Webhook - The Webhook resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $webhook = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->create($target, \%options);
for my $webhook ($client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->read({}, 20)) {
  ...
}
my $webhook = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks($sid)->fetch;
$client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks($sid)->update(\%options);
$client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks($sid)->delete;

DESCRIPTION

A Conversation-scoped Webhook resource manages a set of callback URLs and their configuration for receiving events specific to one conversation.

This file holds WebhookList, WebhookPage, WebhookContext and WebhookInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

WebhookList

Returned by $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks. See also Twilio::ListResource.

create

my $webhook = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->create($target, \%options);

Create a new webhook scoped to the conversation in a specific service. Returns a WebhookInstance.

The required values are:

$target

One of webhook, trigger or studio.

The options are:

configuration_filters

The list of events, firing webhook event for this Conversation. An array reference.

configuration_flow_sid

The studio flow SID, where the webhook should be sent to.

configuration_method

One of get or post.

configuration_replay_after

The message index for which and it's successors the webhook will be replayed. Not set by default

configuration_triggers

The list of keywords, firing webhook event for this Conversation. An array reference.

configuration_url

The absolute url the webhook request should be sent to.

read

my @records = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->read(\%options, $limit, $page_size);

Retrieve a list of all webhooks scoped to the conversation. Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks->get_context($sid);

Returns a WebhookContext, and makes no request.

WebhookPage

A Twilio::Page of WebhookInstance objects.

records_key

build_instance

Used by Twilio::Page.

WebhookContext

Returned by $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks($sid). It makes no request until one of these methods is called.

fetch

my $webhook = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks($sid)->fetch;

Fetch the configuration of a conversation-scoped webhook. Returns a WebhookInstance.

update

my $webhook = $client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks($sid)->update(\%options);

Update an existing conversation-scoped webhook. Returns a WebhookInstance.

The options are:

configuration_filters

The list of events, firing webhook event for this Conversation. An array reference.

configuration_flow_sid

The studio flow SID, where the webhook should be sent to.

configuration_method

One of get or post.

configuration_triggers

The list of keywords, firing webhook event for this Conversation. An array reference.

configuration_url

The absolute url the webhook request should be sent to.

delete

$client->conversations->v1->services($chat_service_sid)->conversations($conversation_sid)->webhooks($sid)->delete;

Remove an existing webhook scoped to the conversation. Returns true.

WebhookInstance

See also Twilio::InstanceResource.

It has fetch, update and delete, which work as they do on the context.

Its fields are:

account_sid

The unique ID of the Account responsible for this conversation.

chat_service_sid

The SID of the Conversation Service the Participant resource is associated with.

configuration

The configuration of this webhook. Is defined based on target.

conversation_sid

The unique ID of the Conversation for this webhook.

date_created

The date that this resource was created. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

date_updated

The date that this resource was last updated. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

sid

A 34 character string that uniquely identifies this resource.

target

The target of this webhook: webhook, studio, trigger

url

An absolute API resource URL for this webhook.

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.