---
title: "CLI MFA step-up completion — exchange mfa_token + TOTP for tokens"
method: POST
path: "/auth/login/mfa"
tags: ["Auth"]
---

# CLI MFA step-up completion — exchange mfa_token + TOTP for tokens

`POST /auth/login/mfa`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/auth/login/mfa`
- Auth: none required

Completes the aal2 step-up begun by `POST /auth/login` (which answers `200 { mfa_required, factor_id, mfa_token }` for a ready-TOTP user). The client submits the opaque `mfa_token` from that response together with the current TOTP `code`; on success the bearer token pair is returned in the JSON body, exactly like the factorless `/auth/login` 200. Cookie-free (a CLI has no cookie jar, unlike `/auth/mfa/verify`). The mfa_token is single-use and TTL-bounded. If the user's email domain has since come under SSO enforcement, the tokens are withheld: 403 `sso_required` (or 503 `sso_check_unavailable` when that check cannot be completed). Rate-limited.

## Request body

- object
  - `mfa_token` string, required: The opaque sealed handle returned by `POST /auth/login` in the mfa_required branch.
  - `code` string, required: The current TOTP code for the user's ready factor.
  - `factor_id` string: Optional factor selector. Only `totp` is supported programmatically; `email_otp` is rejected 400.

## Response `200`

Step-up succeeded — bearer tokens returned.

- object
  - `access_token` string, required
  - `refresh_token` string, required
  - `expires_in` integer
  - `user` User: Supabase user shape. Fields beyond `id` and `email` are passthrough.
    - `id` string, uuid
    - `email` string, email
    - `app_metadata` object
    - `user_metadata` object

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
- `503`: An upstream dependency is currently unavailable. The request was not processed; retry after the cooldown window.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
