---
title: "POST /api/user/login"
method: POST
path: "/api/user/login"
tags: ["user"]
---

# POST /api/user/login

`POST /api/user/login`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - API key in cookie `sessionid`
  - none

Sets a session cookie for the user

## Request body

- LoginRequest
  - `email` string, email, required
  - `password` string, required
  - `otp` string

## Response `201`

- Login
  - `email` string, email, required
  - `password` string, required

## Other responses

- `400`
- `401`
- `404`
- `405`
- `406`
- `415`
- `500`

## Changes

- **2026-11-13** `f930f1978e15`: 1 breaking, 2 info
  - added `#/components/schemas/UserLoginCreateOtpErrorComponent` to the `oneOf[#/components/schemas/UserLoginCreateValidationError]/errors/items/` response property `oneOf` list for the response status `400`
  - added the new optional request property `otp`
  - added `otp` discriminator mapping keys to the `oneOf[#/components/schemas/UserLoginCreateValidationError]/errors/items/` response property for the response status `400`
- **2026-08-15** `9164f6763019`: 1 info
  - added the non-success response with the status `404`
- **2025-08-17** `14b27b584fd2`: 6 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `405`
  - added the non-success response with the status `406`
  - …2 more
- **2025-08-06** `729510516bbb`: 2 breaking, 1 warning, 1 info
  - added the new required request property `email`
  - removed the required property `username` from the response with the `201` status
  - removed the request property `username`
  - added the required property `email` to the response with the `201` status
- **2025-08-04** `88ca1bd51b8e`: 2 breaking, 1 info
  - added required request body
  - removed the success response with the status `200`
  - added the success response with the status `201`

[Operation history](https://skmtc.dev/frikanalen/apis/frikanalen-django-api/changes/api/user/login/post.md)

---

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