Endpoint
Request Body
The ID of the user creating the TOTP device. Cannot be empty.
A friendly name for the device (e.g., “Google Authenticator”, “iPhone”). If not provided, a name will be auto-generated. Cannot be empty string if provided.
The number of time windows to check before and after the current time. Must be >= 0. Recommended value: 1.
The time period in seconds for TOTP code generation. Must be > 0. Standard value: 30.
Request Example
Response
Success Response
Returns
"OK" when the device is successfully createdThe name assigned to the device (auto-generated if not provided in request)
The secret key for the TOTP device. This should be used to generate a QR code for the user to scan. This is only returned once - store it securely if needed.
Error Response
Returns
"DEVICE_ALREADY_EXISTS_ERROR" when a device with the specified name already exists for this userImplementation Details
Source: View source- This API requires public tenant access
- The device is created in an unverified state
- The user must verify the device using the Verify Device endpoint before it can be used for authentication
- The secret key is base32-encoded and compatible with standard authenticator apps
- Each user can have multiple TOTP devices with different names
- The hashing algorithm and TOTP length (6-8 digits) are not configurable at creation time
Next Steps
After creating a device:- Generate a QR code from the secret key
- Display the QR code to the user to scan with their authenticator app
- Ask the user to enter a TOTP code to verify the device
- Call the Verify Device endpoint with the user’s code
Verify TOTP Device
Learn how to verify the newly created device
Error Responses
Returned when:
userIdis emptydeviceNameis an empty string (null is allowed)skewis less than 0periodis less than or equal to 0