---
title: "Log in user"
method: POST
path: "/auth/login"
tags: ["Authentication"]
---

# Log in user

`POST /auth/login`

Authenticates a user with their credentials and returns an access token if successful.

## Request body

- LoginRequest
  - `username` string, required — The username of the user.
  - `password` string, password, required — The password for the user.

## Response `200`

Login successful. Returns the access token.

- LoginResponse
  - `data` object
    - `accessToken` string — The JWT access token for the authenticated user.
    - `refreshToken` string — The refresh token used to generate new access tokens.

## Other responses

- `401` — Invalid credentials.
- `500` — Internal server error during login.

## Changes

- **2024-10-17** `53644f0719aa` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/forkbombeu/apis/credimi-api/changes/auth/login/post.md)

---

[API](https://skmtc.dev/forkbombeu/apis/credimi-api.md) · [All operations](https://skmtc.dev/forkbombeu/apis/credimi-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/forkbombeu/credimi-api/revisions/53644f0719aa/schema)
