Skip to main content

Endpoint

This is a tenant-specific API that verifies a newly created TOTP device by checking if the provided code is valid. Once verified, the device can be used for authentication.

Request Body

string
required
The ID of the user who owns the device. Cannot be empty.
string
required
The name of the device to verify. Cannot be empty.
string
required
The TOTP code generated by the authenticator app.

Request Example

Response

Success Response

string
Returns "OK" when the device is successfully verified
boolean
  • true if the device was already verified before this call
  • false if this call newly verified the device

Error Responses

Unknown Device

string
Returns "UNKNOWN_DEVICE_ERROR" when the specified device does not exist

Invalid TOTP Code

string
Returns "INVALID_TOTP_ERROR" when the provided code is incorrect
number
The number of failed attempts so far (available in v5.0+)
number
The maximum number of failed attempts allowed (available in v5.0+)

Rate Limit Reached

string
Returns "LIMIT_REACHED_ERROR" when too many failed attempts have occurred
number
The number of milliseconds to wait before retrying
number
The number of failed attempts (available in v5.0+)
number
The maximum allowed failed attempts (available in v5.0+)

Implementation Details

Source: View source
  • Verification is tenant-specific
  • Failed attempts are tracked to prevent brute force attacks
  • After reaching the maximum failed attempts, users must wait before retrying
  • Once verified, a device can be used for authentication
  • Verifying an already-verified device is not an error - returns success with wasAlreadyVerified: true

Workflow

  1. User creates a TOTP device using Create Device
  2. User scans QR code with authenticator app
  3. User enters the 6-digit code from their app
  4. Your application calls this endpoint to verify the code
  5. If successful, the device is now verified and can be used for authentication

Next Steps

Verify TOTP Code

Use the verified device for authentication

Error Handling

BadRequestException
Returned when:
  • userId is empty
  • deviceName is empty