Apply a batch of canvas operations
Applies an ordered batch of insert, update, and delete element operations in one transaction and returns the affected elements with the new workspace version. Requires `canvas:write` on the surface. Batches are capped at 500 operations, and non-UUID element ids, unknown element types, and malformed order indexes are rejected as validation errors.
apiKeyAuthorizationBearer <snoze_sk_…>Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
workspaceId*stringsurfaceId*stringapplication/json- body
clientMutationId?string|nullhistoryGroupId?|nullhistoryGroupCancelled?boolean|nullops*array<||>commandId?string|nullcommandFingerprint?string|nullexpectedVersions?|nullexpectedElementCount?number|nullSuccess
application/json- response
data*curl -X POST 'https://api.snoze.dev/v1/workspaces/string/surfaces/string/canvas/ops' \ -H 'Content-Type: application/json' \ -d '{ "ops": [ { "type": "insert", "element": { "id": "string", "type": "rectangle", "index": "string" } } ]}'{ "data": { "workspaceVersion": 0, "elements": [ { "id": "string", "workspaceId": "string", "surfaceId": "string", "type": "rectangle", "x": 0, "y": 0, "w": 0, "h": 0, "angle": 0, "version": 0, "versionNonce": 0, "index": "string", "isDeleted": true, "props": {}, "createdAt": "string", "updatedAt": "string" } ] }}List the elements on a canvas surface
Returns canvas elements and their workspace version. Optional limit (1–2000) bounds the database read and returns hasMore; omitted limit returns the full scene for editors. Requires `canvas:read` on the surface. Returns a not-found error when the workspace has no surface with that id.
Compose editable canvas objects
Compiles a graph, mind map, notes, Mermaid diagram, drawing, or sanitized SVG illustration and applies it atomically. Requires `canvas:write`. Reusing a command id with the same input returns its receipt; conflicting retries, locked objects, stale board state, and invalid geometry are rejected.