Add a library
const url = 'http://localhost:8080/api/v1/libraries';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","path":"example","komga":{"url":"http://komga:25600","apiKey":"example","username":"example","password":"example","libraryIds":["example"],"writeProgress":true},"kavita":{"url":"http://kavita:5000","apiKey":"example","libraryIds":[1],"writeProgress":true},"extension":{"extensionId":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/libraries \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "path": "example", "komga": { "url": "http://komga:25600", "apiKey": "example", "username": "example", "password": "example", "libraryIds": [ "example" ], "writeProgress": true }, "kavita": { "url": "http://kavita:5000", "apiKey": "example", "libraryIds": [ 1 ], "writeProgress": true }, "extension": { "extensionId": "example" } }'Admin only. Adds a folder on the server as a library and starts
scanning it, adds a Komga or Kavita server as a source library and
starts syncing it, or makes a source library that runs on an
extension. Send one of path, komga, kavita or extension.
A Komga library reads Komga’s series and books with one Komga account, and serves their pages and files through Komga. The account needs the page streaming and file download roles. The address and credentials are checked before the library is added, and stored on the server; they are never returned.
A Kavita library reads Kavita’s series, volumes and chapters with one Kavita account’s API key, one publication per chapter, and serves their pages and files through Kavita. The account needs Kavita’s download role for files. The address and key are checked and stored the same way.
An extension library runs on an extension the admin installed, and
starts empty: follow series into it with
POST /api/v1/libraries/{libraryId}/series. It runs on that admin’s
install, so readers granted it don’t need the extension. If the admin
uninstalls it, the library’s pages and syncs fail with
source_unavailable until it’s installed again.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Absolute path of a folder on the server.
A Komga server to read, with an API key, or a name and password, for one Komga account. Everyone granted the Chek library reads what that account can see.
object
Komga’s address, including any path it is served under.
Example
http://komga:25600An API key made in Komga for the account.
The account’s email address, with password.
Komga library ids to read; leave out to read every library the account sees.
Writes your reading progress in this library back to the Komga account, so Komga’s own apps stay in step. Only the admin who adds the library is written back, since every reader shares the one Komga account.
A Kavita server to read, with the API key of one Kavita account, from that account’s settings page in Kavita. Everyone granted the Chek library reads what that account can see.
object
Kavita’s address, including any path it is served under.
Example
http://kavita:5000The account’s API key.
Kavita library ids to read; leave out to read every library the account sees.
Writes your reading progress in this library back to the Kavita account, so Kavita’s own readers stay in step. Comics and PDFs are written as a page; a book is written only when finished, since Kavita keeps a book’s place in a form a locator can’t name. Only the admin who adds the library is written back, since every reader shares the one Kavita account.
object
An extension the admin installed.
Responses
Section titled “Responses”The library was added and its first scan started.
object
The folder on the server, for folder libraries.
Where a source library reads from. Present only on source libraries.
object
The Komga or Kavita server’s address. Absent for an extension library.
The extension an extension library runs on.
The Komga or Kavita libraries read; absent when every library the account sees is read. Kavita’s numeric ids are returned as strings.
The Chek user whose reading progress is written back to the Komga or Kavita account. Absent when none is.
object
Why the last scan failed.
When the last scan finished, whether or not it succeeded.
Example
{ "kind": "folder", "source": { "type": "komga" }, "scan": { "status": "idle" }}The request was malformed, or Komga or Kavita couldn’t be reached
with the settings given (source_check_failed, with the reason).
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The request has no valid session token.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The signed-in user may not do this. demo_account when the user is a
shared demo account, named in CHEK_DEMO_USERS, which can’t change
its password, sessions, sign-in providers, extensions or annotations.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The extension isn’t installed (not_installed).
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The server failed; details are in its log.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}