---
title: "Login"
method: POST
path: "/login"
tags: ["auth"]
---

# Login

`POST /login`

Logs a user in. Returns a JWT-Token to authenticate further requests.

## Request body

- UserLogin
  - `long_token` boolean — If true, the token returned will be valid a lot longer than default. Useful for "remember me" style logins.
  - `password` string — The password for the user.
  - `totp_passcode` string — The totp passcode of a user. Only needs to be provided when enabled.
  - `username` string — The username used to log in.

## Response `200`

OK

- AuthToken
  - `token` string

## Other responses

- `400` — Invalid user password model.
- `403` — Invalid username or password.
- `412` — Invalid totp passcode.

---

[API](https://skmtc.net/go-vikunja/apis/vikunja-api.md) · [All operations](https://skmtc.net/go-vikunja/apis/vikunja-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/go-vikunja/vikunja-api/revisions/feb3f68bbdf1/schema)
