NAME

Twilio::Rest::Verify::V2::Service - The Service resource

SYNOPSIS

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

my $service = $client->verify->v2->services->create($friendly_name, \%options);
for my $service ($client->verify->v2->services->read({}, 20)) {
  ...
}
my $service = $client->verify->v2->services($sid)->fetch;
$client->verify->v2->services($sid)->update(\%options);
$client->verify->v2->services($sid)->delete;

DESCRIPTION

This file holds ServiceList, ServicePage, ServiceContext and ServiceInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ServiceList

Returned by $client->verify->v2->services. See also Twilio::ListResource.

create

my $service = $client->verify->v2->services->create($friendly_name, \%options);

Create a new Verification Service. Returns a ServiceInstance.

The required values are:

$friendly_name

A descriptive string that you create to describe the verification service. It can be up to 32 characters long. This value should not contain PII.

The options are:

code_length

The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive.

custom_code_enabled

Whether to allow sending verifications with a custom code instead of a randomly generated one.

default_template_sid

The default message template. Will be used for all SMS verifications unless explicitly overriden. SMS channel only.

do_not_share_warning_enabled

Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code

dtmf_input_required

Whether to ask the user to press a number before delivering the verify code in a phone call.

lookup_enabled

Whether to perform a lookup with each verification started and return info about the phone number.

passkeys_authenticator_attachment

The Authenticator Attachment for Passkeys. This is the type of authenticator that will be used to create Passkeys. It can be empty or it can have the values platform, cross-platform or any.

passkeys_discoverable_credentials

Indicates whether credentials must be discoverable by the authenticator. It can be empty or it can have the values required, preferred or discouraged.

passkeys_relying_party_id

The Relying Party ID for Passkeys. This is the domain of your application, e.g. example.com. It is used to identify your application when creating Passkeys.

passkeys_relying_party_name

The Relying Party Name for Passkeys. This is the name of your application, e.g. Example App. It is used to identify your application when creating Passkeys.

passkeys_relying_party_origins

The Relying Party Origins for Passkeys. This is the origin of your application, e.g. login.example.com,www.example.com. It is used to identify your application when creating Passkeys, it can have multiple origins split by ,.

passkeys_user_verification

The User Verification for Passkeys. This is the type of user verification that will be used to create Passkeys. It can be empty or it can have the values required, preferred or discouraged.

psd2_enabled

Whether to pass PSD2 transaction parameters when starting a verification.

push_apn_credential_sid

Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See Credential Resource

push_fcm_credential_sid

Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See Credential Resource

push_include_date

Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See Challenge resource’s details parameter for more info. Default: false. Deprecated do not use this parameter. This timestamp value is the same one as the one found in date_created, please use that one instead.

skip_sms_to_landlines

Whether to skip sending SMS verifications to landlines. Requires lookup_enabled.

totp_code_length

Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6

totp_issuer

Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided.

totp_skew

Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1

totp_time_step

Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds

tts_name

The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages.

verify_event_subscription_enabled

Whether to allow verifications from the service to reach the stream-events sinks if configured

whatsapp_from

The number to use as the WhatsApp Sender that Verify will use to send WhatsApp messages to your users.This WhatsApp Sender must be associated with a Messaging Service SID.

whatsapp_msg_service_sid

The SID of the Messaging Service containing WhatsApp Sender(s) that Verify will use to send WhatsApp messages to your users.

read

my @records = $client->verify->v2->services->read(\%options, $limit, $page_size);

Retrieve a list of all Verification Services for an account. Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->verify->v2->services->stream(\%options, $limit, $page_size);

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

page

my $page = $client->verify->v2->services->page(\%options, $page_size, $page_token, $page_number);

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

get_page

my $page = $client->verify->v2->services->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->verify->v2->services->get_context($sid);

Returns a ServiceContext, and makes no request.

ServicePage

A Twilio::Page of ServiceInstance objects.

records_key

build_instance

Used by Twilio::Page.

ServiceContext

Returned by $client->verify->v2->services($sid). It makes no request until one of these methods is called.

fetch

my $service = $client->verify->v2->services($sid)->fetch;

Fetch specific Verification Service Instance. Returns a ServiceInstance.

update

my $service = $client->verify->v2->services($sid)->update(\%options);

Update a specific Verification Service. Returns a ServiceInstance.

The options are:

code_length

The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive.

custom_code_enabled

Whether to allow sending verifications with a custom code instead of a randomly generated one.

default_template_sid

The default message template. Will be used for all SMS verifications unless explicitly overriden. SMS channel only.

do_not_share_warning_enabled

Whether to add a privacy warning at the end of an SMS. Disabled by default and applies only for SMS.

dtmf_input_required

Whether to ask the user to press a number before delivering the verify code in a phone call.

friendly_name

A descriptive string that you create to describe the verification service. It can be up to 32 characters long. This value should not contain PII.

lookup_enabled

Whether to perform a lookup with each verification started and return info about the phone number.

passkeys_authenticator_attachment

The Authenticator Attachment for Passkeys. This is the type of authenticator that will be used to create Passkeys. It can be empty or it can have the values platform, cross-platform or any.

passkeys_discoverable_credentials

Indicates whether credentials must be discoverable by the authenticator. It can be empty or it can have the values required, preferred or discouraged.

passkeys_relying_party_id

The Relying Party ID for Passkeys. This is the domain of your application, e.g. example.com. It is used to identify your application when creating Passkeys.

passkeys_relying_party_name

The Relying Party Name for Passkeys. This is the name of your application, e.g. Example App. It is used to identify your application when creating Passkeys.

passkeys_relying_party_origins

The Relying Party Origins for Passkeys. This is the origin of your application, e.g. login.example.com,www.example.com. It is used to identify your application when creating Passkeys, it can have multiple origins split by ,.

passkeys_user_verification

The User Verification for Passkeys. This is the type of user verification that will be used to create Passkeys. It can be empty or it can have the values required, preferred or discouraged.

psd2_enabled

Whether to pass PSD2 transaction parameters when starting a verification.

push_apn_credential_sid

Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See Credential Resource

push_fcm_credential_sid

Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See Credential Resource

push_include_date

Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See Challenge resource’s details parameter for more info. Default: false. Deprecated do not use this parameter.

skip_sms_to_landlines

Whether to skip sending SMS verifications to landlines. Requires lookup_enabled.

totp_code_length

Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6

totp_issuer

Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI.

totp_skew

Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1

totp_time_step

Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds

tts_name

The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages.

verify_event_subscription_enabled

Whether to allow verifications from the service to reach the stream-events sinks if configured

whatsapp_from

The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service.

whatsapp_msg_service_sid

The SID of the Messaging Service to associate with the Verification Service.

delete

$client->verify->v2->services($sid)->delete;

Delete a specific Verification Service Instance. Returns true.

access_tokens

my $list = $object->access_tokens;

my $context = $object->access_tokens($sid);

See Twilio::Rest::Verify::V2::Service::AccessToken.

approve_challenge

my $list = $object->approve_challenge;

See Twilio::Rest::Verify::V2::Service::ApproveChallenge.

entities

my $list = $object->entities;

my $context = $object->entities($identity);

See Twilio::Rest::Verify::V2::Service::Entity.

messaging_configurations

my $list = $object->messaging_configurations;

my $context = $object->messaging_configurations($country);

See Twilio::Rest::Verify::V2::Service::MessagingConfiguration.

new_challenge

my $context = $object->new_challenge;

See Twilio::Rest::Verify::V2::Service::NewChallenge.

new_factors

my $list = $object->new_factors;

See Twilio::Rest::Verify::V2::Service::NewFactor.

new_verify_factors

my $list = $object->new_verify_factors;

See Twilio::Rest::Verify::V2::Service::NewVerifyFactor.

rate_limits

my $list = $object->rate_limits;

my $context = $object->rate_limits($sid);

See Twilio::Rest::Verify::V2::Service::RateLimit.

verifications

my $list = $object->verifications;

my $context = $object->verifications($sid);

See Twilio::Rest::Verify::V2::Service::Verification.

verification_checks

my $list = $object->verification_checks;

See Twilio::Rest::Verify::V2::Service::VerificationCheck.

webhooks

my $list = $object->webhooks;

my $context = $object->webhooks($sid);

See Twilio::Rest::Verify::V2::Service::Webhook.

ServiceInstance

See also Twilio::InstanceResource.

It has fetch, update, delete, access_tokens, approve_challenge, entities, messaging_configurations, new_challenge, new_factors, new_verify_factors, rate_limits, verifications, verification_checks and webhooks, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created the Service resource.

code_length

The length of the verification code to generate.

custom_code_enabled

Whether to allow sending verifications with a custom code instead of a randomly generated one.

date_created

The date and time in GMT when 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 when the resource was last updated specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

default_template_sid

No description in the specification.

do_not_share_warning_enabled

Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code

dtmf_input_required

Whether to ask the user to press a number before delivering the verify code in a phone call.

friendly_name

The name that appears in the body of your verification messages. It can be up to 30 characters long and can include letters, numbers, spaces, dashes, underscores. Phone numbers, special characters or links are NOT allowed. It cannot contain more than 4 (consecutive or non-consecutive) digits. This value should not contain PII.

The URLs of related resources.

lookup_enabled

Whether to perform a lookup with each verification started and return info about the phone number.

passkeys

No description in the specification.

psd2_enabled

Whether to pass PSD2 transaction parameters when starting a verification.

push

Configurations for the Push factors (channel) created under this Service.

sid

The unique string that we created to identify the Service resource.

skip_sms_to_landlines

Whether to skip sending SMS verifications to landlines. Requires lookup_enabled.

totp

Configurations for the TOTP factors (channel) created under this Service.

tts_name

The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages.

url

The absolute URL of the resource.

verify_event_subscription_enabled

Whether to allow verifications from the service to reach the stream-events sinks if configured

whatsapp

No description in the specification.

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.