upload_file
Upload a file into a Files surface (kind='files'). Provide the bytes inline as base64 in content_base64 (a bare base64 string or a data: URL), capped ~3 MB — the request-body limit; a fetch-URL path for larger files is coming. The server sniffs the MIME from magic bytes (don't trust the extension), enforces an allowlist, sanitizes SVGs, strips EXIF from images, and counts the bytes against your plan's storage quota. Returns the created file's {id, name, size, mimeType, parentFolderId, createdAt}. surface_slug is required (use list_surfaces to find the files surface); parent_folder_id defaults to the surface root.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mime | No | Optional MIME hint. The server still sniffs magic bytes; this only helps for extension-less or ambiguous content. | |
| slug | Yes | The workspace slug (bare or org-prefixed). | |
| filename | Yes | The file's name, including extension (e.g. "report.pdf"). | |
| surface_slug | Yes | The Files surface slug to upload into (required). | |
| content_base64 | No | The file bytes, base64-encoded. Accepts a bare base64 string or a "data:<mime>;base64,..." data URL. ~3 MB cap. Provide this OR `url`, not both. | |
| parent_folder_id | No | Optional folder id (from list_files) to place the file in. Defaults to the surface root. |