# Factor Resource

The `Factor` resource is currently used by Verify Push and Verify TOTP features. It represents a verification factor/channel. When the `factor_type` is `push`, it contains the public key for a single registered device and metadata. When the `factor_type` is `totp`, it contains the seed used to generate TOTP codes and metadata. Some `Factor` properties apply to all `factor_types` and others do not. A single `Entity` links to multiple `Factors` and a single `Factor` links to multiple `Challenges`.

## Factor Properties

> \[!NOTE]
>
> For security reasons the `binding` property is ONLY returned upon creation, and is never returned afterward.

```json
{"type":"object","refName":"verify.v2.service.entity.factor","modelName":"verify_v2_service_entity_factor","properties":{"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^YF[0-9a-fA-F]{32}$","nullable":true,"description":"A 34 character string that uniquely identifies this Factor."},"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Account."},"service_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Service."},"entity_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^YE[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Entity."},"identity":{"type":"string","nullable":true,"description":"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.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Factor was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Factor was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"friendly_name":{"type":"string","nullable":true,"description":"A human readable description of this resource, up to 64 characters. For a push factor, this can be the device's name."},"status":{"type":"string","enum":["unverified","verified"],"description":"The Status of this Factor. One of `unverified` or `verified`.","refName":"factor_enum_factor_statuses","modelName":"factor_enum_factor_statuses"},"factor_type":{"type":"string","enum":["push","totp","passkeys"],"description":"The Type of this Factor. Currently `push` and `totp` are supported.","refName":"factor_enum_factor_types","modelName":"factor_enum_factor_types"},"config":{"nullable":true,"description":"An object that contains configurations specific to a `factor_type`."},"metadata":{"nullable":true,"description":"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.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"url":{"type":"string","format":"uri","nullable":true,"description":"The URL of this resource."}}}
```

## Create a new Factor resource

`POST`

```xml
https://verify.twilio.com/v2/Services/{ServiceSid}/Entities/{Identity}/Factors
```

> \[!NOTE]
>
> * Unverified Factors will be deleted and unverifiable after 1-24 hours from when they were created. This is done for security and clean-up reasons.
> * In the request, if the specified `Entity` with the `{Identity}` doesn't exist, it will be created automatically. You do not need to separately create a new Entity before making this request.

Parameters

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The unique SID identifier of the Service.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$"},"required":true},{"name":"Identity","in":"path","description":"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.","schema":{"type":"string"},"x-twilio":{"pii":{"handling":"standard","deleteSla":30}},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateNewFactorRequest","required":["FriendlyName","FactorType"],"properties":{"FriendlyName":{"type":"string","description":"The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors.\nFor `factor_type` `push`, this could be a device name.\nFor `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property.\nAt the same time, we recommend avoiding providing PII."},"FactorType":{"type":"string","enum":["push","totp","passkeys"],"description":"The Type of this Factor. Currently `push` and `totp` are supported.","refName":"new_factor_enum_factor_types","modelName":"new_factor_enum_factor_types"},"Binding.Alg":{"type":"string","description":"The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256`"},"Binding.PublicKey":{"type":"string","description":"The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64.\n\nRequired when `factor_type` is `push`"},"Config.AppId":{"type":"string","description":"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.\n\nRequired when `factor_type` is `push`."},"Config.NotificationPlatform":{"type":"string","enum":["apn","fcm","none"],"refName":"new_factor_enum_notification_platforms","modelName":"new_factor_enum_notification_platforms"},"Config.NotificationToken":{"type":"string","description":"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.\n\nRequired when `factor_type` is `push`."},"Config.SdkVersion":{"type":"string","description":"The Verify Push SDK version used to configure the factor\n\nRequired when `factor_type` is `push`"},"Binding.Secret":{"type":"string","description":"The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated.\n\nUsed when `factor_type` is `totp`"},"Config.TimeStep":{"type":"integer","description":"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.\n\nUsed when `factor_type` is `totp`"},"Config.Skew":{"type":"integer","description":"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.\n\nUsed when `factor_type` is `totp`"},"Config.CodeLength":{"type":"integer","description":"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.\n\nUsed when `factor_type` is `totp`"},"Config.Alg":{"type":"string","enum":["sha1","sha256","sha512"],"refName":"new_factor_enum_totp_algorithms","modelName":"new_factor_enum_totp_algorithms"},"Metadata":{"description":"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.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}}}},"examples":{"createPush":{"value":{"lang":"json","value":"{\n  \"FactorType\": \"push\",\n  \"FriendlyName\": \"FriendlyName\",\n  \"Binding.Alg\": \"ES256\",\n  \"Binding.PublicKey\": \"dGVzdF9rZXk=\",\n  \"Config.SdkVersion\": \"1.0\",\n  \"Config.AppId\": \"com.example.myapp\",\n  \"Config.NotificationPlatform\": \"fcm\",\n  \"Config.NotificationToken\": \"test_token\",\n  \"Metadata\": \"{\\\"os\\\": \\\"Android\\\"}\"\n}","meta":"","code":"{\n  \"FactorType\": \"push\",\n  \"FriendlyName\": \"FriendlyName\",\n  \"Binding.Alg\": \"ES256\",\n  \"Binding.PublicKey\": \"dGVzdF9rZXk=\",\n  \"Config.SdkVersion\": \"1.0\",\n  \"Config.AppId\": \"com.example.myapp\",\n  \"Config.NotificationPlatform\": \"fcm\",\n  \"Config.NotificationToken\": \"test_token\",\n  \"Metadata\": \"{\\\"os\\\": \\\"Android\\\"}\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FactorType\"","#7EE787"],[":","#C9D1D9"]," ",["\"push\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"FriendlyName\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Binding.Alg\"","#7EE787"],[":","#C9D1D9"]," ",["\"ES256\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Binding.PublicKey\"","#7EE787"],[":","#C9D1D9"]," ",["\"dGVzdF9rZXk=\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.SdkVersion\"","#7EE787"],[":","#C9D1D9"]," ",["\"1.0\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.AppId\"","#7EE787"],[":","#C9D1D9"]," ",["\"com.example.myapp\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.NotificationPlatform\"","#7EE787"],[":","#C9D1D9"]," ",["\"fcm\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.NotificationToken\"","#7EE787"],[":","#C9D1D9"]," ",["\"test_token\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Metadata\"","#7EE787"],[":","#C9D1D9"]," ",["\"{","#A5D6FF"],["\\\"","#79C0FF"],["os","#A5D6FF"],["\\\"","#79C0FF"],[":","#A5D6FF"]," ",["\\\"","#79C0FF"],["Android","#A5D6FF"],["\\\"","#79C0FF"],["}\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"createTotp":{"value":{"lang":"json","value":"{\n  \"FactorType\": \"totp\",\n  \"FriendlyName\": \"FriendlyName\",\n  \"Binding.Secret\": \"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\",\n  \"Config.Alg\": \"sha1\",\n  \"Config.TimeStep\": 30,\n  \"Config.CodeLength\": 6,\n  \"Config.Skew\": 1\n}","meta":"","code":"{\n  \"FactorType\": \"totp\",\n  \"FriendlyName\": \"FriendlyName\",\n  \"Binding.Secret\": \"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\",\n  \"Config.Alg\": \"sha1\",\n  \"Config.TimeStep\": 30,\n  \"Config.CodeLength\": 6,\n  \"Config.Skew\": 1\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FactorType\"","#7EE787"],[":","#C9D1D9"]," ",["\"totp\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"FriendlyName\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Binding.Secret\"","#7EE787"],[":","#C9D1D9"]," ",["\"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.Alg\"","#7EE787"],[":","#C9D1D9"]," ",["\"sha1\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.TimeStep\"","#7EE787"],[":","#C9D1D9"]," ",["30","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Config.CodeLength\"","#7EE787"],[":","#C9D1D9"]," ",["6","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Config.Skew\"","#7EE787"],[":","#C9D1D9"]," ",["1","#79C0FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Example 1

Create New Push Factor

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createNewFactor() {
  const newFactor = await client.verify.v2
    .services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .newFactors.create({
      "binding.alg": "ES256",
      "binding.publicKey": "dGVzdF9rZXk=",
      "config.appId": "com.example.myapp",
      "config.notificationPlatform": "fcm",
      "config.notificationToken": "test_token",
      "config.sdkVersion": "1.0.0",
      factorType: "push",
      friendlyName: "John's Phone",
    });

  console.log(newFactor.sid);
}

createNewFactor();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

new_factor = (
    client.verify.v2.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .new_factors.create(
        friendly_name="John's Phone",
        factor_type="push",
        binding_alg="ES256",
        binding_public_key="dGVzdF9rZXk=",
        config_app_id="com.example.myapp",
        config_sdk_version="1.0.0",
        config_notification_platform="fcm",
        config_notification_token="test_token",
    )
)

print(new_factor.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2.Service.Entity;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var newFactor = await NewFactorResource.CreateAsync(
            friendlyName: "John's Phone",
            factorType: NewFactorResource.FactorTypesEnum.Push,
            bindingAlg: "ES256",
            bindingPublicKey: "dGVzdF9rZXk=",
            configAppId: "com.example.myapp",
            configSdkVersion: "1.0.0",
            configNotificationPlatform: NewFactorResource.NotificationPlatformsEnum.Fcm,
            configNotificationToken: "test_token",
            pathServiceSid: "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathIdentity: "ff483d1ff591898a9942916050d2ca3f");

        Console.WriteLine(newFactor.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.service.entity.NewFactor;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        NewFactor newFactor = NewFactor
                                  .creator("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                                      "ff483d1ff591898a9942916050d2ca3f",
                                      "John's Phone",
                                      NewFactor.FactorTypes.PUSH)
                                  .setBindingAlg("ES256")
                                  .setBindingPublicKey("dGVzdF9rZXk=")
                                  .setConfigAppId("com.example.myapp")
                                  .setConfigSdkVersion("1.0.0")
                                  .setConfigNotificationPlatform(NewFactor.NotificationPlatforms.FCM)
                                  .setConfigNotificationToken("test_token")
                                  .create();

        System.out.println(newFactor.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.CreateNewFactorParams{}
	params.SetFriendlyName("John's Phone")
	params.SetFactorType("push")
	params.SetBindingAlg("ES256")
	params.SetBindingPublicKey("dGVzdF9rZXk=")
	params.SetConfigAppId("com.example.myapp")
	params.SetConfigSdkVersion("1.0.0")
	params.SetConfigNotificationPlatform("fcm")
	params.SetConfigNotificationToken("test_token")

	resp, err := client.VerifyV2.CreateNewFactor("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ff483d1ff591898a9942916050d2ca3f",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$new_factor = $twilio->verify->v2
    ->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->entities("ff483d1ff591898a9942916050d2ca3f")
    ->newFactors->create(
        "John's Phone", // FriendlyName
        "push", // FactorType
        [
            "bindingAlg" => "ES256",
            "bindingPublicKey" => "dGVzdF9rZXk=",
            "configAppId" => "com.example.myapp",
            "configSdkVersion" => "1.0.0",
            "configNotificationPlatform" => "fcm",
            "configNotificationToken" => "test_token",
        ]
    );

print $new_factor->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

new_factor = @client
             .verify
             .v2
             .services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
             .entities('ff483d1ff591898a9942916050d2ca3f')
             .new_factors
             .create(
               friendly_name: 'John\'s Phone',
               factor_type: 'push',
               binding_alg: 'ES256',
               binding_public_key: 'dGVzdF9rZXk=',
               config_app_id: 'com.example.myapp',
               config_sdk_version: '1.0.0',
               config_notification_platform: 'fcm',
               config_notification_token: 'test_token'
             )

puts new_factor.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:services:entities:factors:create \
   --service-sid VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --identity ff483d1ff591898a9942916050d2ca3f \
   --friendly-name "John's Phone" \
   --factor-type push \
   --binding.alg ES256 \
   --binding.public-key dGVzdF9rZXk= \
   --config.app-id com.example.myapp \
   --config.sdk-version 1.0.0 \
   --config.notification-platform fcm \
   --config.notification-token test_token
```

```bash
curl -X POST "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors" \
--data-urlencode "FriendlyName=John's Phone" \
--data-urlencode "FactorType=push" \
--data-urlencode "Binding.Alg=ES256" \
--data-urlencode "Binding.PublicKey=dGVzdF9rZXk=" \
--data-urlencode "Config.AppId=com.example.myapp" \
--data-urlencode "Config.SdkVersion=1.0.0" \
--data-urlencode "Config.NotificationPlatform=fcm" \
--data-urlencode "Config.NotificationToken=test_token" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "identity": "ff483d1ff591898a9942916050d2ca3f",
  "binding": {
    "alg": "ES256",
    "public_key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8GdwtibWe0kpgsFl6xPQBwhtwUEyeJkeozFmi2jiJDzxFSMwVy3kVR1h/dPVYOfgkC0EkfBRJ0J/6xW47FD5vA=="
  },
  "options": null,
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "friendly_name": "John's Phone",
  "status": "unverified",
  "factor_type": "push",
  "config": {
    "sdk_version": "1.0",
    "app_id": "com.example.myapp",
    "notification_platform": "fcm",
    "notification_token": "test_token"
  },
  "metadata": {
    "os": "Android"
  },
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

Example 2

Create New TOTP Factor

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createNewFactor() {
  const newFactor = await client.verify.v2
    .services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .newFactors.create({
      "binding.secret": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
      "config.alg": "sha1",
      "config.codeLength": 6,
      "config.skew": 1,
      "config.timeStep": 30,
      factorType: "totp",
      friendlyName: "John's Phone",
    });

  console.log(newFactor.sid);
}

createNewFactor();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

new_factor = (
    client.verify.v2.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .new_factors.create(
        friendly_name="John's Phone",
        factor_type="totp",
        binding_secret="GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
        config_alg="sha1",
        config_time_step=30,
        config_code_length=6,
        config_skew=1,
    )
)

print(new_factor.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2.Service.Entity;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var newFactor = await NewFactorResource.CreateAsync(
            friendlyName: "John's Phone",
            factorType: NewFactorResource.FactorTypesEnum.Totp,
            bindingSecret: "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
            configAlg: NewFactorResource.TotpAlgorithmsEnum.Sha1,
            configTimeStep: 30,
            configCodeLength: 6,
            configSkew: 1,
            pathServiceSid: "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathIdentity: "ff483d1ff591898a9942916050d2ca3f");

        Console.WriteLine(newFactor.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.service.entity.NewFactor;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        NewFactor newFactor = NewFactor
                                  .creator("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                                      "ff483d1ff591898a9942916050d2ca3f",
                                      "John's Phone",
                                      NewFactor.FactorTypes.TOTP)
                                  .setBindingSecret("GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ")
                                  .setConfigAlg(NewFactor.TotpAlgorithms.SHA1)
                                  .setConfigTimeStep(30)
                                  .setConfigCodeLength(6)
                                  .setConfigSkew(1)
                                  .create();

        System.out.println(newFactor.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.CreateNewFactorParams{}
	params.SetFriendlyName("John's Phone")
	params.SetFactorType("totp")
	params.SetBindingSecret("GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ")
	params.SetConfigAlg("sha1")
	params.SetConfigTimeStep(30)
	params.SetConfigCodeLength(6)
	params.SetConfigSkew(1)

	resp, err := client.VerifyV2.CreateNewFactor("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ff483d1ff591898a9942916050d2ca3f",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$new_factor = $twilio->verify->v2
    ->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->entities("ff483d1ff591898a9942916050d2ca3f")
    ->newFactors->create(
        "John's Phone", // FriendlyName
        "totp", // FactorType
        [
            "bindingSecret" => "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
            "configAlg" => "sha1",
            "configTimeStep" => 30,
            "configCodeLength" => 6,
            "configSkew" => 1,
        ]
    );

print $new_factor->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

new_factor = @client
             .verify
             .v2
             .services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
             .entities('ff483d1ff591898a9942916050d2ca3f')
             .new_factors
             .create(
               friendly_name: 'John\'s Phone',
               factor_type: 'totp',
               binding_secret: 'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ',
               config_alg: 'sha1',
               config_time_step: 30,
               config_code_length: 6,
               config_skew: 1
             )

puts new_factor.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:services:entities:factors:create \
   --service-sid VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --identity ff483d1ff591898a9942916050d2ca3f \
   --friendly-name "John's Phone" \
   --factor-type totp \
   --binding.secret GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ \
   --config.alg sha1 \
   --config.time-step 30 \
   --config.code-length 6 \
   --config.skew 1
```

```bash
curl -X POST "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors" \
--data-urlencode "FriendlyName=John's Phone" \
--data-urlencode "FactorType=totp" \
--data-urlencode "Binding.Secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ" \
--data-urlencode "Config.Alg=sha1" \
--data-urlencode "Config.TimeStep=30" \
--data-urlencode "Config.CodeLength=6" \
--data-urlencode "Config.Skew=1" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "identity": "ff483d1ff591898a9942916050d2ca3f",
  "binding": {
    "secret": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
    "uri": "otpauth://totp/test-issuer:John%E2%80%99s%20Account%20Name?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ&issuer=test-issuer&algorithm=SHA1&digits=6&period=30"
  },
  "options": null,
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "friendly_name": "John's Phone",
  "status": "unverified",
  "factor_type": "totp",
  "config": {
    "alg": "sha1",
    "skew": 1,
    "code_length": 6,
    "time_step": 30
  },
  "metadata": null,
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Fetch a Factor resource

`GET`

```xml
https://verify.twilio.com/v2/Services/{ServiceSid}/Entities/{Identity}/Factors/{Sid}
```

Parameters

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The unique SID identifier of the Service.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$"},"required":true},{"name":"Identity","in":"path","description":"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.","schema":{"type":"string"},"x-twilio":{"pii":{"handling":"standard","deleteSla":30}},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this Factor.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^YF[0-9a-fA-F]{32}$"},"required":true}]
```

Example 1

Fetch a Factor

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchFactor() {
  const factor = await client.verify.v2
    .services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("Identity")
    .factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch();

  console.log(factor.sid);
}

fetchFactor();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

factor = (
    client.verify.v2.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("Identity")
    .factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch()
)

print(factor.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2.Service.Entity;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var factor = await FactorResource.FetchAsync(
            pathServiceSid: "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathIdentity: "Identity",
            pathSid: "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(factor.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.service.entity.Factor;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Factor factor =
            Factor.fetcher("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "Identity", "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
                .fetch();

        System.out.println(factor.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.VerifyV2.FetchFactor("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"Identity",
		"YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$factor = $twilio->verify->v2
    ->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->entities("Identity")
    ->factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->fetch();

print $factor->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

factor = @client
         .verify
         .v2
         .services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
         .entities('Identity')
         .factors('YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
         .fetch

puts factor.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:services:entities:factors:fetch \
   --service-sid VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --identity Identity \
   --sid YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/Identity/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "identity": "Identity",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "friendly_name": "friendly_name",
  "status": "unverified",
  "factor_type": "push",
  "config": {
    "sdk_version": "1.0",
    "app_id": "com.example.myapp",
    "notification_platform": "fcm",
    "notification_token": "test_token"
  },
  "metadata": {
    "os": "Android"
  },
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Read multiple Factor resources

`GET`

```xml
https://verify.twilio.com/v2/Services/{ServiceSid}/Entities/{Identity}/Factors
```

Parameters

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The unique SID identifier of the Service.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$"},"required":true},{"name":"Identity","in":"path","description":"Customer unique identity for the Entity owner of the Factors. 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.","schema":{"type":"string"},"x-twilio":{"pii":{"handling":"standard","deleteSla":30}},"required":true}]
```

### Query parameters

```json
[{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

Example 1

Read multiple Factors

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listFactor() {
  const factors = await client.verify.v2
    .services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .factors.list({ limit: 20 });

  factors.forEach((f) => console.log(f.sid));
}

listFactor();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

factors = (
    client.verify.v2.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .factors.list(limit=20)
)

for record in factors:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2.Service.Entity;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var factors = await FactorResource.ReadAsync(
            pathServiceSid: "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathIdentity: "ff483d1ff591898a9942916050d2ca3f",
            limit: 20);

        foreach (var record in factors) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.service.entity.Factor;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<Factor> factors =
            Factor.reader("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ff483d1ff591898a9942916050d2ca3f").limit(20).read();

        for (Factor record : factors) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.ListFactorParams{}
	params.SetLimit(20)

	resp, err := client.VerifyV2.ListFactor("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ff483d1ff591898a9942916050d2ca3f",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$factors = $twilio->verify->v2
    ->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->entities("ff483d1ff591898a9942916050d2ca3f")
    ->factors->read(20);

foreach ($factors as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

factors = @client
          .verify
          .v2
          .services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .entities('ff483d1ff591898a9942916050d2ca3f')
          .factors
          .list(limit: 20)

factors.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:services:entities:factors:list \
   --service-sid VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --identity ff483d1ff591898a9942916050d2ca3f
```

```bash
curl -X GET "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "factors": [],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "factors"
  }
}
```

## Update a Factor resource

`POST`

```xml
https://verify.twilio.com/v2/Services/{ServiceSid}/Entities/{Identity}/Factors/{Sid}
```

Parameters

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The unique SID identifier of the Service.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$"},"required":true},{"name":"Identity","in":"path","description":"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.","schema":{"type":"string"},"x-twilio":{"pii":{"handling":"standard","deleteSla":30}},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this Factor.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^YF[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateFactorRequest","properties":{"AuthPayload":{"type":"string","description":"The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code."},"FriendlyName":{"type":"string","description":"The new friendly name of this Factor. It can be up to 64 characters."},"Config.NotificationToken":{"type":"string","description":"For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long."},"Config.SdkVersion":{"type":"string","description":"The Verify Push SDK version used to configure the factor"},"Config.TimeStep":{"type":"integer","description":"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"},"Config.Skew":{"type":"integer","description":"The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive"},"Config.CodeLength":{"type":"integer","description":"Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive"},"Config.Alg":{"type":"string","enum":["sha1","sha256","sha512"],"refName":"factor_enum_totp_algorithms","modelName":"factor_enum_totp_algorithms"},"Config.NotificationPlatform":{"type":"string","description":"The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`.\n\nRequired when `factor_type` is `push`."}}},"examples":{"verifyPush":{"value":{"lang":"json","value":"{\n  \"AuthPayload\": \"123456\",\n  \"FriendlyName\": \"FriendlyName\",\n  \"Config.SdkVersion\": \"1.0\",\n  \"Config.NotificationToken\": \"test_token\"\n}","meta":"","code":"{\n  \"AuthPayload\": \"123456\",\n  \"FriendlyName\": \"FriendlyName\",\n  \"Config.SdkVersion\": \"1.0\",\n  \"Config.NotificationToken\": \"test_token\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"AuthPayload\"","#7EE787"],[":","#C9D1D9"]," ",["\"123456\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"FriendlyName\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.SdkVersion\"","#7EE787"],[":","#C9D1D9"]," ",["\"1.0\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Config.NotificationToken\"","#7EE787"],[":","#C9D1D9"]," ",["\"test_token\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"verifyTotp":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"My Friendly Name\",\n  \"AuthPayload\": \"123456\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"My Friendly Name\",\n  \"AuthPayload\": \"123456\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"My Friendly Name\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"AuthPayload\"","#7EE787"],[":","#C9D1D9"]," ",["\"123456\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Example 1

Update a Factor

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateFactor() {
  const factor = await client.verify.v2
    .services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update({ authPayload: "724590" });

  console.log(factor.sid);
}

updateFactor();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

factor = (
    client.verify.v2.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update(auth_payload="724590")
)

print(factor.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2.Service.Entity;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var factor = await FactorResource.UpdateAsync(
            authPayload: "724590",
            pathServiceSid: "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathIdentity: "ff483d1ff591898a9942916050d2ca3f",
            pathSid: "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(factor.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.service.entity.Factor;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Factor factor = Factor
                            .updater("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                                "ff483d1ff591898a9942916050d2ca3f",
                                "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
                            .setAuthPayload("724590")
                            .update();

        System.out.println(factor.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.UpdateFactorParams{}
	params.SetAuthPayload("724590")

	resp, err := client.VerifyV2.UpdateFactor("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ff483d1ff591898a9942916050d2ca3f",
		"YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$factor = $twilio->verify->v2
    ->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->entities("ff483d1ff591898a9942916050d2ca3f")
    ->factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->update(["authPayload" => "724590"]);

print $factor->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

factor = @client
         .verify
         .v2
         .services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
         .entities('ff483d1ff591898a9942916050d2ca3f')
         .factors('YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
         .update(auth_payload: '724590')

puts factor.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:services:entities:factors:update \
   --service-sid VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --identity ff483d1ff591898a9942916050d2ca3f \
   --sid YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --auth-payload 724590
```

```bash
curl -X POST "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--data-urlencode "AuthPayload=724590" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "identity": "ff483d1ff591898a9942916050d2ca3f",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "friendly_name": "friendly_name",
  "status": "verified",
  "factor_type": "push",
  "config": {
    "sdk_version": "1.0",
    "app_id": "com.example.myapp",
    "notification_platform": "fcm",
    "notification_token": "test_token"
  },
  "metadata": {
    "os": "Android"
  },
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

Update a TOTP factor settings

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateFactor() {
  const factor = await client.verify.v2
    .services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update({
      "config.codeLength": 8,
      "config.timeStep": 45,
    });

  console.log(factor.config);
}

updateFactor();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

factor = (
    client.verify.v2.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update(config_code_length=8, config_time_step=45)
)

print(factor.config)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2.Service.Entity;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var factor = await FactorResource.UpdateAsync(
            configCodeLength: 8,
            configTimeStep: 45,
            pathServiceSid: "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathIdentity: "ff483d1ff591898a9942916050d2ca3f",
            pathSid: "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(factor.Config);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.service.entity.Factor;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Factor factor = Factor
                            .updater("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                                "ff483d1ff591898a9942916050d2ca3f",
                                "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
                            .setConfigCodeLength(8)
                            .setConfigTimeStep(45)
                            .update();

        System.out.println(factor.getConfig());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.UpdateFactorParams{}
	params.SetConfigCodeLength(8)
	params.SetConfigTimeStep(45)

	resp, err := client.VerifyV2.UpdateFactor("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ff483d1ff591898a9942916050d2ca3f",
		"YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Config != nil {
			fmt.Println(*resp.Config)
		} else {
			fmt.Println(resp.Config)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$factor = $twilio->verify->v2
    ->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->entities("ff483d1ff591898a9942916050d2ca3f")
    ->factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->update([
        "configCodeLength" => 8,
        "configTimeStep" => 45,
    ]);

print $factor->config;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

factor = @client
         .verify
         .v2
         .services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
         .entities('ff483d1ff591898a9942916050d2ca3f')
         .factors('YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
         .update(
           config_code_length: 8,
           config_time_step: 45
         )

puts factor.config
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:services:entities:factors:update \
   --service-sid VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --identity ff483d1ff591898a9942916050d2ca3f \
   --sid YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --config.code-length 8 \
   --config.time-step 45
```

```bash
curl -X POST "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--data-urlencode "Config.CodeLength=8" \
--data-urlencode "Config.TimeStep=45" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "identity": "ff483d1ff591898a9942916050d2ca3f",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "friendly_name": "friendly_name",
  "status": "verified",
  "factor_type": "push",
  "config": {
    "sdk_version": "1.0",
    "app_id": "com.example.myapp",
    "notification_platform": "fcm",
    "notification_token": "test_token"
  },
  "metadata": {
    "os": "Android"
  },
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Delete a Factor resource

`DELETE`

```xml
https://verify.twilio.com/v2/Services/{ServiceSid}/Entities/{Identity}/Factors/{Sid}
```

Parameters

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The unique SID identifier of the Service.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$"},"required":true},{"name":"Identity","in":"path","description":"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.","schema":{"type":"string"},"x-twilio":{"pii":{"handling":"standard","deleteSla":30}},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this Factor.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^YF[0-9a-fA-F]{32}$"},"required":true}]
```

Example 1

Delete a Factor

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteFactor() {
  await client.verify.v2
    .services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .entities("ff483d1ff591898a9942916050d2ca3f")
    .factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .remove();
}

deleteFactor();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.verify.v2.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").entities(
    "ff483d1ff591898a9942916050d2ca3f"
).factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2.Service.Entity;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await FactorResource.DeleteAsync(
            pathServiceSid: "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathIdentity: "ff483d1ff591898a9942916050d2ca3f",
            pathSid: "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.service.entity.Factor;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Factor
            .deleter("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "ff483d1ff591898a9942916050d2ca3f",
                "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
            .delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	err := client.VerifyV2.DeleteFactor("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ff483d1ff591898a9942916050d2ca3f",
		"YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->verify->v2
    ->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->entities("ff483d1ff591898a9942916050d2ca3f")
    ->factors("YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .verify
  .v2
  .services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  .entities('ff483d1ff591898a9942916050d2ca3f')
  .factors('YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:services:entities:factors:remove \
   --service-sid VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --identity ff483d1ff591898a9942916050d2ca3f \
   --sid YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X DELETE "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
