postKnowledgeImport method

Future<void> postKnowledgeImport()

Import an Obsidian, Notion, Roam or Evernote export into the org's knowledge base

Ingests an uploaded export as a tree of kb-page documents with its link structure intact. ?format= picks the normalizer — obsidian, notion, roam or evernote — and the export arrives as a multipart file part, or as the raw request body when there is no multipart part: an Obsidian or Notion vault zip, a Roam JSON (raw or inside the zip Roam downloads), or an Evernote .enex. The pages are filed through the SAME ingest path a connector sync uses, so the kb-page hook indexes each one for retrieval AND extracts its [[wikilinks]] into kb-link edges — the imported vault is searchable and its graph is navigable without a second pass. Parents are filed before their children, and each page takes a slug unique within the org (suffixed -2, -3, … on collision), so a re-import adds pages rather than overwriting the ones already there. Scoped to the caller's validated org; ?project= narrows every imported page to one project. No validated principal is 403, and an org that has not installed the kb module is refused with the install call to make first. The bounds are 64 MB per upload, 5000 pages and 8 MB per archive entry: pages past the five-thousandth are dropped and a larger entry is truncated at its bound, and a page the store rejects is skipped — so the answer's imported count is what was actually filed, not what was sent.

Implementation

Future<void> postKnowledgeImport() async {
  final response = await postKnowledgeImportWithHttpInfo();
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
}