Login failed: Unexpected 2FA type: app_code. Expected 'totp'.
Last updated 9 July 2026
Zerodha: Unexpected 2FA type (set your 2FA to TOTP)
This Zerodha error means your Zerodha account's two-factor (2FA) method is not set to TOTP. Our system needs your Zerodha 2FA to be the TOTP (authenticator app) type. Turn on TOTP two-factor for your Zerodha account, note the new TOTP Key it shows, then add that key on your account in Accounts -> Trading Accounts and click Validate & Save.
When this happens
- 1 Your Zerodha account's active 2FA method is the app-based type (shown as 'app_code'), not TOTP.
- 2 TOTP two-factor was turned off (or never set up) on your Zerodha account.
What this error means
Zerodha supports more than one two-factor (2FA) method. Our system needs your Zerodha account to use the TOTP (authenticator app) method. This error means Zerodha reported a different 2FA type (app_code) — so TOTP is currently not the active method on your account.
This usually happens when TOTP two-factor was turned off on your Zerodha account, or the account is set to the app-based approval method instead of TOTP.
How to fix it
- Log in to your Zerodha account and open the security / two-factor (2FA) settings.
- Turn on the TOTP (external TOTP / authenticator app) two-factor method. During setup, Zerodha shows you a TOTP Key (a long secret string).
- Note down that new TOTP Key.
- In AutoTrader Web, go to Accounts → Trading Accounts, click the EDIT icon next to your Zerodha account, paste the new TOTP Key, and click Validate & Save.
Note: The TOTP Key is the long secret string shown once during setup — not the 6-digit code your authenticator app shows. See Invalid TOTP if you are unsure which value to enter.