images

insertImageInDocument

Insert an image into a document (max 10MB). Provide imageBase64, imageBinary, or imageUrl. For large files, call createImageUploadSession first then use the returned assetUrl. nlDescription AND caption are both REQUIRED, not optional polish: they are what makes the image findable in search and what lets an agent decide whether this picture belongs on a slide or in an answer, since neither can see the pixels from a filename. Write them about what the image SHOWS.

post/tools/insertImageInDocument

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/insertImageInDocument
  • Auth: HTTP bearer

Request body

projectIdstring

Optional. Narrows a friendly-id lookup to one project. Only needed when a friendly id is ambiguous — TAS-/IMP-/PLN- ids are numbered per PROJECT, so the same id can exist in several. Ignored when the id is a UUID.

documentIdstring required
documentVersionTimestampnumber

Optimistic-lock token: the document's versionTimestamp from getDocument() or any mutating tool's response. (Alias accepted: versionTimestamp.)

imageBase64string byte

Base64-encoded image data. Mutually exclusive with imageBinary/imageUrl.

imageBinarynumber[]

Raw binary as byte array. Mutually exclusive with imageBase64/imageUrl.

imageUrlstring

URL to fetch image from, or assetUrl from createImageUploadSession.

nlDescriptionstring required

Description of image content for semantic search.

captionstring required

Caption below the image.

fileNamestring

Original filename.

widthnumber

Width in pixels.

heightnumber

Height in pixels.

afterLinenumber

Insert after this line, counting the SAME line numbers getDocument prints (1-based; frontmatter is not counted, and every diagram/image marker counts as exactly one line). 0 inserts at the very beginning; omit it to append at the end. Re-read with getDocument if the document may have changed, since the number is positional.

altstring

Alt text. Defaults to caption.

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

Alignment. Default: center.

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.