Retrieve Recovery Codes API
On this page
This API is used to retrieve Recovery Codes for a User.
Request#
OpenAPI Spec
1.64.0As of 1.68.0, this endpoint always returns an empty list. Recovery codes are now hashed at rest and cannot be retrieved in plaintext. To provide a user with recovery codes, generate a new set.
Request Parameters#
userId UUID required The Id of the User to retrieve Recovery Codes for.
Response#
The response for this API contains the remaining Recovery Codes that are assigned to the User. Each time one is used it is removed, so this response will contain between 0 and 10 codes. Prior to 1.68.0, this returned remaining codes. As of 1.68.0, this always returns an empty list.
| Code | Description |
|---|---|
| 200 | The request was successful. The response will contain a JSON body. |
| 400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present. |
| 401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |
Response Body#
recoveryCodes Array<String> The array of Recovery Codes.
{
"code": "752185",
"recoveryCodes": [
"QJD73-L6GR5",
"R7RJH-GB7H3",
"JJ5YZ-KS4C3",
"CRDHP-7L355",
"928QS-P9HMJ",
"8VLFT-Z2WMM",
"PQZX9-YV5VR",
"TK9TB-7BT6H",
"6QYPL-ZPQJV",
"VJ35W-98RW4"
]
}Related
API documentation for the FusionAuth Generate Recovery Codes API.
API documentation for the FusionAuth Disable Multi-Factor API.
API documentation for the FusionAuth Enable Multi-Factor API.
API documentation for the FusionAuth Generate a Secret API.