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

# User login

`POST /api/auth/login`

# Errors
Returns an error if credentials are invalid, email is not verified, or database operations fail.

## Request body

- LoginRequest — Request body for user login
  - `email` string, required — Email address for login authentication
  - `password` string, required — User's password

## Response `200`

Login successful

- LoginResponse — Response for successful user login
  - `message` string, required — Login success message
  - `user` UserInfo, required — User information for API responses and internal use
    - `authProvider` 'google' | 'email' | 'both', required — Authentication provider types supported by the system
    - `avatarUrl` string, nullable — URL to user's avatar image
    - `banner` string, nullable — URL to user's banner image
    - `createdAt` string, date-time, nullable — User account creation timestamp
    - `description` string, nullable — User's description or bio
    - `displayName` string, nullable — User's display name
    - `email` string, required — User's registered email address
    - `emailVerified` boolean, required — Whether the user's email has been verified
    - `id` string, uuid, required — User's unique identifier
    - `lastLogin` string, date-time, nullable — Timestamp of user's last login

## Other responses

- `400` — Invalid credentials or email not verified
- `500` — Login service error or database connection failed

---

[API](https://skmtc.net/patroninc/apis/patron-api.md) · [All operations](https://skmtc.net/patroninc/apis/patron-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/patroninc/patron-api/versions/1583b1f4c97d/schema)
