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

# User Login

`POST /api/login`

This function is an API endpoint that allows a user to log in without oauth. It is tagged with "login" for OpenAPI documentation. <br>

## Parameters

- `request`: The request data, which includes the user's username and password.  <br>

## Returns

If successful, this function returns a `Json<LoginReply>` object, which includes the user's information and access token.  <br> If the user is not authorized, this function returns a `status::Unauthorized` error.  <br>

## Errors

This function will return an error if the user is not authorized or if the system is in maintenance mode.

## Request body

- LoginRequest
  - `username` string, required
  - `password` string, required
  - `id` string, required
  - `uuid` string, required

## Response `200`

- LoginReply
  - `type` string, required
  - `user` UserInfo, required
    - `name` string, required
    - `email` string, nullable
    - `admin` boolean, required
  - `access_token` integer[], required

## Other responses

- `401`

## Changes

- **2024-05-22** `71c0d469fb17` — 1 info
  - added the required property `user/admin` to the response with the `200` status
- **2024-05-19** `fafd43b82c78` — 1 breaking
  - removed the required property `user/admin` from the response with the `200` status

[Change history](https://skmtc.dev/nesaku/apis/sctgdesk-api-server/changes/api/login/post.md)

---

[API](https://skmtc.dev/nesaku/apis/sctgdesk-api-server.md) · [All operations](https://skmtc.dev/nesaku/apis/sctgdesk-api-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nesaku/sctgdesk-api-server/revisions/b1c0e7a4434f/schema)
