Upload Page Image
media_uploadAdd an image to a page. PREFERRED for any image already on the web: pass its imageUrl and the server fetches it directly (no size limit, no attachment needed in chat). imageBase64 is ONLY for very small inline images — large base64 payloads are rejected by request-size limits and waste context, so never paste a photo's bytes; for a file on the user's device use media_upload_link_create instead. After a successful upload, call media_attach to place it (unless this returned content already showing it).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The pageId returned by page_create. | |
| altText | No | Meaningful alt text for the image. | |
| fileName | No | Original file name when known. | |
| imageUrl | No | Public direct image URL. The server validates redirects and blocks private network targets. | |
| editToken | No | Required for anonymous demo pages. Use the editToken returned by page_create. | |
| placement | No | Where the image should be used. header_photo = business-card top photo, avatar = profile header avatar, block_image = image inside a block (requires blockId), gallery_item = appended to a gallery block, background = page background. | |
| contentType | No | Declared MIME type, such as image/png. The server still verifies magic bytes. | |
| imageBase64 | No | Base64 image bytes or a data:image/*;base64 data URI. Use only for small images. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| url | No | ||
| pageId | No | ||
| status | Yes | ||
| altText | Yes | ||
| content | No | ||
| attached | No | ||
| nextStep | No | ||
| variants | No | ||
| deletedAt | No | ||
| expiresAt | No | ||
| placement | Yes | ||
| revisionId | No | ||
| uploadedAt | No | ||
| mediaAssetId | Yes | ||
| uploadPageUrl | No | ||
| revisionVersion | No |