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
string
required
Name for the new document. Name it after the media, e.g. ‘Framed Mixed-Media Fresco’.
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.
string
Public http(s) URL of the file. The server downloads it. Preferred over base64.
string
Base64-encoded file bytes, for small files only (max ~600KB decoded). Use sourceUrl for anything larger.
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.
string
Optional caption shown beneath the media.
string
Project to create the document in.
string
Parent folder ID. Omit for the project root.