docs(api): complete backend documentation with all missing endpoints

Complete API documentation audit covering all backend endpoints.

Auth Endpoints:
- Fixed endpoint paths from /api/users/me/* to /api/auth/*
- Added update_email.md and update_username.md

Device Management:
- Device shelf operations (add, get, remove, clear)
- Device CRUD operations (update, delete)
- Registration management (pending, approve, reject)

Books Operations:
- Bulk delete and bulk update with normalization
- Download endpoint with format-specific headers

Conflict Resolution:
- Complete conflict management (list, get, resolve, delete)
- Bulk operations (bulk resolve, bulk dismiss, dismiss all)

Sync Protocols:
- KOReader: progress, metadata, library, bookmarks
- Kobo: markup, bookmarks, analytics, initialization, server sync

Scanner:
- Enhanced docs with manga/comic support
- Added 148-line comprehensive overview
- All formats documented (ebooks, comics, manga)

WebSocket:
- Comprehensive real-time sync API
- Messages, topics, authentication, examples

Documentation:
- Updated api-reference.md with all 122+ endpoints
- Updated index.md with new categories

Total: 36 new files, 6 modified files, 100% coverage
This commit is contained in:
2026-02-08 12:39:46 -05:00
parent d43bd9526b
commit c4607cd9b5
38 changed files with 2275 additions and 15 deletions
@@ -0,0 +1,46 @@
# Analytics GetTests
Kobo analytics endpoint (device compatibility).
**Endpoint**: `POST /api/sync/kobo/v1/analytics/gettests`
**Auth**: Required (Device authentication)
## Device Authentication
This endpoint requires device authentication (not user JWT). This is a Kobo compatibility endpoint.
## Request Body
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| (varies) | object | No | Kobo analytics data (format varies) |
### Example Request
```json
{
"data": {}
}
```
## Response (200 OK)
```json
{
"result": "ok"
}
```
## Error Responses
| Code | Description |
|------|-------------|
| 401 | Device authentication failed |
## Notes
This is a Kobo compatibility endpoint used by Kobo devices for analytics purposes. The exact request/response format follows Kobo's proprietary protocol.
## Try It Out
<!-- API Explorer will be inserted here in Phase 3 -->
+63
View File
@@ -0,0 +1,63 @@
# Bookmark Sync
Sync bookmarks from Kobo device.
**Endpoint**: `POST /api/sync/kobo/bookmark`
**Auth**: Required (Device authentication)
## Device Authentication
This endpoint requires device authentication (not user JWT). Kobo devices authenticate using their device credentials and access tokens.
## Request Body
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| bookmarks | array | Yes | Array of bookmark objects |
### Bookmark Object
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| BookmarkID | string | Yes | Unique bookmark ID |
| ContentID | string | Yes | Book content ID |
| StartPosition | integer | Yes | Bookmark position |
| Text | string | No | Bookmark text |
| DateCreated | string | Yes | ISO 8601 timestamp |
### Example Request
```json
{
"bookmarks": [
{
"BookmarkID": "bookmark123",
"ContentID": "book-uuid",
"StartPosition": 1234,
"Text": "Chapter 5",
"DateCreated": "2026-02-08T10:00:00Z"
}
]
}
```
## Response (200 OK)
```json
{
"message": "Bookmarks synced successfully",
"synced_count": 1
}
```
## Error Responses
| Code | Description |
|------|-------------|
| 401 | Device authentication failed |
| 400 | Invalid request data |
| 404 | Device or book not found |
## Try It Out
<!-- API Explorer will be inserted here in Phase 3 -->
+53
View File
@@ -0,0 +1,53 @@
# Kobo Initialization
Initialize Kobo device sync.
**Endpoint**: `GET /api/sync/kobo/v1/initialization`
**Auth**: Required (Device authentication)
## Device Authentication
This endpoint requires device authentication (not user JWT). Kobo devices authenticate using their device credentials and access tokens.
## Request Headers
| Header | Type | Required | Description |
|--------|------|-----------|-------------|
| X-Device-ID | string | Yes | Device UUID |
| X-Device-Key | string | Yes | Device authentication key |
| X-Kobo-UserKey | string | No | Kobo user key (if available) |
### Example Request
```http
GET /api/sync/kobo/v1/initialization
X-Device-ID: 550e8400-e29b-41d4-a716-446655440000
X-Device-Key: device-auth-key
```
## Response (200 OK)
```json
{
"result": "ok",
"resources": {
"image_host": "https://cdn.kobo.com/...",
"image_url_quality_template": "{ImageId}/h270/{ImageId}_landscape_cover.jpg"
}
}
```
## Error Responses
| Code | Description |
|------|-------------|
| 401 | Device authentication failed |
| 404 | Device not found |
## Notes
This endpoint is called by Kobo devices during initial setup and connection. It returns configuration data required for proper Kobo integration.
## Try It Out
<!-- API Explorer will be inserted here in Phase 3 -->
+71
View File
@@ -0,0 +1,71 @@
# Markup Sync
Sync markup highlights and annotations from Kobo device.
**Endpoint**: `POST /api/sync/kobo/markup`
**Auth**: Required (Device authentication)
## Device Authentication
This endpoint requires device authentication (not user JWT). Kobo devices authenticate using their device credentials and access tokens.
## Request Body
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| bookmarks | array | Yes | Array of bookmark/markup objects |
### Bookmark Object
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| BookmarkID | string | Yes | Unique bookmark ID |
| ContentID | string | Yes | Book content ID |
| StartPosition | integer | Yes | Highlight start position |
| EndPosition | integer | No | Highlight end position |
| Text | string | No | Highlighted text |
| Annotation | string | No | User annotation |
| DateCreated | string | Yes | ISO 8601 timestamp |
| Chapter | string | No | Chapter title |
| Hidden | boolean | No | Whether bookmark is hidden |
### Example Request
```json
{
"bookmarks": [
{
"BookmarkID": "bookmark123",
"ContentID": "book-uuid",
"StartPosition": 1234,
"EndPosition": 1456,
"Text": "Highlighted text from book",
"Annotation": "My annotation",
"DateCreated": "2026-02-08T10:00:00Z",
"Chapter": "Chapter 1",
"Hidden": false
}
]
}
```
## Response (200 OK)
```json
{
"message": "Markup synced successfully",
"synced_count": 1
}
```
## Error Responses
| Code | Description |
|------|-------------|
| 401 | Device authentication failed |
| 400 | Invalid request data |
| 404 | Device or book not found |
## Try It Out
<!-- API Explorer will be inserted here in Phase 3 -->
@@ -0,0 +1,67 @@
# Sync From Server
Push content and metadata to Kobo device.
**Endpoint**: `POST /api/sync/kobo/sync-from-server`
**Auth**: Required (Device authentication)
## Device Authentication
This endpoint requires device authentication (not user JWT). Kobo devices authenticate using their device credentials and access tokens.
## Request Body
| Field | Type | Required | Description |
|--------|------|-----------|-------------|
| book_ids | array of string | No | Array of ContentIDs to sync |
| full_sync | boolean | No | Whether to perform full sync (default: false) |
### Example Request
```json
{
"book_ids": [
"content-id-1",
"content-id-2"
],
"full_sync": false
}
```
## Response (200 OK)
```json
{
"books": [
{
"ContentID": "content-id-1",
"Title": "Book Title",
"Author": "Author Name",
"ISBN": "978-0123456789",
"PublicationDate": "2026-02-08",
"FileSize": 1234567,
"CoverImageId": "cover-id-1",
"Metadata": {
"language": "en",
"publisher": "Publisher Name"
}
}
],
"total": 2
}
```
## Error Responses
| Code | Description |
|------|-------------|
| 401 | Device authentication failed |
| 404 | Device not found |
## Notes
This endpoint pushes library content from the server to the Kobo device. It's called during sync operations to update the device's library catalog.
## Try It Out
<!-- API Explorer will be inserted here in Phase 3 -->