/{app_slug}/v1/me/mfa/factors/{id}/verifyAuthConfirm enrollment of a pending factor
TOTP: submit two `codes` from consecutive 30-second windows. Email: submit the emailed 6-digit `code`. On success the factor flips to enabled, recovery codes are minted (returned once), and prior recovery codes for the account are invalidated. Subsequent calls with the same `:id` fail with 400.
Path parameters
id*stringId of the factor.
app_slug*stringSlug of the app.
Request body
codesarrayTOTP factors: two codes from consecutive 30-second windows of the authenticator app. The second must come from a different period than the first.
Example: ["123456","654321"]
codestringEmail factors: the single 6-digit code that was emailed when enrollment started.
Example: "123456"
credentialobjectPasskey factors: the `PublicKeyCredential` returned by `navigator.credentials.create()`, ArrayBuffers base64url-encoded. The challenge inside `clientDataJSON` must be the one issued when enrollment started.
Response · 200
factor*objectid*stringUnique identifier of the factor.
type*stringFactor type — `totp` (authenticator app), `email` (single-use code delivered to a verified email contact), or `webauthn` (a passkey). Further factor types will extend this list without a breaking change to the response shape.
Example: "totp"
label*stringLabel the user gave the factor, or `null`.
enabled*booleanWhether the factor is enabled.
created_at*string · date-timeWhen the factor was created (ISO 8601).
enabled_at*string · date-timeWhen the factor was enabled (ISO 8601), or `null`.
recovery_codes*arraySingle-use recovery codes for this account. Shown once — store them now.
Example: ["a1b2-c3d4-e5f6-7890","1234-5678-9abc-def0"]
Example
Request
POST https://api.auth.productcraft.co/{app_slug}/v1/me/mfa/factors/{id}/verify
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"codes": [
"123456",
"654321"
],
"code": "123456",
"credential": {}
}Response
{
"factor": {
"id": "string",
"type": "totp",
"label": "string",
"enabled": false,
"created_at": "2026-01-01T00:00:00.000Z",
"enabled_at": "2026-01-01T00:00:00.000Z"
},
"recovery_codes": [
"a1b2-c3d4-e5f6-7890",
"1234-5678-9abc-def0"
]
}