NAME
Twilio::Rest::Iam::V1::ApiKey - The ApiKey resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $api_key = $client->iam->v1->api_key($sid)->fetch;
$client->iam->v1->api_key($sid)->update(\%options);
$client->iam->v1->api_key($sid)->delete;
DESCRIPTION
API keys
This file holds ApiKeyList, ApiKeyContext and ApiKeyInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
ApiKeyList
Returned by $client->iam->v1->api_key. See also Twilio::ListResource.
get_context
my $context = $client->iam->v1->api_key->get_context($sid);
Returns a ApiKeyContext, and makes no request.
ApiKeyContext
Returned by $client->iam->v1->api_key($sid). It makes no request until one of these methods is called.
fetch
my $api_key = $client->iam->v1->api_key($sid)->fetch;
Fetch a specific Key. Returns a ApiKeyInstance.
update
my $api_key = $client->iam->v1->api_key($sid)->update(\%options);
Update a specific Key. Returns a ApiKeyInstance.
The options are:
friendly_name-
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
policy-
The \
Policy\object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the Twilio documentation. A hash or array reference, or a string of JSON.
delete
$client->iam->v1->api_key($sid)->delete;
Delete a specific Key. Returns true.
ApiKeyInstance
See also Twilio::InstanceResource.
It has fetch, update and delete, which work as they do on the context.
Its fields are:
- date_created
-
The date and time in GMT that the resource was created specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date and time in GMT that the resource was last updated specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- friendly_name
-
The string that you assigned to describe the resource.
- policy
-
The \
Policy\object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the Twilio documentation. - sid
-
The unique string that we created to identify the Key resource.
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.