> ## Documentation Index
> Fetch the complete documentation index at: https://developers.myhero.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Import file

> Import an existing file into a HERO project: PDF, Word (.docx), spreadsheets (.xlsx, .csv, .tsv), images (PNG, JPEG, GIF, WebP), video (MP4, WebM, MOV)…

`import_file`

Import an existing file into a HERO project: PDF, Word (.docx), spreadsheets (.xlsx, .csv, .tsv), images (PNG, JPEG, GIF, WebP), video (MP4, WebM, MOV) and audio (MP3, WAV, M4A, OGG, AAC). Media becomes a document showing it. A spreadsheet becomes a HERO table in the project, one per sheet, its column types read from the data, as the app's table import makes it; read it with get\_table\_data. Tables are not filed in folders: parentId and mode do not apply. A Word file or PDF is kept as it is by default (mode "keep"): it opens in HERO's Word or PDF viewer and keeps round-trips with MS Word; read it with docx\_get\_content / read\_document\_text. mode "convert" makes it an editable HERO document instead, as the app's "Convert to HERO" import does: use it when the user wants to work on it in HERO (a template, placeholders, clause numbering, your edits). If it is unclear which they want, ask. Converting can take a few minutes; a scanned PDF stays a PDF. File it where it belongs: the project the user named or the conversation is about, in the folder of related documents (parentId). If no project was named, resolve it with search\_projects / list\_project\_tree; if more than one could fit, ask the user. Provide the file in exactly ONE way: - `attachmentFilename` — the user attached it to this message in HERO's chat. ALWAYS use this when they did. - `uploadId` — from create\_upload\_url, after PUTting the bytes. The way to hand over a file you hold in a sandbox or on disk (a file the user uploaded to you, or one you generated) — you cannot paste a file's bytes into a tool call. - `sourceUrl` — a public http(s) direct-download URL (not a sharing/preview page). - `base64` — only for small files (\~600KB decoded) whose bytes you genuinely hold. To make a NEW PDF from content instead, use create\_pdf\_document.

## Parameters

**name** `string`

Name in HERO (a workbook with several sheets names each table after its sheet). Defaults to the file name without its extension. Pass it with base64, which carries no file name, with the extension for a CSV or TSV (e.g. "Claims.csv").

**attachmentFilename** `string`

Filename of a file the user attached to this message.

**uploadId** `string`

uploadId returned by create\_upload\_url, after the file was PUT.

**sourceUrl** `string`

Public http(s) direct-download URL of the file.

**base64** `string`

Base64-encoded file bytes, small files only (max \~600KB decoded).

**projectId** `string`

Project to import the file into.

**parentId** `string`

Folder (or document) to file it under. Omit for the project root.

**mode** `string, enum: 'keep' | 'convert'` (default: keep)

Word files and PDFs: "keep" (default) stores the file as it is; "convert" makes an editable HERO document.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.