Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Factor Resource


The Passkey Factor resource is currently used by Passkeys. This factor is different than the Factor resource used for Push and TOTP verification and its properties apply to Passkeys only. A single Entity links to multiple Passkey Factors and TOTP/Push Factors.


Passkey Factor properties

passkey-factor-properties page anchor
(information)

Info

For security reasons the options property is ONLY returned when the resource is created and is never returned in later requests.

(information)

Info

In the request, if the specified Entity with the {identity} path parameter doesn't exist, it will be created automatically. You don't need to create a new Entity separately before making this request.


Property nameTypeRequiredPIIDescriptionChild properties
sidSID<YF>

Optional

Not PII

A 34 character string that uniquely identifies this Factor.

Pattern: ^YF[0-9a-fA-F]{32}$Min length: 34Max length: 34

accountSidSID<AC>

Optional

The unique SID identifier of the Account.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

serviceSidSID<VA>

Optional

The unique SID identifier of the Service.

Pattern: ^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34

entitySidSID<YE>

Optional

The unique SID identifier of the Entity.

Pattern: ^YE[0-9a-fA-F]{32}$Min length: 34Max length: 34

identitystring

Optional

PII MTL: 30 days

Customer unique identity for the Entity owner of the Factor.


binding

Optional

Contains the factor_type specific secret and metadata. The Binding property is ONLY returned upon Factor creation.


optionsnull

Optional


dateUpdatedstring<date-time>

Optional

The date that this Factor was updated, given in ISO 8601(link takes you to an external page) format.


friendlyNamestring

Optional

The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors.


statusenum<string>

Optional

The Status of this Factor. One of unverified or verified.

Possible values:
unverifiedverified

factorTypeenum<string>

Optional

The Type of this Factor. Currently push and totp are supported.

Possible values:
pushtotppasskeys

config

Optional

An object that contains configurations specific to a factor_type.


metadata

Optional

Custom metadata associated with the factor.


urlstring<uri>

Optional

The URL of this resource.


Create a Passkeys Factor resource

create-a-passkeys-factor-resource page anchor

POST https://verify.twilio.com/v2/Services/{ServiceSid}/Passkeys/Factors

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
serviceSidSID<VA>
required

The unique SID identifier of the Service.

Pattern: ^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/json
SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
friendlyNamestring
required

identitystring
required

configobject

Optional

Create a new Passkeys Factor for the EntityLink to code sample: Create a new Passkeys Factor for the Entity
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createNewFactorPasskey() {
11
const newFactor = await client.verify.v2
12
.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.newFactors.create({
14
friendly_name: "friendly_name",
15
identity: "identity",
16
});
17
18
console.log(newFactor.sid);
19
}
20
21
createNewFactorPasskey();

Response

Note about this response
1
{
2
"sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"identity": "identity",
7
"binding": null,
8
"date_created": "2015-07-30T20:00:00Z",
9
"date_updated": "2015-07-30T20:00:00Z",
10
"friendly_name": "friendly_name",
11
"status": "unverified",
12
"factor_type": "passkeys",
13
"config": {
14
"relying_party": {
15
"id": "example.com",
16
"name": "Example",
17
"origins": [
18
"https://example.com"
19
]
20
},
21
"authenticator_attachment": "platform",
22
"discoverable_credentials": "preferred",
23
"user_verification": "preferred"
24
},
25
"options": {
26
"publicKey": {
27
"rp": {
28
"id": "example.com",
29
"name": "Example"
30
},
31
"user": {
32
"id": "WUU0ZmQzYWFmNGU0NTMyNGQwZjNlMTM0NjA3YjIxOTEyYg",
33
"name": "friendly_name",
34
"displayName": "friendly_name"
35
},
36
"challenge": "WUYwNDhkMWE3ZWMzYTJhNjk3MDA1OWMyNzY2YmJjN2UwZg",
37
"pubKeyCredParams": {
38
"type": "public-key",
39
"alg": -7
40
},
41
"timeout": 600000,
42
"excludeCredentials": [],
43
"authenticatorSelection": {
44
"authenticatorAttachment": "platform",
45
"requireResidentKey": false,
46
"residentKey": "preferred",
47
"userVerification": "preferred"
48
},
49
"attestation": "none"
50
}
51
},
52
"metadata": null,
53
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
54
}

Verify a Passkeys Factor resource

verify-a-passkeys-factor-resource page anchor

POST https://verify.twilio.com/v2/Services/{ServiceSid}/Passkeys/VerifyFactor

Property nameTypeRequiredPIIDescription
serviceSidSID<VA>
required

The unique SID identifier of the Service.

Pattern: ^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/json
SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
idstring

Optional

A base64url(link takes you to an external page) encoded representation of rawId.


rawIdstring

Optional

The globally unique identifier for this PublicKeyCredential.


authenticatorAttachmentenum<string>

Optional

A string that indicates the mechanism by which the WebAuthn implementation is attached to the authenticator at the time the associated navigator.credentials.create() or navigator.credentials.get() call completes.

Possible values:
platformcross-platform

typeenum<string>

Optional

The valid credential types supported by the API. The values of this enumeration are used for versioning the AuthenticatorAssertion and AuthenticatorAttestation structures according to the type of the authenticator.

Default: public-keyPossible values:
public-key

responseobject
required

The result of a WebAuthn credential registration via navigator.credentials.create(), as specified in AuthenticatorAttestationResponse(link takes you to an external page).

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updatePasskeysFactor() {
11
const newVerifyFactor = await client.verify.v2
12
.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.newVerifyFactors.update({
14
response: {
15
attestationObject: "attestationObject",
16
clientDataJSON: "clientDataJSON",
17
transports: ["usb"],
18
},
19
});
20
21
console.log(newVerifyFactor.sid);
22
}
23
24
updatePasskeysFactor();

Response

Note about this response
1
{
2
"sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"identity": "ff483d1ff591898a9942916050d2ca3f",
7
"date_created": "2015-07-30T20:00:00Z",
8
"date_updated": "2015-07-30T20:00:00Z",
9
"friendly_name": "friendly_name",
10
"status": "verified",
11
"factor_type": "passkeys",
12
"config": {
13
"relying_party": {
14
"id": "example.com",
15
"name": "Example",
16
"origins": [
17
"https://example.com"
18
]
19
},
20
"authenticator_attachment": "platform",
21
"discoverable_credentials": "preferred",
22
"user_verification": "preferred"
23
},
24
"metadata": null,
25
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
26
}