---
title: "Generate a replacement recovery-code set after reauthentication"
method: POST
path: "/auth/security/totp/recovery-codes/regenerate"
tags: ["Auth"]
---

# Generate a replacement recovery-code set after reauthentication

`POST /auth/security/totp/recovery-codes/regenerate`

## Request

- Base URL: `https://app.openpo.st/api/v1`
- URL: `https://app.openpo.st/api/v1/auth/security/totp/recovery-codes/regenerate`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `openpost_session`

## Request body

- RecoveryCodeSensitiveActionInputBody
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `current_password` string, required: Current password for re-authentication
  - `reauth_grant` string: One-time action-bound reauthentication grant

## Response `200`

OK

- RecoveryCodeSetOutputBody
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `challenge_id` string, required: Expiring challenge that activates this code set after acknowledgement
  - `recovery_codes` string[], nullable, required: One-time plaintext recovery codes; these are never returned again

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `409`: Conflict
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/openpo/apis/openpost-api.md) · [All operations](https://skmtc.dev/openpo/apis/openpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/openpo/apis/openpost-api/revisions/67d3964458a7?raw)
