Totp

Create a new TOTP instance for a user. The user can use the authenticator application of their choice to scan the QR code or enter the secret.

post/v1/totps

Request

  • Base URL
    https://api.stytch.com
  • Auth
    HTTP basic

Request body

user_idstring required

The user_id of an active user the TOTP registration should be tied to. You may use an external_id here if one is set for the user.

expiration_minutesinteger

The expiration for the TOTP instance. If the newly created TOTP is not authenticated within this time frame the TOTP will be unusable. Defaults to 1440 (1 day) with a minimum of 5 and a maximum of 1440.

Response

Successful response

request_idstring required

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.

totp_idstring required

The unique ID for a TOTP instance.

secretstring required

The TOTP secret key shared between the authenticator app and the server used to generate TOTP codes.

qr_codestring required

The QR code image encoded in base64.

recovery_codesstring[] required

The recovery codes used to authenticate the user without an authenticator app.

user_idstring required

The unique ID of the affected User.

status_codeinteger required

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.

Changes