{ "status_code": 400, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "invalid_public_key_credential", "error_message": "Invalid public key credential. Please confirm you're passing a correctly formatted public key credential.", "error_url": "https://stytch.com/docs/api/errors/400"}
{ "status_code": 404, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "user_not_found", "error_message": "User could not be found.", "error_url": "https://stytch.com/docs/api/errors/404"}
{ "status_code": 429, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "too_many_requests", "error_message": "Too many requests have been made.", "error_url": "https://stytch.com/docs/api/errors/429"}
{ "status_code": 500, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "internal_server_error", "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.", "error_url": "https://stytch.com/docs/api/errors/500"}
import { StytchClient } from '@stytch/vanilla-js';const stytch = new StytchClient('${publicToken}');export const getCodes = () => {stytch.totps.recoveryCodes();};
{ "status_code": 400, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "invalid_public_key_credential", "error_message": "Invalid public key credential. Please confirm you're passing a correctly formatted public key credential.", "error_url": "https://stytch.com/docs/api/errors/400"}
{ "status_code": 404, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "user_not_found", "error_message": "User could not be found.", "error_url": "https://stytch.com/docs/api/errors/404"}
{ "status_code": 429, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "too_many_requests", "error_message": "Too many requests have been made.", "error_url": "https://stytch.com/docs/api/errors/429"}
{ "status_code": 500, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "internal_server_error", "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.", "error_url": "https://stytch.com/docs/api/errors/500"}
Time-Based One-Time Passcodes (TOTPs)
Get Recovery Codes
Get Recovery Codes using the Stytch Vanilla JS SDK
import { StytchClient } from '@stytch/vanilla-js';const stytch = new StytchClient('${publicToken}');export const getCodes = () => {stytch.totps.recoveryCodes();};
{ "status_code": 400, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "invalid_public_key_credential", "error_message": "Invalid public key credential. Please confirm you're passing a correctly formatted public key credential.", "error_url": "https://stytch.com/docs/api/errors/400"}
{ "status_code": 404, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "user_not_found", "error_message": "User could not be found.", "error_url": "https://stytch.com/docs/api/errors/404"}
{ "status_code": 429, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "too_many_requests", "error_message": "Too many requests have been made.", "error_url": "https://stytch.com/docs/api/errors/429"}
{ "status_code": 500, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "internal_server_error", "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.", "error_url": "https://stytch.com/docs/api/errors/500"}
import { StytchClient } from '@stytch/vanilla-js';const stytch = new StytchClient('${publicToken}');export const getCodes = () => {stytch.totps.recoveryCodes();};
{ "status_code": 400, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "invalid_public_key_credential", "error_message": "Invalid public key credential. Please confirm you're passing a correctly formatted public key credential.", "error_url": "https://stytch.com/docs/api/errors/400"}
{ "status_code": 404, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "user_not_found", "error_message": "User could not be found.", "error_url": "https://stytch.com/docs/api/errors/404"}
{ "status_code": 429, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "too_many_requests", "error_message": "Too many requests have been made.", "error_url": "https://stytch.com/docs/api/errors/429"}
{ "status_code": 500, "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141", "error_type": "internal_server_error", "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.", "error_url": "https://stytch.com/docs/api/errors/500"}
Wraps the Get TOTP Recovery Codes endpoint. Call this method to retrieve the recovery codes for a TOTP instance tied to a user.
If a user has enrolled another MFA method, this method will require MFA. See the Multi-factor authentication section for more details.
Response
string
The unique ID of the affected User.
array[objects]
An array containing a list of all TOTP instances for a given User in the Stytch API.
Show properties
string
The unique ID for a TOTP instance.
boolean
The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User.
array[strings]
The recovery codes used to authenticate the user without an authenticator app.
string
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we
may ask for this value to help identify a specific API call when helping you debug an issue.
number
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values
equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
Assistant
Responses are generated using AI and may contain mistakes.