Activate MFA

POST /v1/mfa/activate

Finish turning on two-factor authentication: send a current six-digit code from the authenticator you set up with /mfa/enroll. When the code matches, MFA is on for your user — from the next sign-in, /auth/login answers mfa_required: true and the code goes to /auth/mfa. Sessions that are already signed in stay signed in.

Interactive session only. This call requires an interactive dashboard session (a session JWT): sign in with /auth/login (followed by /auth/mfa when MFA is on) and send the token as Authorization: Bearer <session_jwt>. API keys and OAuth/MCP tokens get 403 with code: "interactive_session_required".

Only an authenticator code is accepted here, not a backup code. A code is accepted once: a code that was already used within its 30-second step is refused, so wait for the next one if you need to retry. A one-step clock difference either way is tolerated.

The change is recorded as a security event in your activity log.

Rate limit

Every activation attempt counts toward the shared limit of 5 code checks per hour per user, the successful one included (with sign-in, /mfa/verify, /mfa/disable and /mfa/backup-codes/regenerate).

Request body

token string Req
The current six-digit code from the authenticator app.

Response (200 OK)

success boolean
true.
message string
MFA activated successfully.

Errors

Error bodies are {"success": false, "message": "…", "error": "…"} (error carries the same text as message), except where noted.

400 Bad Request
Invalid token (wrong, expired or already-used code), MFA not enrolled (call /mfa/enroll first), or a body that isn't valid JSON (Failed to decode request: …).
401 Unauthorized
Missing or invalid auth.
403 Forbidden
The credential is an API key or an OAuth/MCP token: this call needs an interactive dashboard session (a session JWT). Body {"error": "…", "code": "interactive_session_required"}.
415 Unsupported Media Type
The Content-Type: application/json header is missing.
429 Too Many Requests
The hourly limit is reached: Too many MFA attempts. Try again in N minutes.
500 Internal Server Error
The MFA record could not be read, decrypted or updated.
Request
curl -X POST "https://api.ngris.com/v1/mfa/activate" \ -H "Authorization: Bearer <session_jwt>" \ -H "Content-Type: application/json" \ -d '{ "token": "123456" }'
Response — 200 OK
{ "success": true, "message": "MFA activated successfully" }
Response — 400 Bad Request
{ "success": false, "message": "Invalid token", "error": "Invalid token" }
On this page
Activate MFA