libraryId and deep are flat parameters, followed by { client }. Generated results are non-throwing by default.
Library CRUD operations
List all libraries
getLibraries accepts { client } as its options argument because it has no parameter object:
Get a library by ID
Update a library
updateLibraryById returns void data on success:
Delete a library
This removes the library configuration but does not delete underlying files. The successful response has no data:Library maintenance operations
Scan library
deep is an optional flat query parameter:
Library scans run as background tasks. The accepted response has no useful data payload; monitor Komga tasks separately.
Analyze library
Refresh metadata
Empty trash
Book maintenance
Analyze a book
Refresh book metadata
Delete a book file
Delete series files
Update book metadata
Batch update book metadata
updateBookMetadataByBatch takes a flat body map keyed by book ID. It does not accept an ids plus metadata object:
Metadata reset and batch semantics
Book and series metadata updates are partial: omitted fields remain unchanged. The API update contract permitsnull to unset a scalar metadata field, while an empty array such as tags: [] clears a collection. Lock flags are independent and must be updated explicitly. Both single-item metadata updates and updateBookMetadataByBatch return 204 No Content; re-fetch items if the caller needs the resulting DTO.
The batch endpoint’s flat body is a map from book ID to its own BookMetadataUpdateDto. It is not an { ids, metadata } envelope; each map value may contain a different partial update.
Common workflows
Full library refresh
The maintenance operations return accepted responses, so checkerror after each request:
libraryAnalyze, libraryRefreshMetadata, and thumbnail regeneration are also queued administrative tasks. A maintenance runner should record which requests were accepted and let Komga’s task system report completion rather than treating a successful HTTP response as completed work.
Batch operations on a library
Use theSearchConditionLibraryId condition inside bookSearch to list only books from one library:
Library statistics
Maintenance scheduler
Error handling
Next steps
Libraries
Learn about library creation and configuration.
Admin
Server administration and settings.
Book Content
Access book pages and thumbnails.
Series Discovery
Browse and discover series.