> 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/getting-started/knowledge-management/upload-documents-to-dbs.md).

# Upload Documents to DBs

Using documents to [Interact with Bot](/getting-started/getting-started/interact-with-bot.md) consists of two steps, uploading a document and making sure it's processed before using it.&#x20;

## Upload a file

Uploading a file, again, requires information about the Knowledgebase and path a file should be uploaded to. Both information can be obtained from the steps before.

## POST /files/v2

> Upload File

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"Body_upload_file_files_v2_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"},"knowledge_base":{"type":"string","title":"Knowledge Base"},"parent_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Path","default":"root"}},"type":"object","required":["files","knowledge_base"],"title":"Body_upload_file_files_v2_post"},"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":{"/files/v2":{"post":{"tags":["file management v2"],"summary":"Upload File","operationId":"upload_file_files_v2_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_upload_file_files_v2_post"}}},"required":true},"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"}}}}}}}}}
```

## Next Steps

Now that you we have a DB with Documents, let's also look at how to [Save & Contribute Insights](/getting-started/knowledge-management/save-and-contribute-insights.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/getting-started/knowledge-management/upload-documents-to-dbs.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.
