Challenge Resource
The Passkeys Challenge resource represents a single verification attempt of a Service, an Entity or a Factor.
A 34 character string that uniquely identifies this Challenge.
^YC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique SID identifier of the Account.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique SID identifier of the Service.
^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique SID identifier of the Entity.
^YE[0-9a-fA-F]{32}$Min length: 34Max length: 34Customer unique identity for the Entity owner of the Challenge.
The unique SID identifier of the Factor.
^YF[0-9a-fA-F]{32}$Min length: 34Max length: 34The date that this Challenge was created, given in ISO 8601 format.
The date that this Challenge was updated, given in ISO 8601 format.
The date that this Challenge was responded, given in ISO 8601 format.
The date-time when this Challenge expires, given in ISO 8601 format.
The Status of this Challenge. One of pending, expired, approved or denied.
pendingexpiredapproveddeniedReason for the Challenge to be in certain status. One of none, not_needed or not_requested.
nonenot_needednot_requestedThe Factor Type of this Challenge. Currently push and totp are supported.
pushtotppasskeysContains a dictionary of URL links to nested resources of this Challenge.
An object that contains challenge options. Currently only used for passkeys.
POST https://verify.twilio.com/v2/Services/{ServiceSid}/Passkeys/Challenges
The unique SID identifier of the Service.
^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34application/json1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createChallengePasskeys() {11const newChallenge = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.newChallenge()14.create({15identity: "identity",16});1718console.log(newChallenge.sid);19}2021createChallengePasskeys();
Response
1{2"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"entity_sid": "",6"identity": "identity",7"factor_sid": "",8"factor_type": "passkeys",9"status": "pending",10"date_created": "2025-07-30T20:00:00Z",11"date_updated": "2025-07-30T20:00:00Z",12"date_responded": null,13"details": null,14"expiration_date": null,15"hidden_details": null,16"links": null,17"metadata": null,18"responded_reason": "none",19"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Passkeys/Challenges",20"options": {21"publicKey": {22"rp": {23"id": "example.com",24"name": "Example"25},26"user": {27"id": "WUU0ZmQzYWFmNGU0NTMyNGQwZjNlMTM0NjA3YjIxOTEyYg",28"name": "friendly_name",29"displayName": "friendly_name"30},31"challenge": "WUYwNDhkMWE3ZWMzYTJhNjk3MDA1OWMyNzY2YmJjN2UwZg",32"pubKeyCredParams": {33"type": "public-key",34"alg": -735},36"timeout": 600000,37"excludeCredentials": [],38"authenticatorSelection": {39"authenticatorAttachment": "platform",40"requireResidentKey": false,41"residentKey": "preferred",42"userVerification": "preferred"43},44"attestation": "none"45}46}47}
POST https://verify.twilio.com/v2/Services/{ServiceSid}/Passkeys/ApproveChallenge
The unique SID identifier of the Service.
^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34application/jsonA 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.
platformcross-platformThe 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.
public-keyPossible values: public-keyThe result of a WebAuthn authentication via a navigator.credentials.get() request, as specified in AuthenticatorAttestationResponse.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateChallengePasskeys() {11const approveChallenge = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.approveChallenge.update({14id: "id",15rawId: "rawId",16authenticatorAttachment: "platform",17response: {18authenticatorData: "authenticatorData",19clientDataJSON: "clientDataJSON",20signature: "signature",21userHandle: "userHandle",22},23});2425console.log(approveChallenge.sid);26}2728updateChallengePasskeys();
Response
1{2"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"entity_sid": "",6"identity": "",7"factor_sid": "",8"factor_type": "passkeys",9"status": "approved",10"date_created": "2025-07-30T20:00:00Z",11"date_updated": "2025-07-30T20:00:00Z",12"date_responded": null,13"details": null,14"expiration_date": null,15"hidden_details": null,16"links": null,17"metadata": null,18"responded_reason": "none",19"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Passkeys/ApproveChallenge",20"options": {21"publicKey": {22"rp": {23"id": "example.com",24"name": "Example"25},26"user": {27"id": "WUU0ZmQzYWFmNGU0NTMyNGQwZjNlMTM0NjA3YjIxOTEyYg",28"name": "friendly_name",29"displayName": "friendly_name"30},31"challenge": "WUYwNDhkMWE3ZWMzYTJhNjk3MDA1OWMyNzY2YmJjN2UwZg",32"pubKeyCredParams": {33"type": "public-key",34"alg": -735},36"timeout": 600000,37"excludeCredentials": [],38"authenticatorSelection": {39"authenticatorAttachment": "platform",40"requireResidentKey": false,41"residentKey": "preferred",42"userVerification": "preferred"43},44"attestation": "none"45}46}47}