> ## 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.

# Create media document

> Upload an image, video or audio file into HERO and create a document containing it. The new document is named after the media and its entire content is a…

`create_media_document`

Upload an image, video or audio file into HERO and create a document containing it. The new document is named after the media and its entire content is a single media block already pointing at the uploaded file — nothing for the user to drag in afterwards. Provide the file in exactly one of three ways: - `attachmentFilename` — the user attached the file to this message. ALWAYS use this when they did; you cannot reproduce an attachment's bytes yourself, but the server still holds them. - `sourceUrl` — a public http(s) URL the server downloads. The only option for anything over \~600KB, and therefore for essentially all video and audio. - `base64` — small files you genuinely hold as bytes. Supported: PNG, JPEG, GIF, WebP / MP4, WebM, MOV / MP3, WAV, M4A, OGG, AAC.

## Parameters

**name** `string` *required*

Name for the new document. Name it after the media, e.g. 'Framed Mixed-Media Fresco'.

**attachmentFilename** `string`

Filename of a file the user attached to this message, e.g. 'IMG\_6934.jpeg'. Use this whenever the media came from an attachment.

**sourceUrl** `string`

Public http(s) URL of the file. The server downloads it. Preferred over base64.

**base64** `string`

Base64-encoded file bytes, for small files only (max \~600KB decoded). Use sourceUrl for anything larger.

**mimeType** `string`

Optional MIME type override, e.g. 'image/png', 'video/mp4', 'audio/mpeg'. Detected from the file's own bytes when omitted; supply it if detection fails.

**caption** `string`

Optional caption shown beneath the media.

**projectId** `string`

Project to create the document in.

**parentId** `string`

Parent folder ID. Omit for the project root.


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