---
title: "Complete login with a TOTP code"
method: POST
path: "/auth/login/2fa"
tags: ["auth"]
---

# Complete login with a TOTP code

`POST /auth/login/2fa`

## Request

- Base URL: `https://api.onplana.com/api`
- URL: `https://api.onplana.com/api/auth/login/2fa`
- Auth: none required

Second step of the 2FA login flow. Supply the `userId` from the first step and the 6-digit TOTP code.

## Request body

- object
  - `userId` string, required
  - `code` string, required

## Response `200`

2FA verified - returns token, user, organizations

## Other responses

- `400`: Validation error

---

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