> For the complete documentation index, see [llms.txt](https://docs.ibexa.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ibexa.ai/developers/rest-api/knowledge-base/create-document-from-file.md).

# Create Document From File

Create a document node from an uploaded file in the caller's org.

The raw file is stored and converted to Markdown by a background task; the document is returned immediately with an empty body and parse status `pending`. Poll `GET /nodes/{node_id}/document` for the converted content and final status. `parent_id` must reference a live folder (root when omitted); `name` defaults to the uploaded filename; `summary` is an optional free-text summary of the document. 413 if the file is too large, 415 if its type cannot be converted.

A node's `metadata` is not settable here: this request is `multipart/form-data`, whose fields are flat text, so a JSON object could only travel as an encoded string. Set it with `PATCH /nodes/{node_id}` once the document exists.

```json
{"openapi":"3.1.0","info":{"title":"Ibexa Agentic Marketing Platform","version":"0.1.0"},"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/login/access-token"}}}},"schemas":{"Body_knowledge-base-create_document_from_file":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"summary":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Summary"}},"type":"object","required":["file"],"title":"Body_knowledge-base-create_document_from_file"},"KnowledgeNodeResponseSchema":{"properties":{"id":{"type":"integer","title":"Id"},"organisation_id":{"type":"integer","title":"Organisation Id"},"node_type":{"$ref":"#/components/schemas/NodeType"},"name":{"type":"string","title":"Name"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"citation_count":{"type":"integer","title":"Citation Count"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeNodeUserSchema"},{"type":"null"}]},"updated_by":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeNodeUserSchema"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"name_translations":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Name Translations","description":"Per-language display-name overrides (ISO 639-1 keys), for the two system-managed root folders only — null for every other node. `name` always stays the canonical English string; the caller decides which (if any) of these to show."}},"type":"object","required":["id","organisation_id","node_type","name","slug","parent_id","path","summary","citation_count","metadata","created_by","updated_by","created_at","updated_at"],"title":"KnowledgeNodeResponseSchema","description":"Response schema for a knowledge-base node (tree view, no document body)."},"NodeType":{"type":"string","enum":["folder","document"],"title":"NodeType","description":"The node-type discriminator — the single extension point for new types.\n\nOnly the local types exist today (`folder`, `document`); the CTI design\nkeeps adding types additive."},"KnowledgeNodeUserSchema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","required":["id","email","full_name"],"title":"KnowledgeNodeUserSchema","description":"Basic info about a node's creator/updater."}}},"paths":{"/api/v1/knowledge-base/nodes/upload":{"post":{"tags":["knowledge-base","public"],"summary":"Create Document From File","description":"Create a document node from an uploaded file in the caller's org.\n\nThe raw file is stored and converted to Markdown by a background task; the\ndocument is returned immediately with an empty body and parse status\n`pending`. Poll `GET /nodes/{node_id}/document` for the converted content and\nfinal status. `parent_id` must reference a live folder (root when omitted);\n`name` defaults to the uploaded filename; `summary` is an optional free-text\nsummary of the document. 413 if the file is too large, 415 if its type cannot\nbe converted.\n\nA node's `metadata` is not settable here: this request is `multipart/form-data`,\nwhose fields are flat text, so a JSON object could only travel as an encoded\nstring. Set it with `PATCH /nodes/{node_id}` once the document exists.","operationId":"knowledge-base-create_document_from_file","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_knowledge-base-create_document_from_file"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeNodeResponseSchema"}}}},"400":{"description":"Invalid request payload or parameters","content":{"application/json":{}}},"401":{"description":"User not authenticated","content":{"application/json":{}}},"403":{"description":"User lacks permission","content":{"application/json":{}}},"413":{"description":"File exceeds maximum allowed size","content":{"application/json":{}}},"415":{"description":"Unsupported file type"}}}}}}
```
