Account and security
Two-factor authentication
Time-based one-time codes from an authenticator app, set up on the web dashboard, with eight recovery codes; how the iOS app and the API behave once it is on.
Updated · 2 min read
Two-factor authentication (2FA) adds a six-digit code from an authenticator app to every password sign-in.
Setting it up (web)
- Settings, Security, Enable two-factor. (
POST /api/auth/2fa/setupreturns the secret and a QR code.) - Scan the QR code with an authenticator app (any TOTP app: 1Password, Google Authenticator, Authy and others).
- Enter the current code to confirm (
POST /api/auth/2fa/verify-setup). - Save the eight recovery codes shown once. Each works one time, in place of a code, if you lose the device.
Setup is web-only. In the app, Account, More tools opens the web dashboard with your session for it.
Signing in with it on
- Web: password, then the code.
- iOS: password, then a code sheet. A recovery code works in the same field.
- API:
POST /api/auth/loginreturns a 2FA challenge;POST /api/auth/2fa/verifycompletes it. API keys are not affected: a key is its own credential. - Sign in with Apple: Apple's own two-factor stands in; DomainGuard's TOTP applies to password sign-ins.
Status and disabling
GET /api/auth/2fa/status reports whether it is on. Disable from Settings, Security with a current code (POST /api/auth/2fa/disable). The secret is stored encrypted at rest.
Lost the device
Use a recovery code to sign in, then disable and re-enable 2FA to get a new secret and fresh codes. Out of recovery codes: Ask for help from the locked-out sign-in screen; identity is verified before anything is reset.
Common questions
The code is refused. Check the phone's clock is set automatically; TOTP is time-based. A code is valid for its 30-second window plus a small tolerance.
Does 2FA lock the API? No. Keys bypass it, which is why keys are scoped and can expire.
Does the QR handoff bypass it? The handoff is created from an already-authenticated web session, so the second factor was already satisfied there.
Keep reading
Related articles
- Signing inSign in with Apple first, email with show/hide password and reset, the QR code from the web dashboard, Face ID for a saved session, and the two-factor code.iOS app ·Updated
- The REST APIBase URL, bearer authentication with an nhm_ key, the domain check endpoint, the resource endpoints behind the dashboard, and the 401, 402, 403 and 429 replies.API and MCP ·Updated
- Sign in with AppleSign in with Apple on the iOS app and on the website, what happens with a hidden relay email, linking Apple to an existing email account, and revocation.Account and security ·Updated
