---
title: "Create a graph-enabled knowledge base from a .zip archive"
method: POST
path: "/api/v0/knowledge-bases/import"
tags: ["Knowledge Base Graph"]
---

# Create a graph-enabled knowledge base from a .zip archive

`POST /api/v0/knowledge-bases/import`

## Request

- Base URL: `https://api.outerport.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.outerport.com/api/v0/knowledge-bases/import`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/outerport/apis/outerport-api/docs/api/v0/knowledge-bases/import/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a brand-new graph-enabled collection owned by the caller from a .zip produced by GET /api/v0/knowledge-bases/{kb_id}/graph/archive. All ids are reminted, so uploading the same archive repeatedly produces independent graphs. Fails with 400 if the archive references a package not available in this deployment.

## Request body `multipart/form-data`

- BodyImportKnowledgeGraphApiV0KnowledgeBasesImportPost
  - `file` string, binary, required: A .zip archive from KG export.

## Response `201`

Successful Response

- OpApiEndpointsKnowledgeBasesGraphArchiveImportArchiveResponse
  - `knowledge_base_id` string, uuid, required
  - `name` string, required
  - `package_count` integer, required
  - `document_count` integer, required
  - `visual_component_count` integer, required
  - `node_count` integer, required
  - `edge_count` integer, required
  - `extraction_run_count` integer, required
  - `extraction_source_count` integer, required
  - `attribute_claim_count` integer, required
  - `fact_resolution_count` integer, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-25** `fcd15f6d35b4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/outerport/apis/outerport-api/changes/api/v0/knowledge-bases/import/post.md)

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) - [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) - [OpenAPI document](https://skmtc.dev/outerport/apis/outerport-api/revisions/08b5bf6f7f18?raw)
