From 92347bcb9185b57096ae4943a08d7037e0670256 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 8 Feb 2026 12:38:14 -0500 Subject: [PATCH] docs(api): add books bulk operations and download documentation - Add bulk_delete_books.md for POST /api/books/bulk-delete - Add bulk_update_books.md for POST /api/books/bulk-update - Includes tag/contributor normalization details - Documents dual-field normalization behavior - Add download_book.md for GET /api/books/:uuid/download - Public endpoint with auth for non-public libraries - Documents Content-Type headers for different formats Completes books operations API section --- docs/developer/api/admin/list_users.md | 59 +++++++++++++++++++ .../api/admin/update_user_max_devices.md | 53 +++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 docs/developer/api/admin/list_users.md create mode 100644 docs/developer/api/admin/update_user_max_devices.md diff --git a/docs/developer/api/admin/list_users.md b/docs/developer/api/admin/list_users.md new file mode 100644 index 0000000..845e75b --- /dev/null +++ b/docs/developer/api/admin/list_users.md @@ -0,0 +1,59 @@ +# List Users + +List all users in the system (admin only). + +**Endpoint**: `GET /api/auth/users` +**Auth**: Required (Admin only) + +## Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|-----------|-------------| +| limit | integer | No | Maximum number of users to return (default: 50) | +| offset | integer | No | Number of users to skip (default: 0) | +| search | string | No | Search by email or username | + +## Request Headers + +| Header | Type | Required | Description | +|--------|------|-----------|-------------| +| Authorization | string | Yes | Bearer token (must have admin role) | + +### Example Request + +```http +GET /api/auth/users?limit=10&search=john +Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... +``` + +## Response (200 OK) + +```json +{ + "users": [ + { + "id": "uuid", + "email": "user@example.com", + "username": "johndoe", + "role": "user", + "max_devices": 10, + "active_devices": 3, + "created_at": "2026-02-08T10:00:00Z" + } + ], + "total": 25, + "limit": 10, + "offset": 0 +} +``` + +## Error Responses + +| Code | Description | +|------|-------------| +| 401 | Invalid or expired token | +| 403 | User does not have admin privileges | + +## Try It Out + + diff --git a/docs/developer/api/admin/update_user_max_devices.md b/docs/developer/api/admin/update_user_max_devices.md new file mode 100644 index 0000000..073ce82 --- /dev/null +++ b/docs/developer/api/admin/update_user_max_devices.md @@ -0,0 +1,53 @@ +# Update User Max Devices + +Update the maximum number of devices a user can register (admin only). + +**Endpoint**: `PUT /api/auth/users/:id/max-devices` +**Auth**: Required (Admin only) +**Content-Type**: `application/json` + +## Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|-----------|-------------| +| id | string (UUID) | Yes | User UUID | + +## Request Body + +| Field | Type | Required | Description | +|--------|------|-----------|-------------| +| max_devices | integer | Yes | Maximum number of devices (1-100) | + +### Example Request + +```json +{ + "max_devices": 15 +} +``` + +## Response (200 OK) + +```json +{ + "id": "uuid", + "email": "user@example.com", + "username": "johndoe", + "max_devices": 15, + "active_devices": 3, + "updated_at": "2026-02-08T11:00:00Z" +} +``` + +## Error Responses + +| Code | Description | +|------|-------------| +| 400 | Invalid max_devices value (must be 1-100) | +| 401 | Invalid or expired token | +| 403 | User does not have admin privileges | +| 404 | User not found | + +## Try It Out + +