Files
Showy/docs-vault/API Reference.md
T
2026-06-25 03:11:32 +01:00

11 KiB

title, tags, aliases
title tags aliases
API Reference
backend
api
endpoints
Endpoints
REST API

API Reference

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

[!info] File: routes/entry.routes.js → controllers/entryController.js

Method Path Description
GET /entries Get all library entries (with IDs, ratings, genres, networks, media, seens, seasons)
GET /entries/:id Get entry by ID — triggers Services#Lazy Refresh if stale
POST /entries Add entry from TMDB: { tmdb_id, is_tvserie }
PUT /entries/:id Update entry fields: { entryData }
PUT /entries/:id/ratings Update ratings: { entryRatings }
PUT /entries/:id/ids Update external IDs
DELETE /entries/:id Delete entry and all related data
GET /entries/:id/seasons Get all seasons for a TV entry
GET /entries/:id/credits Get ALL credits (cast + crew) for an entry, with associated person populated. Used by Pages#EntryCastsPage
PUT /entries/:id/refresh Force refresh from TMDB
PUT /entries/:id/fetch-collection Fetch/create TMDB collection for entry
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

Method Path Description
GET /entries/tmdb/trending/:type Trending movies/tv
GET /entries/tmdb/popular/:type Popular movies/tv
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

Collections

[!info] File: routes/collection.routes.js → controllers/collectionController.js

Method Path Description
GET /collections All collections
GET /collections/:id Collection by ID with entries
POST /collections Create user collection
PUT /collections/:id Update (multipart — poster/backdrop)
PUT /collections/:id/refresh Refresh from TMDB
PUT /collections/:id/parts Fetch missing parts from TMDB
DELETE /collections/:id Delete collection
POST /collections/:collectionId/entries/:entryId Add entry to collection
PATCH /collections/:collectionId/entries/:entryId Update entry order
DELETE /collections/:collectionId/entries/:entryId Remove entry from collection
POST /collections/collection-with-entry Create collection + add first entry

Entry Seen (Movie Watch Records)

[!info] File: routes/entry-seen.routes.js → controllers/entrySeenController.js

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 (includes buddies association)
GET /entry-seen/:id Single record by ID
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

Episode Seen (Episode Watch Records)

[!info] File: routes/episode-seen.routes.js → controllers/episodeSeenController.js

Method Path Description
GET /episode-seen All episode seens
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, buddy_ids? }
PUT /episode-seen/:id Update record — accepts { date_seen, seen_with, episode_id?, buddy_ids? }
DELETE /episode-seen/:id Delete record

Seasons

[!info] File: routes/season.routes.js → controllers/seasonController.js

Method Path Description
GET /seasons All seasons
GET /seasons/:id Season by ID (includes episodes with episodeSeens)
GET /seasons/:id/episodes Season episodes only
POST /seasons Create season
PUT /seasons/:id Update season
DELETE /seasons/:id Delete season

Episodes

[!info] File: routes/episode.routes.js → controllers/episodeController.js

Method Path Description
GET /episodes/month/:startDate/:endDate Episodes airing between dates (for Calendar)

Media

[!info] File: routes/media.routes.js → controllers/mediaController.js

See Media System for details.

Method Path Description
GET /media All custom media records
GET /media/:category/:type/:size/:fileName Serve media file

URL pattern: /media/{entries|collections|seasons|episodes|peoples|watch-buddies}/{posters|backdrops|logos|stills|profiles}/{preview|full}/{filename}


People

[!info] File: routes/people.routes.js → controllers/peopleController.js

See People for the lazy-fetch pattern.

Method Path Description
GET /people All people
GET /people/popular?limit= Popular people (local DB)
GET /people/search?query= Search people (local DB)
GET /people/:id Person by ID (lazy-fetch from TMDB if needed)
GET /people/:id/credits Person's credits
GET /people/:id/tmdb-filmography Full TMDB filmography
POST /people Create person
POST /people/fetch Fetch by TMDB ID: { tmdb_id }
PUT /people/:id Update person
PUT /people/:id/refresh Refresh from TMDB
DELETE /people/:id Delete person
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

Statistics

[!info] File: routes/statistics.routes.js → controllers/statisticsController.js

See Statistics for chart details.

Method Path Description
GET /statistics/watch-time All-time watch time (series + movies, in minutes)
GET /statistics/watch-time/year/:year Yearly watch time by month
GET /statistics/watch-count/year/:year Yearly watch count by month
GET /statistics/watch-weekday Watch-day distribution (EXACT accuracy only)

Settings

[!info] File: routes/settings.routes.js → controllers/settingsController.js

Method Path Description
GET /settings Get all settings
PUT /settings Update settings

Maintenance

[!info] File: routes/maintenance.routes.js → controllers/maintenanceController.js

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
DELETE /maintenance/orphan-files Delete orphan files
GET /maintenance/orphan-media-records Dry scan — DB records without files on disk
DELETE /maintenance/orphan-media-records Delete orphan DB records

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

[!info] File: routes/import.routes.js → controllers/importController.js

See Import System for details.

Method Path Description
POST /import/movies Bulk import movies
POST /import/tmdb Bulk import by TMDB IDs
POST /import/episodes-watch-history Bulk import episode watch history

Utility

Method Path Description
GET /ping Health check → { message: 'pong' }
GET /killer Debug: crash backend (outside /api/v1)
POST /killer Debug: crash backend (outside /api/v1)