Files
bookhoard/docs/api/authentication/login.md
T
john-okeefe 52eb75cef7 docs: add authentication and user management API endpoints
Phase 2 part 2: Split auth and user endpoints
- Authentication: register, login, refresh_token, logout
- Users: get_profile, update_profile, update_theme, change_password
- Each endpoint in separate markdown file
- Include request/response examples and error codes
2026-02-02 08:51:40 -05:00

898 B

Login User

Authenticate with email and password.

Endpoint: POST /api/auth/login Auth: Not required Content-Type: application/json

Request Body

Field Type Required Description
email string Yes User's email address
password string Yes User's password

Example Request

{
  "email": "user@example.com",
  "password": "SecureP@ss123!"
}

Response (200 OK)

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "d4f5g6h7...",
  "user": {
    "id": "uuid-here",
    "email": "user@example.com",
    "username": "john",
    "role": "user"
  }
}

Error Responses

Code Description
401 Invalid email or password
400 Missing required fields

Try It Out