Upload a file
upload_assetUploads a file to a Wiki.js asset folder for page embedding. Accepts base64 content; rejects SVG/HTML/XML to prevent script execution.
Instructions
Uploads an image or file to an asset folder, so it can be embedded in a page. Content is passed base64-encoded and the content type is derived from the extension. SVG, HTML and XML are refused: Wiki.js serves assets from the wiki’s own origin, so those can carry script that runs for every reader. Note that Wiki.js 2.x has no GraphQL mutation for uploads at all — this uses the editor’s own route, which is undocumented and could change in a future Wiki.js release.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | File name including its extension, e.g. "diagram.png". | |
| folder_id | No | Target folder id. 0 (default) is the root. | |
| content_base64 | Yes | File contents, base64-encoded. |