Upload image
upload_imageStore an image and get a Lunafic-hosted URL back. Use for an entry/character avatar (slot "avatar", give entryId) or a playable image — scene, starting-choice, ending (slot "scene", give scenarioId). Provide the bytes ONE of two ways: sourceUrl (a Google Drive link only; the server fetches the file, and a Drive share link is turned into its download link) OR dataBase64 (base64 bytes inline — small files only). For a LOCAL file an agent cannot inline as base64, call create_upload_url instead and curl the file up. PNG or JPEG (GIF accepted, WebP/HEIC are not — re-export first). The image is resized to Lunafic’s own sizes automatically (avatar max 512px long side, scene max 1280px); a PNG or JPEG already under the cap keeps its pixels untouched (never re-encoded), while metadata such as EXIF location and anything appended after the image are removed; GIF and other formats are converted to PNG. Up to 50 uploads per account per 24 hours. Returns { url, width, height, resized }; then set the URL with update_entry (avatarUrl) or update_world (playable image url). The scenario COVER is managed in the editor and cannot be uploaded here.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | Yes | avatar = entry/character avatar; scene = a playable image. | |
| entryId | No | Required for slot "avatar": the world-bible entry to attach the avatar to. | |
| filename | Yes | Original filename (used to detect the image type, e.g. art.png). | |
| sourceUrl | No | Option B: a Google Drive link to the image (share or download link). Images hosted anywhere else go through create_upload_url. Use exactly one of sourceUrl or dataBase64. | |
| dataBase64 | No | Option A: the file bytes, base64-encoded (a data: URI prefix is tolerated). Small files only. | |
| scenarioId | No | Required for slot "scene": the scenario the playable image belongs to. Accepts the scenario (world) id OR its backing projectId. |