whiteboards

insertWhiteboardImage

Insert a real IMAGE (photo, screenshot, logo, picture) into a whiteboard — the storage-backed equivalent of insertImageInDocument. Provide the image as imageUrl (fetched and re-hosted), imageBase64, or imageBinary; for large files call createImageUploadSession(documentId) first then pass the returned assetUrl as imageUrl. The bytes are stored in the document-images bucket and the scene only holds a reference (never base64), exactly like pasted images. Options: caption (a text label placed + grouped beneath the image), width/height in px to RESIZE (if only one is given the other follows a 4:3 ratio; ~360px wide if neither), and placement via x/y (top-left) OR align ('left'|'center'|'right', positioned just below existing content) — omit both to auto-place to the right of the current content. After inserting, call getWhiteboardImage to verify. To move or resize the image later, patch its element via updateWhiteboardScene (mode:'patch' with {id, x, y, width, height}). For curated software-architecture ICONS (AWS/Docker/etc.) use addWhiteboardElements with an {type:'image', iconPath} spec instead.

post/tools/insertWhiteboardImage

Request

  • Base URL: https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1
  • URL: https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1/tools/insertWhiteboardImage
  • Auth: HTTP bearer

Request body

documentIdstring required

The whiteboard's documentId.

imageUrlstring

URL to fetch the image from, or an assetUrl returned by createImageUploadSession.

imageBase64string byte

Base64-encoded image bytes (a data: URL prefix is allowed). Best for small images.

imageBinarynumber[]

Raw image bytes as an array of 0-255 values (alternative to imageBase64).

captionstring

Optional caption shown as a text label grouped beneath the image.

widthnumber

Display width in px (resize). Defaults to ~360.

heightnumber

Display height in px. Derived from width at 4:3 if omitted.

xnumber

Top-left x on the canvas. Omit to auto-place.

ynumber

Top-left y on the canvas. Omit to auto-place.

align'left' | 'center' | 'right'

Horizontal alignment relative to existing content (placed below it). Ignored if x/y are provided.

fileNamestring

Optional original filename (for storage + type hinting).

lockedboolean

Lock the placed image so it cannot be moved, resized, or deleted by hand (e.g. a deck-owned framed slide image that changes only via the deck conversation). Defaults to false.

nlDescriptionstring

Optional plain-language description of the image, stored on the element for accessibility and so agents reading the board later know what it depicts.

customDataobject

Arbitrary Excalidraw customData stored on the element (e.g. { deckId } so a board image resolves back to its source deck). Merged with any builder-set customData.

Response

Tool result (shape varies per tool — refer to the tool's docs for the exact return value).

object required

Changes

No recorded changes to this operation across all 1 revision of this API.