Upload an image
upload_imageStore an image on Sitelas's CDN (resized, WebP, blur placeholder) and return its URL — from url (the normal case), or base64 for a small image you made yourself. Pass image_target to also put it on its spot in the same call; without it, place the URL with patch_nodes or edit_content_item. Local agents with the file on disk use mode: 'link', PUT the bytes, then call again with staging_path. When the PERSON has the photo on their device, this is the wrong tool at any size: call get_editor_link with image_target and give them the one-time photo link.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | What the image shows, for screen readers. Required for url, base64 and staging_path. | |
| url | No | Public URL of an image (jpeg/png/webp/gif/svg, under 10MB). The usual source: a photo link the owner pasted, a logo on their old site. | |
| mode | No | Local agents only (Claude Code, Cursor): get a one-hour URL you PUT image bytes from your own disk to, then call upload_image again with staging_path. Not available in hosted chats. | |
| base64 | No | Raw base64 bytes (no data: prefix) of an image YOU authored — an SVG you wrote, a small generated mark — under ~30KB. Bigger payloads get cut off in transit. Never for the owner's own photo: that goes through get_editor_link with image_target (a one-time photo link). | |
| site_id | Yes | ||
| filename | No | With mode: 'link': the original filename, optional. | |
| mime_type | No | With base64: a fallback only; the bytes are sniffed. | |
| image_target | No | Also place the image, in the draft: { node_id } for an image or a section's background photo (ids from get_page view 'content'), or { content_type, item_slug, field } for a collection item's photo. Omit to just get the URL back. | |
| staging_path | No | After mode: 'link' and your PUT: the staging_path it returned. Processes and stores the image. |