{ data, error, request, response } by default.
Claim the server
Check whether the initial admin account has been created:X-Komga-Email and X-Komga-Password headers:
createKomgaClient before calling admin operations.
Server settings
Read settings:updateServerSettings takes a settingsUpdateDto flat parameter; the generated call returns a no-content response on success:
SettingsUpdateDto fields include:
Operational cautions
The task queue is shared by scans, metadata refreshes, imports, and thumbnail generation.emptyTaskQueue cancels pending work; it does not undo work that has already completed and it does not return a task list. Use it as a maintenance action, not as a polling mechanism.
Historical events are paginated. HistoricalEventDto includes an id, timestamp, type, string-valued properties, and optional bookId and seriesId; keep requesting pages until the page is marked last when exporting an audit trail.
The announcements response is a JSON feed. Its items contain id, title, optional summary/content_html, and a _komga.read flag. Mark only the IDs you have displayed; markAnnouncementsRead accepts an array in its flat body parameter and returns 204 with no payload.
Directory browsing is an admin helper for choosing library roots. Send both path and showFiles in directoryRequestDto; the server can reject paths that are outside its configured filesystem or container mount. Do not treat a listing as permission to read arbitrary files.
Review known duplicate pages
Known hashes can be filtered by one or moreaction values (DELETE_AUTO, DELETE_MANUAL, or IGNORE) in addition to page, size, and sort. The result is paginated and each entry includes its match count, optional byte size, action, and timestamps:
getPageHashMatches before deleting when you need to review the affected books. deleteDuplicatePagesByPageHash removes all matches; deleteSingleMatchByPageHash removes one PageHashMatchDto returned by the matches endpoint. Both actions are destructive and should be followed by a fresh query rather than assuming the previous page is still current.
The duplicate thumbnail endpoints accept an optional
resize query parameter only for unknown hashes. Image results are Blob | File; they are not JSON metadata.Duplicate-review recipe
For a review UI, list a small page of unknown hashes, load previews sequentially (or with a bounded queue), and classify each hash before deleting:Server information and announcements
These operations take only the client in their options object:body parameter. Success is HTTP 204:
Tasks and historical events
Clear pending tasks withemptyTaskQueue. It returns HTTP 204 and no payload:
Directory browsing
getDirectoryListing maps the directoryRequestDto parameter to the request body. The DTO requires both path and showFiles:
Duplicate page detection
List unknown hashes and inspect a thumbnail. Both operations use flat parameters; thumbnail responses areBlob | File values:
getKnownPageHashes accepts action, page, size, and sort directly. getKnownPageHashThumbnail({ pageHash }, { client }) returns Blob | File.
Deleting one match uses the generated pageHashMatchDto parameter. Pass a match returned by getPageHashMatches when you need this narrower operation:
Transient books
Scan a folder, analyze a transient book, and fetch its page representation:bookImportBatchDto parameter. The endpoint returns HTTP 202 with an unknown response body, so do not read result.data as an imported book list:
copyMode controls what happens to the source file:
Each
BookImportDto requires sourceFile and seriesId. Set destinationName to control the library filename, or upgradeBookId when the import should replace an existing book. The import is accepted asynchronously (202), so monitor the library or history rather than expecting imported books in result.data.
Client settings
Global settings are sent as a map from setting name toClientSettingGlobalUpdateDto:
Error handling
Generated calls are non-throwing by default. Checkresult.error and use result.response?.status for transport status. To make the throwing boundary explicit, use unwrap; it raises a typed KomgaApiError:
Next steps
Users
Manage users and their permissions.
Libraries
Configure and scan libraries.
Authentication
Configure Basic or API-key authentication.
Troubleshooting
Diagnose authentication and request failures.