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

# Login

`POST /auth/login`

## Request

- Base URL: `https://api.companydata.dk` (the document declares no server; this is the origin it was published from)
- URL: `https://api.companydata.dk/auth/login`
- Auth: none declared

Login and get access token.

If 2FA is enabled, returns requires_2fa=true and a temp_token.
Use /login/2fa or /login/recovery to complete authentication.

Sets an httpOnly cookie with the JWT token for browser-based authentication.
The token is also returned in the response body for API clients.

## Request body

- UserLogin
  - `email` string, email, required
  - `password` string, required

## Response `200`

Successful Response

- TwoFactorLoginResponse: Response that may require 2FA.
  - `requires_2fa` boolean
  - `temp_token` string, nullable
  - `access_token` string, nullable
  - `token_type` string

## Other responses

- `422`: Validation Error

---

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