NAME
Twilio::Rest::Verify::V2::Service::Entity::NewFactor - The NewFactor resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $new_factor = $client->verify->v2->services($service_sid)->entities($identity)->new_factors->create($friendly_name, $factor_type, \%options);
DESCRIPTION
This file holds NewFactorList and NewFactorInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
NewFactorList
Returned by $client->verify->v2->services($service_sid)->entities($identity)->new_factors. See also Twilio::ListResource.
create
my $new_factor = $client->verify->v2->services($service_sid)->entities($identity)->new_factors->create($friendly_name, $factor_type, \%options);
Create a new Factor for the Entity. Returns a NewFactorInstance.
The required values are:
$friendly_name-
The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For
factor_typepush, this could be a device name. Forfactor_typetotp, this value is used as the “account name” in constructing thebinding.uriproperty. At the same time, we recommend avoiding providing PII. $factor_type-
One of
push,totporpasskeys.
The options are:
binding_alg-
The algorithm used when
factor_typeispush. Algorithm supported:ES256 binding_public_key-
The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when
factor_typeispush binding_secret-
The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when
factor_typeistotp config_alg-
One of
sha1,sha256orsha512. config_app_id-
The ID that uniquely identifies your app in the Google or Apple store, such as
com.example.myapp. It can be up to 100 characters long. Required whenfactor_typeispush. config_code_length-
Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property
totp.code_length. If not configured defaults to 6. Used whenfactor_typeistotp config_notification_platform-
One of
apn,fcmornone. config_notification_token-
For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when
factor_typeispush. config_sdk_version-
The Verify Push SDK version used to configure the factor Required when
factor_typeispush config_skew-
The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property
totp.skew. If not configured defaults to 1. Used whenfactor_typeistotp config_time_step-
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. The default value is defined at the service level in the property
totp.time_step. Defaults to 30 seconds if not configured. Used whenfactor_typeistotp metadata-
Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg.
{"os": "Android"}. Can be up to 1024 characters in length. A hash or array reference, or a string of JSON.
NewFactorInstance
See also Twilio::InstanceResource.
Its fields are:
- account_sid
-
The unique SID identifier of the Account.
- binding
-
Contains the
factor_typespecific secret and metadata. For push, this isbinding.public_keyandbinding.alg. For totp, this isbinding.secretandbinding.uri. Thebinding.uriproperty is generated following the google authenticator key URI format, andFactor.friendly_nameis used for the “accountname” value andService.friendly_nameorService.totp.issueris used for theissuervalue. The Binding property is ONLY returned upon Factor creation. - config
-
An object that contains configurations specific to a
factor_type. - date_created
-
The date that this Factor was created, given in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date that this Factor was updated, given in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- entity_sid
-
The unique SID identifier of the Entity.
- factor_type
-
One of
push,totporpasskeys. - friendly_name
-
The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For
factor_typepush, this could be a device name. Forfactor_typetotp, this value is used as the “account name” in constructing thebinding.uriproperty. At the same time, we recommend avoiding providing PII. - identity
-
Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
- metadata
-
Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg.
{"os": "Android"}. Can be up to 1024 characters in length. - options
-
No description in the specification.
- service_sid
-
The unique SID identifier of the Service.
- sid
-
A 34 character string that uniquely identifies this Factor.
- status
-
One of
unverifiedorverified. - url
-
The URL of this 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.