/{app_slug}/v1/me/mfa/recovery-codes/regenerateAuthRegenerate the recovery-code set
Mints a fresh set of single-use recovery codes and invalidates every prior code for the account. The new codes are returned once — store them now.
Path parameters
app_slug*stringSlug of the app.
Response · 200
recovery_codes*arrayNew single-use recovery codes. Returned once; any earlier set is invalidated. Store them now.
Example
Request
POST https://api.auth.productcraft.co/{app_slug}/v1/me/mfa/recovery-codes/regenerate
Authorization: Bearer YOUR_TOKENimport { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const recoveryCodes = await auth.consumer("my-app").me.mfa.recoveryCodes.regenerate();auth.consumer(…).me.mfa.recoveryCodes.regenerate(options?): Auth.RecoveryCodes
Response
{
"recovery_codes": [
"string"
]
}