---
title: "Login"
method: POST
path: "/api/v1/auth/login"
tags: ["authentication", "Authentication"]
---

# Login

`POST /api/v1/auth/login`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/auth/login`
- Auth: none declared

Login with email and password.

TECH-663: Rate limited to 5 attempts per minute per IP to prevent brute force.

Args:
    http_request: FastAPI request for IP extraction
    request: Login credentials
    session: Database session

Returns:
    Login response with tokens

Raises:
    UnauthorizedError: If credentials are invalid
    ForbiddenError: If account is locked

## Request body

- LoginRequest: Login request model.
  - `email` string, email, required
  - `password` string, required

## Response `200`

Successful Response

- LoginResponse: Login response model.
  - `access_token` string, required
  - `refresh_token` string, required
  - `token_type` string
  - `user_id` integer, required
  - `email` string, required
  - `role` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
