{
  "type": "https://errors.swepay.com.br/native-guard/step-up-totp-invalid-code",
  "service": "native-guard",
  "slug": "step-up-totp-invalid-code",
  "httpStatus": 401,
  "title": "Invalid TOTP Code",
  "summary": "The TOTP code sent to step up the session does not match the user's authenticator.",
  "description": "Returned by `POST /identity/v1/realms/{realm}/stepup/totp` when the access\ntoken, its session and the user's enrollment are all valid, but the code\ndoes not verify. A code is accepted for its own 30-second step and the one\nimmediately before or after it. Backup (recovery) codes are not accepted on\nthis endpoint.\n\nThe session is left unchanged — the access token that was sent stays valid\nat its current level. Each rejected code counts against the same\nfailed-attempt budget as sign-in: when the realm's limit is reached the\naccount is locked, and further attempts — even with a correct code — return\n[Too Many Requests](/common/too-many-requests) with a `Retry-After` header\nuntil the lockout ends. A successful step-up resets the count.\n",
  "commonCauses": [
    "The code was mistyped, or it expired before the request arrived.",
    "The clock of the device running the authenticator app is out of sync.",
    "The code came from a different account or an older enrollment in the authenticator app.",
    "A backup code was sent instead of a code from the authenticator app."
  ],
  "clientAction": "Retryable with a new code, within the attempt budget. Ask the user for the\nsix-digit code currently shown by the authenticator app and send it again\nwith the same access token. Do not retry automatically and do not resend the\nrejected code: every wrong code brings the account closer to a lockout that\nalso blocks sign-in. If the response becomes `429`, wait for `Retry-After`\nbefore any new attempt.\n",
  "exampleResponse": {
    "type": "https://errors.swepay.com.br/native-guard/step-up-totp-invalid-code",
    "title": "Invalid TOTP Code",
    "status": 401,
    "detail": "The TOTP code is invalid.",
    "traceId": "Root=1-00000000-000000000000000000000000;Parent=0000000000000000;Sampled=0"
  },
  "relatedDocs": [
    {
      "label": "RFC 9457 — Problem Details",
      "url": "https://www.rfc-editor.org/rfc/rfc9457"
    },
    {
      "label": "RFC 6238 — TOTP",
      "url": "https://www.rfc-editor.org/rfc/rfc6238"
    }
  ],
  "category": "service",
  "deprecated": false,
  "documentation": "https://errors.swepay.com.br/native-guard/step-up-totp-invalid-code"
}