{ client } is passed as the options argument. Generated results are non-throwing by default.
List libraries
getLibraries has no parameter object, so { client } is its options argument:
getLibraries returns only libraries visible to the current user; it is not an administrator-only inventory endpoint. An empty array can therefore mean either that no libraries are configured or that the account has no library permission.
Get a library by ID
Create a library
addLibrary expects the flat libraryCreationDto parameter. The required fields below match the generated type:
Configuration fields that affect scanning
scanInterval controls scheduled scans (DISABLED, HOURLY, EVERY_6H, EVERY_12H, DAILY, or WEEKLY), while scanOnStartup controls the initial startup scan. scanCbx, scanEpub, and scanPdf select the file families that are discovered. The importComicInfo*, importEpub*, and importLocalArtwork flags control metadata/artwork import; scanDirectoryExclusions contains server-side relative paths to skip. Hashing, dimension analysis, conversion, and trash cleanup are independent switches—enable only the work the deployment needs.
All paths are interpreted by the Komga server. A client should not assume that /data/comics is meaningful on its own machine.
Update a library
updateLibraryById returns no data on success:
Scan a library
deep is an optional flat query parameter:
Library lifecycle
Creating or updating configuration does not replace a scan. After an update, explicitly calllibraryScan when files should be discovered immediately, then treat the accepted response as a queued background task:
deep: true only when a deep reconciliation is required; it can be substantially more expensive than a regular scan. Deleting a library removes configuration, not files on disk.
Delete a library
Deleting a library removes its configuration but does not delete files on disk. The successful response has no data:Permissions and failure modes
Creating, updating, scanning, and deleting libraries requireADMIN. A normal getLibraries/getLibraryById request is filtered by the current user’s permissions. Handle 401 (not authenticated), 403 (insufficient role), 404 (library not found or not visible), and 409 (a conflicting library configuration) from result.response?.status; do not treat an error result as an empty list.
Next steps
- Maintenance operations: Library Maintenance
- Configuration reference: Configuration
- Troubleshooting: Troubleshooting