Go to developer

Partner 2FA / Generate recovery codes

Generate recovery codes

POST/v1/identities/{identityId}/recovery/codes

Rotates and returns recovery codes for an identity.

Authentication

SERVER ONLY

Bearer clientId:clientSecretServer secret required.

Request

Path parameters

ParameterTypeRequiredDescription
identityIdstringRequired

Response

201 Codes generated

  • codesstring[]required
    • itemstring
  • identityIdstringrequired

404 Not found

  • detailsobject
  • errorstringrequired
  • messagestringrequired

SDK equivalent

  • TypeScript@keyra/typescript-sdk: generateRecoveryCodes(externalUserId)

Examples

Bash
curl -X POST "https://auth.keyra.ie/v1/identities/idn_xxxxxxxx/recovery/codes" \
  -H "Authorization: Bearer CLIENT_ID:CLIENT_SECRET"

Response

response.jsonJSON
{
  "codes": [
    "string"
  ],
  "identityId": "string"
}