Skip to main content
The Libraries API provides two endpoints for triggering media scans. A full library scan walks the entire source directory and reconciles all media items with the ErsatzTV database. A per-show scan limits the scope to a single TV show by title, making it faster and less disruptive for large libraries.

POST /api/libraries//scan

Queues a full scan for the specified library. The scan runs asynchronously in the background and re-indexes all media items in the library’s source paths.
integer
required
The integer ID of the library to scan.

Responses

Library scans run in the background worker. The 200 OK response confirms the scan was accepted, not that it is complete. Monitor ErsatzTV logs or the UI to track scan progress.

POST /api/libraries//scan-show

Queues a scan scoped to a single TV show within the specified library. ErsatzTV locates the show by its exact title, then re-indexes only that show’s episodes. This is significantly faster than a full library scan for large collections.
integer
required
The integer ID of the library that contains the show.

Request Body

string
required
The exact title of the TV show to scan. Leading and trailing whitespace is trimmed automatically. The show must already exist in the library; ErsatzTV will not discover new shows through this endpoint.
boolean
default:"false"
When true, performs a deep scan that re-reads file metadata even for items that have not changed on disk. When false (default), only new or modified files are processed.

Responses

The showTitle field must match exactly — including capitalization and punctuation — the title as stored in ErsatzTV’s database. If the show was imported with a specific title format, use that exact string. Fuzzy matching is not performed.