---
title: "Clears any existing recovery codes and generates a new batch of recovery codes."
method: POST
path: "/v1/users/{userId}/recovery-codes/regenerate"
tags: ["Accounts"]
---

# Clears any existing recovery codes and generates a new batch of recovery codes.

`POST /v1/users/{userId}/recovery-codes/regenerate`

Two step verification recovery codes do not enforce that two step verification must be passed when logging in.
At least one two step verification media type must be enabled to trigger the two step verification flow.
Recovery codes are intended to be used to pass two step verification when the enabled media type is unavailable.

Recovery codes generated by this endpoint do not have an expiration.

Once a recovery code generated by this endpoint has been used it cannot be used again.

## Path parameters

- `userId` integer, required

## Request body

- RobloxTwoStepVerificationApiRegenerateRecoveryCodesRequest — Request information needed to regenerate recovery codes.
  - `password` string — The user's password.

## Response `200`

OK

- RobloxTwoStepVerificationApiRegenerateRecoveryCodesResponse — The response for regenerating recovery codes.
  - `recoveryCodes` string[] — The collection of generated recovery codes.

## Other responses

- `400` — 2: The user ID is invalid. 4: The password is invalid.
- `401` — 0: Authorization has been denied for this request.
- `403` — 0: Token Validation Failed
- `429` — 5: Too many requests.
- `503` — 7: Two step verification is currently under maintenance.

---

[API](https://skmtc.net/roblox/apis/roblox-api.md) · [All operations](https://skmtc.net/roblox/apis/roblox-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/roblox/roblox-api/revisions/756260310407/schema)
