Get
/api/v1/users.totpCodesRemaining
Returns how many backup codes are left for the authenticator app (TOTP) two-factor authentication of your own account. Requests are limited to five per minute.
This endpoint replaces the deprecated 2fa:checkCodesRemaining real-time method, which remains available until 9.0.0.
Changelog
| Version | Description |
|---|---|
| 8.8.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken of the authenticated user.
X-User-Id
stringRequired
The userId of the authenticated user.
Responses
200
OK
Success Example
{
"remaining": 8.0,
"success": true
}object
remaining
number
success
boolean
400
TOTP two-factor authentication is not enabled for the user.
TOTP not enabled
{
"success": false,
"error": "[invalid-totp]",
"errorType": "invalid-totp"
}object
success
boolean
error
string
errorType
string
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}object
status
string
message
string