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

# User login

`POST /auth/login`

Authenticates a user and returns a JWT token if the credentials are valid.

## Request body

- User
  - `created_at` string
  - `id` integer
  - `password` string, required
  - `username` string, required
  - `role` 'admin' | 'viewer'

## Response `200`

OK

- LoginResponse
  - `token` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/loxilb-io/apis/loxilb-rest-api.md) · [All operations](https://skmtc.net/loxilb-io/apis/loxilb-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loxilb-io/loxilb-rest-api/revisions/45e9f0a95af0/schema)
