---
title: "Create a business knowledge library"
method: POST
path: "/api/projects/{project_id}/business_knowledge/libraries/"
tags: ["business_knowledge"]
---

# Create a business knowledge library

`POST /api/projects/{project_id}/business_knowledge/libraries/`

## Request

- Base URL: `https://us.posthog.com`
- URL: `https://us.posthog.com/api/projects/{project_id}/business_knowledge/libraries/`
- Auth: HTTP bearer

## Path parameters

- `project_id` string, required

## Request body

- KnowledgeLibraryCreate
  - `name` string, required: Name for the new library.

## Response `201`

- KnowledgeLibrary
  - `id` string, uuid, required: Library id.
  - `name` string, required: Library name. Unique in this project, ignoring case.
  - `is_default` boolean, required: True for the library new learned sources join. There is at most one.
  - `source_count` integer, required: How many sources are in this library.
  - `repos` string[], required: Selected repositories in this library that this environment is allowed to read.

## Changes

> 52 revisions in range; 1 not diffed.

- **2026-10-15** `d7a9d45fe2ed`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/posthog/apis/posthog-api/changes/api/projects/:project_id/business_knowledge/libraries/post.md)

---

[API](https://skmtc.dev/posthog/apis/posthog-api.md) · [All operations](https://skmtc.dev/posthog/apis/posthog-api/llms.txt) · [OpenAPI document](https://skmtc.dev/posthog/apis/posthog-api/revisions/71e64193672d?raw)
