Skip to main content
Creates a Knowledge base. A workspace API key creates it for the key’s service account and receives Editor. A personal API key creates it for the member who owns the key. That member is Editor. The personal key does not receive its own access, and later calls with it use the owner’s access. Use the returned id to upload files, rename the Knowledge base, or share access.

Before You Start

  • API key scope: Requires a workspace or personal API key with the KNOWLEDGE_FOLDER_API scope. A workspace key must be set up as described in Share Knowledge bases with the API; a key with no owner gets 403. The key’s owner must have the Upload documents permission.
  • Knowledge bases: The Knowledge Folder API manages resources that appear as Knowledge bases in the Library.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Request Format

This endpoint accepts application/json.

Request Body

Unknown fields are rejected. There is no public endpoint to delete a Knowledge base.

Examples

Create with cURL

Create with JavaScript

Response Format

Success Response (201 Created)

role is EDITOR, and fileCount is 0. You can upload, update, and delete files, rename the Knowledge base, and share access without a separate share step.

Example Response

Error Handling

A blank name, a field over 2000 characters, or an unknown field returns 400 with "Invalid request". When the key’s owner lacks Upload documents, the response is 403 with "This API key's owner does not have permission to upload documents." A missing scope returns 403 with error INSUFFICIENT_SCOPES. A key that is neither a set-up workspace key nor a personal key, including a key with no owner, returns 403 with "This API key cannot create knowledge folders."
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.