> For the complete documentation index, see [llms.txt](https://api.docs.blockbrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.docs.blockbrain.ai/de/erste-schritte/wissensmanagement/eine-datenbank-erstellen/ordner-erstellen.md).

# Ordner erstellen

BlockBrain organisiert Dokumente innerhalb von Datenbanken mithilfe hierarchischer **Ordner** die Zugriffsrechte über Tenants, Benutzer und Gruppen hinweg durchsetzen. Das System entspricht den Freigabemustern für Bots/Unterhaltungen und wahrt eine strikte Tenant-Isolation.

## Einen neuen Ordner erstellen

Unter Verwendung des **`_id`** aus unserem letzten Schritt [Eine Datenbank erstellen](/de/erste-schritte/wissensmanagement/eine-datenbank-erstellen.md), beginnen wir nun mit dem Erstellen von Unterordnern, um Dokumente zu organisieren. Der **`root`** Ordner ist die grundlegende Knowledgebase **`parentPath`** hier.

## POST /folder

> Create Folder

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"DocumentFolderCreateRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"knowledgeBase":{"type":"string","title":"Knowledgebase"},"parentPath":{"type":"string","title":"Parentpath"}},"type":"object","required":["name","knowledgeBase","parentPath"],"title":"DocumentFolderCreateRequest"},"DocumentFolder":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"name":{"type":"string","title":"Name"},"path":{"type":"string","title":"Path","default":"root"},"knowledgeBase":{"type":"string","title":"Knowledgebase"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"accessMode":{"$ref":"#/components/schemas/DocumentAccessMode","default":"restricted"},"isShareAll":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isshareall","default":false},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archivedat"},"sourceType":{"anyOf":[{"$ref":"#/components/schemas/FolderDocumentSourceType"},{"type":"null"}]}},"type":"object","required":["name","knowledgeBase"],"title":"DocumentFolder"},"DocumentAccessMode":{"type":"string","enum":["private","restricted","any-one-with-link"],"title":"DocumentAccessMode"},"FolderDocumentSourceType":{"type":"string","enum":["FOLDER_UPLOAD","ONE_DRIVE","GOOGLE_DRIVE"],"title":"FolderDocumentSourceType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/folder":{"post":{"tags":["folder"],"summary":"Create Folder","operationId":"create_folder_folder_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentFolderCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentFolder"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Beim Erstellen von Ordnern erhalten wir erneut Zugriff auf eine **`_id`** Eigenschaft, die für weitere Operationen wie das Verschieben oder Löschen von Ordnern verwendet werden kann. Der **`Pfad`** sollte beim Erstellen weiterer Unterordner als parentPath verwendet werden.

## Einen Ordner löschen

Die Löschmethode kann entweder eine oder mehrere IDs verwenden, um Ordner innerhalb einer Knowledgebase zu entfernen. Hier müssen wir unsere **`_id`** aus der Ordnererstellung verwenden, um einen gegebenen Ordner wieder zu löschen.

## DELETE /folder/{knowledge\_base}/remove

> Remove Folder

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"DocumentFolderRemoveRequest":{"properties":{"sourceItems":{"items":{"$ref":"#/components/schemas/SourceDocumentFolderItem"},"type":"array","title":"Sourceitems"}},"type":"object","required":["sourceItems"],"title":"DocumentFolderRemoveRequest"},"SourceDocumentFolderItem":{"properties":{"id":{"type":"string","title":"Id"},"type":{"$ref":"#/components/schemas/api__textdatabase__constants__DocumentType","default":"file"}},"type":"object","required":["id"],"title":"SourceDocumentFolderItem"},"api__textdatabase__constants__DocumentType":{"type":"string","enum":["file","folder"],"title":"DocumentType"},"CommonResponseDTO":{"properties":{"code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Code"},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"}},"type":"object","title":"CommonResponseDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/folder/{knowledge_base}/remove":{"delete":{"tags":["folder"],"summary":"Remove Folder","operationId":"remove_folder_folder__knowledge_base__remove_delete","parameters":[{"name":"knowledge_base","in":"path","required":true,"schema":{"type":"string","title":"Knowledge Base"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentFolderRemoveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Nächste Schritte

Jetzt, da wir unsere Ordnerstruktur eingerichtet haben, ist es Zeit, zu [Dokumente in Datenbanken hochladen](/de/erste-schritte/wissensmanagement/dokumente-in-datenbanken-hochladen.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.docs.blockbrain.ai/de/erste-schritte/wissensmanagement/eine-datenbank-erstellen/ordner-erstellen.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
