NAME
Twilio::Rest::Webhooks::V1::SharedKey - The SharedKey resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $shared_key = $client->webhooks->v1->shared_keys->create(\%body, \%options);
for my $shared_key ($client->webhooks->v1->shared_keys->read({}, 20)) {
...
}
my $shared_key = $client->webhooks->v1->shared_keys($shared_key_id)->fetch;
$client->webhooks->v1->shared_keys($shared_key_id)->patch(\%body);
$client->webhooks->v1->shared_keys($shared_key_id)->delete;
DESCRIPTION
This file holds SharedKeyList, SharedKeyPage, SharedKeyContext and SharedKeyInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
SharedKeyList
Returned by $client->webhooks->v1->shared_keys. See also Twilio::ListResource.
create
my $shared_key = $client->webhooks->v1->shared_keys->create(\%body, \%options);
Creates a new Shared Key for webhook signature validation. IMPORTANT: The secret field is ONLY returned in this response and cannot be retrieved later. Store it securely in your secrets management system. Returns a SharedKeyInstance.
%body is sent as JSON. It takes the names Twilio's API documentation uses.
Its fields are:
friendlyName-
Human-readable name for the signing key (optional, defaults to blank)
The options are:
idempotency_key-
Idempotency key for mutation operations. Must be a UUIDv7 (other UUID versions are rejected with a 400).
read
my @records = $client->webhooks->v1->shared_keys->read(\%options, $limit, $page_size);
Returns paginated list of SharedKey summaries (secrets never included). Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->webhooks->v1->shared_keys->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->webhooks->v1->shared_keys->page(\%options, $page_size, $page_token);
Fetches one page, and returns a Twilio::TokenPaginationPage. This API pages by token, so there is no page number.
get_page
my $page = $client->webhooks->v1->shared_keys->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->webhooks->v1->shared_keys->get_context($shared_key_id);
Returns a SharedKeyContext, and makes no request.
SharedKeyPage
A Twilio::Page of SharedKeyInstance objects.
records_key
build_instance
Used by Twilio::Page.
SharedKeyContext
Returned by $client->webhooks->v1->shared_keys($shared_key_id). It makes no request until one of these methods is called.
fetch
my $shared_key = $client->webhooks->v1->shared_keys($shared_key_id)->fetch;
Returns a SharedKey by its ID. The secret is never included in GET responses. Returns a SharedKeyInstance.
patch
my $shared_key = $client->webhooks->v1->shared_keys($shared_key_id)->patch(\%body);
Update SharedKey's friendlyName only. SharedKeys are otherwise immutable. Returns a SharedKeyInstance.
%body is sent as JSON. It takes the names Twilio's API documentation uses.
Its fields are:
friendlyName-
Human-readable name for the SharedKey
delete
$client->webhooks->v1->shared_keys($shared_key_id)->delete;
Permanently deletes a Shared Key. The API prevents deletion if any Settings reference this key. Delete the dependent Settings first, then delete the SharedKey. Returns true.
SharedKeyInstance
See also Twilio::InstanceResource.
It has fetch, patch and delete, which work as they do on the context.
Its fields are:
- created_at
-
A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- friendly_name
-
Human-readable name for identification
- id
-
Unique SharedKey identifier (TypeID/TTID format)
- secret
-
Signing secret (only returned on POST, cannot be retrieved later)
- updated_at
-
A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
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.