---
title: "Authenticate and obtain a JWT"
method: POST
path: "/auth/login"
tags: ["auth"]
---

# Authenticate and obtain a JWT

`POST /auth/login`

## Request

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

Returns a JWT on success. If the account has 2FA enabled the response contains `{ requires2FA: true, userId }` instead; complete login via `POST /auth/login/2fa`.

## Request body

- object
  - `email` string, email, required
  - `password` string, required

## Response `200`

Login successful. Body is either `{ token, user, organizations }` or `{ requires2FA: true, userId }` when 2FA is active.

## 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)
