> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mylists.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication Endpoints

# Authentication API

MTVL provides authentication endpoints for registering users, issuing JWT tokens, retrieving profile details, updating passwords, and managing accounts.

***

## Register User

<span className="badge-post">POST</span> `/api/v1/auth/register`

Register a new user account.

### Request Body

```json theme={null}
{
  "username": "johndoe",
  "email": "john@example.com",
  "password": "SuperSecretPassword123!"
}
```

### Response (`201 Created`)

```json theme={null}
{
  "message": "User registered successfully",
  "user": {
    "id": 42,
    "username": "johndoe",
    "email": "john@example.com",
    "created_at": "2026-09-20T10:00:00Z"
  }
}
```

***

## Authenticate & Issue Token (Login)

<span className="badge-post">POST</span> `/api/v1/auth/login`

Authenticates credentials and returns a signed JWT token.

### Request Body

```json theme={null}
{
  "username_or_email": "johndoe",
  "password": "SuperSecretPassword123!"
}
```

### Response (`200 OK`)

```json theme={null}
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": 42,
    "username": "johndoe",
    "email": "john@example.com"
  }
}
```

***

## Get Current Profile

<span className="badge-get">GET</span> `/api/v1/auth/me`

Retrieves the authenticated user's profile.

### Headers

```http theme={null}
Authorization: Bearer <token>
```

### Response (`200 OK`)

```json theme={null}
{
  "id": 42,
  "username": "johndoe",
  "email": "john@example.com",
  "created_at": "2026-09-20T10:00:00Z"
}
```

***

## Update Profile

<span className="badge-put">PUT</span> `/api/v1/auth/me`

Updates current user username or email.

### Request Body

```json theme={null}
{
  "username": "john_updated",
  "email": "john.new@example.com"
}
```

***

## Change Password

<span className="badge-put">PUT</span> `/api/v1/auth/password`

Updates the authenticated user's password.

### Request Body

```json theme={null}
{
  "old_password": "SuperSecretPassword123!",
  "new_password": "NewUltraSecurePassword456!"
}
```

***

## Delete Account

<span className="badge-delete">DELETE</span> `/api/v1/auth/me`

Deletes the user account and associated personal lists. Shared public catalog entries created by the user remain intact.
