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
Filename of a file the user attached to this message, e.g. ‘IMG_6934.jpeg’. Use this whenever the media came from an attachment.
Base64-encoded file bytes, for small files only (max ~600KB decoded). Use sourceUrl for anything larger.
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.