whiteboards

duplicateWhiteboardElements

Copy-paste existing whiteboard elements — the MCP equivalent of selecting a group and pressing Ctrl/Cmd+D. Clones the given elements (plus their group peers + bound text/labels) with FRESH ids, offsets the copy by dx/dy, and by default groups it into ONE new unit so it moves together. Use it to build something once (a labelled stencil frame, a kanban card, a UML class) then stamp out consistent repeats fast — then retext/recolour each copy by its new id (via the returned idMap) with updateWhiteboardScene. Pass groupId to copy a whole group as a unit (e.g. a placed stencil's groupId from its placement result) and/or ids for specific elements. Internal references (group membership, bound text containerId, arrow start/end bindings) are remapped within the copied set; a binding to an element you did NOT copy is dropped. Returns { duplicated, idMap (old id → new id), groupId (the copy's new unit group), elementCount }. Render with getWhiteboardImage afterwards to verify.

post/tools/duplicateWhiteboardElements

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

Request body

documentIdstring required

The whiteboard's documentId.

idsstring[]

Element ids to copy. Each id's full group + any bound text are auto-included. Use this and/or groupId.

groupIdstring

Copy EVERY element in this group as one unit — e.g. a placed stencil's groupId returned by addWhiteboardElements.

dxnumber

Horizontal offset for the copy (default 40). Use the element width + a gap to place copies side by side.

dynumber

Vertical offset for the copy (default 40).

groupboolean

Group the copy into one new unit so it moves/duplicates together (default true).

includeGroupPeersboolean

Auto-include the full group of any id you pass (default true).

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.