Skip to Content
ZITADEL Docs
APIsCore ResourcesV2User

Generate single-use recovery codes for a user

Generate new single-use recovery codes for the authenticated user. Recovery codes can be used to recover access to the account if other second factors are not available.

POST
/v2/users/{user_id}/recovery_codes

Path Parameters

user_id*user_id

Request Body

application/json
  1. body
count?count
Formatint32

Response Body

Success

application/json
  1. response
details?
recoveryCodes?array<string>
Example Request
curl -X POST 'https://example.com/v2/users/string/recovery_codes' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response200
{  "details": {    "sequence": 0,    "changeDate": "2023-01-15T01:30:15.01Z",    "resourceOwner": "string",    "creationDate": "2023-01-15T01:30:15.01Z"  },  "recoveryCodes": [    "string"  ]}

Was this page helpful?