---
title: "Add a knowledge base to specified project"
method: POST
path: "/apiops/projects/{projectName}/knowledge-bases/{name}/"
tags: ["KnowledgeBase"]
---

# Add a knowledge base to specified project

`POST /apiops/projects/{projectName}/knowledge-bases/{name}/`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/knowledge-bases/{name}/`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/knowledge-bases/:name/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds a knowledge base to specified project. If a knowledge base with the same name exists, it is updated (upsert). The VectorDB and embedding provider connections are named by vectorDbName and embeddingProviderName (own project, then admin project); a sent name sets vectorDbRef / embeddingProviderRef.

## Path parameters

- `projectName` string, required
- `name` string, required

## Request body

- AiKnowledgeBaseDTO
  - `id` string
  - `projectId` string, required
  - `name` string, required
  - `description` string
  - `vectorDbRef` string
  - `embeddingProviderRef` string
  - `vectorDbName` string
  - `embeddingProviderName` string
  - `collectionName` string
  - `chunkSize` integer
  - `chunkOverlap` integer
  - `embeddingModelId` string
  - `status` string
  - `docCount` integer
  - `chunkCount` integer
  - `createdAt` string, date-time
  - `updatedAt` string, date-time

## Response `200`

successful operation!

- ApiOpsResponseSuccess
  - `status` 'SUCCESS' | 'FAILURE'
  - `resultMessage` string
  - `resultList` string[]
  - `resultCount` integer
  - `deploymentResult` DeploymentResult
    - `envName` string
    - `podName` string
    - `podIp` string
    - `success` boolean
    - `detail` string
    - `responseTime` integer
    - `detailList` unknown[]
      - unknown
    - `firstFromApiResultList` unknown
  - `unresolvedReferences` string[]
  - `advisories` ApiOpsAdvisoryDTO[]
    - `level` string
    - `key` string
    - `params` object

## Other responses

- `401`: not authorized for this operation!
- `500`: internal error!

## Changes

- **2026-10-20** `d1a546deccf0`: 8 breaking
  - the request property `name` became required
  - the request property `projectId` became required
  - the `name` request property's minLength was increased from `0` to `1`
  - the `projectId` request property's minLength was increased from `0` to `1`
  - …4 more
  - …this revision’s changelog is incomplete
- **2026-08-11** `9ae232e55479`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/apinizer/apis/apinizer-management-apis/changes/apiops/projects/:projectName/knowledge-bases/:name/post.md)

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
