Updated API docs
This commit is contained in:
1 parent
e82b905886
commit
3df2e2ce3e
2 files changed
+141
-15
No files matched your search
@@ -13,6 +13,34 @@ aliases:
|
||||
|
||||
All endpoints are prefixed with `/api/v1`. See [[Backend]] for server setup.
|
||||
|
||||
> [!note] The `/killer` endpoint is mounted at the root (outside `/api/v1`). `/auth/*` and `/media/*` paths bypass JWT auth.
|
||||
|
||||
---
|
||||
|
||||
## Auth
|
||||
|
||||
> [!info] File: `routes/auth.routes.js` → `controllers/authController.js`
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `POST` | `/auth/login` | Login with password → returns `{ token, expiresIn }` |
|
||||
| `GET` | `/auth/verify` | Verify JWT token (Bearer auth header) → `{ valid: boolean }` |
|
||||
|
||||
---
|
||||
|
||||
## Watch Buddies
|
||||
|
||||
> [!info] File: `routes/watch-buddy.routes.js` → `controllers/watchBuddyController.js`
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/watch-buddies/search?q=` | Search watch buddies by name |
|
||||
| `GET` | `/watch-buddies/:id` | Get watch buddy by ID |
|
||||
| `POST` | `/watch-buddies` | Create watch buddy |
|
||||
| `PUT` | `/watch-buddies/:id` | Update watch buddy |
|
||||
| `DELETE` | `/watch-buddies/:id` | Delete watch buddy |
|
||||
| `POST` | `/watch-buddies/migrate-seen-with` | Migrate `seen_with` string field to watch buddy references |
|
||||
|
||||
---
|
||||
|
||||
## Entries
|
||||
@@ -35,6 +63,7 @@ All endpoints are prefixed with `/api/v1`. See [[Backend]] for server setup.
|
||||
| `GET` | `/entries/sync-series` | Batch refresh all non-ended TV series |
|
||||
| `POST` | `/entries/:id/media` | Upload media (multipart — poster/backdrop/logo) |
|
||||
| `PUT` | `/entries/:entryId/media/:mediaId` | Set media as selected |
|
||||
| `DELETE` | `/entries/:entryId/media/:mediaId` | Delete entry media (auto-selects next available media of same type if deleted media was selected) |
|
||||
|
||||
### TMDB Proxy
|
||||
|
||||
@@ -45,6 +74,7 @@ All endpoints are prefixed with `/api/v1`. See [[Backend]] for server setup.
|
||||
| `GET` | `/entries/tmdb/top-rated/:type` | Top-rated movies/tv |
|
||||
| `GET` | `/entries/tmdb/upcoming/movie` | Upcoming movies |
|
||||
| `GET` | `/entries/tmdb/search?query=&page=` | Multi-search |
|
||||
| `GET` | `/entries/tmdb/preview/:type/:tmdbId` | Preview TMDB entry (movie/tv) before adding — returns local + TMDB data |
|
||||
|
||||
---
|
||||
|
||||
@@ -77,10 +107,10 @@ See [[Watch Tracking]] for the accuracy system.
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/entry-seen` | All entry seens |
|
||||
| `GET` | `/entry-seen/by-entry/:entryId` | Watch records for an entry |
|
||||
| `GET` | `/entry-seen/by-entry/:entryId` | Watch records for an entry (includes `buddies` association) |
|
||||
| `GET` | `/entry-seen/:id` | Single record by ID |
|
||||
| `POST` | `/entry-seen` | Create: `{ entry_id, date_seen, seen_with, accuracy }` |
|
||||
| `PUT` | `/entry-seen/:id` | Update record |
|
||||
| `POST` | `/entry-seen` | Create: `{ entry_id, date_seen, seen_with, accuracy, buddy_ids? }` — `buddy_ids` links watch buddies |
|
||||
| `PUT` | `/entry-seen/:id` | Update record — accepts `{ date_seen, seen_with, buddy_ids? }` |
|
||||
| `DELETE` | `/entry-seen/:id` | Delete record |
|
||||
|
||||
---
|
||||
@@ -92,11 +122,11 @@ See [[Watch Tracking]] for the accuracy system.
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/episode-seen` | All episode seens |
|
||||
| `GET` | `/episode-seen/by-episode/:episodeId` | Watch records for an episode |
|
||||
| `GET` | `/episode-seen/by-entry/:entryId` | All episode seens for an entry |
|
||||
| `GET` | `/episode-seen/by-episode/:episodeId` | Watch records for an episode (includes `buddies` association) |
|
||||
| `GET` | `/episode-seen/by-entry/:entryId` | All episode seens for an entry (includes `buddies` + episode/season info) |
|
||||
| `GET` | `/episode-seen/:id` | Single record by ID |
|
||||
| `POST` | `/episode-seen` | Create: `{ entry_id, episode_id, date_seen, seen_with, accuracy }` |
|
||||
| `PUT` | `/episode-seen/:id` | Update record |
|
||||
| `POST` | `/episode-seen` | Create: `{ entry_id, episode_id, date_seen, seen_with, accuracy, buddy_ids? }` |
|
||||
| `PUT` | `/episode-seen/:id` | Update record — accepts `{ date_seen, seen_with, episode_id?, buddy_ids? }` |
|
||||
| `DELETE` | `/episode-seen/:id` | Delete record |
|
||||
|
||||
---
|
||||
@@ -137,7 +167,7 @@ See [[Media System]] for details.
|
||||
| `GET` | `/media` | All custom media records |
|
||||
| `GET` | `/media/:category/:type/:size/:fileName` | Serve media file |
|
||||
|
||||
**URL pattern:** `/media/{entries|collections|seasons|episodes|peoples}/{posters|backdrops|logos|stills|profiles}/{preview|full}/{filename}`
|
||||
**URL pattern:** `/media/{entries|collections|seasons|episodes|peoples|watch-buddies}/{posters|backdrops|logos|stills|profiles}/{preview|full}/{filename}`
|
||||
|
||||
---
|
||||
|
||||
@@ -163,6 +193,7 @@ See [[People]] for the lazy-fetch pattern.
|
||||
| `POST` | `/people/:id/media` | Upload profile picture |
|
||||
| `GET` | `/people/tmdb/popular` | TMDB popular people |
|
||||
| `GET` | `/people/tmdb/search?query=` | TMDB people search |
|
||||
| `GET` | `/people/tmdb/preview/:tmdbId` | Preview TMDB person before adding — returns local + TMDB data with filmography |
|
||||
|
||||
---
|
||||
|
||||
@@ -198,6 +229,8 @@ See [[Statistics]] for chart details.
|
||||
|
||||
See [[Settings Page#Cleanup]] for the UI.
|
||||
|
||||
### Orphan Files & Media Records
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/maintenance/orphan-files` | Dry scan — files on disk without DB records |
|
||||
@@ -207,6 +240,41 @@ See [[Settings Page#Cleanup]] for the UI.
|
||||
|
||||
**Response:** `{ posters: number, logos: number, backdrops: number, stills: number }`
|
||||
|
||||
### Orphan People
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/maintenance/orphan-people` | Dry scan — people without any credits |
|
||||
| `DELETE` | `/maintenance/orphan-people` | Delete orphan people |
|
||||
|
||||
**Response:** `{ count: number }`
|
||||
|
||||
### Missing Directors
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/maintenance/missing-directors` | Scan for entries missing director credits |
|
||||
| `POST` | `/maintenance/missing-directors` | Fix — fetch missing directors from TMDB |
|
||||
|
||||
**Response:** `{ count: number, fixed: number }`
|
||||
|
||||
### Duplicate Credits
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/maintenance/duplicate-credits` | Scan for duplicate (person, entry, role) credits |
|
||||
| `DELETE` | `/maintenance/duplicate-credits` | Clean duplicate credits (keeps one per group) |
|
||||
|
||||
**Response:** `{ groups: number, duplicates: number, deleted: number }`
|
||||
|
||||
### Watch Status Auto-Fix
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `POST` | `/maintenance/auto-fix-watch-statuses` | Auto-correct entry watch statuses based on watched episodes (e.g., mark series as completed/watching/plan-to-watch) |
|
||||
|
||||
**Response:** `{ completed: number, watching: number, planToWatch: number }`
|
||||
|
||||
---
|
||||
|
||||
## Import
|
||||
@@ -228,4 +296,5 @@ See [[Import System]] for details.
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `GET` | `/ping` | Health check → `{ message: 'pong' }` |
|
||||
| `GET/POST` | `/killer` | Debug: crash backend (outside `/api/v1`) |
|
||||
| `GET` | `/killer` | Debug: crash backend (outside `/api/v1`) |
|
||||
| `POST` | `/killer` | Debug: crash backend (outside `/api/v1`) |
|
||||
Reference in new issue
Block a user