Read a canvas
A compact view of a canvas: a summary, then pages of nodes (id, type, label, socket keys, literal values, result links) and their edges. On a big canvas, find nodes with search or read specific ones with nodeIds instead of paging through everything.
/v1/canvas_getcanvas_getTry it
{
"canvasId": "3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c",
"title": "Coral reef poster",
"url": "https://media.fuser.studio/9c2a5d6e7f8a.png",
"revision": 1,
"summary": {
"nodeCount": 1,
"edgeCount": 1,
"nodesByType": {
"prompt": 1
},
"bounds": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
}
},
"nodes": [
{
"id": "aB3dE5",
"type": "OpenAIGPTImageNode",
"label": "Prompt",
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"group": "kZ3qP1",
"in": [
"example in"
],
"out": [
"example out"
],
"values": {
"prompt": "aB3dE5"
},
"results": [
"https://media.fuser.studio/9c2a5d6e7f8a.png"
]
}
],
"edges": [
{
"from": "prompt.text",
"to": "image.prompt"
}
],
"nextCursor": null
}Example
curl "https://api.fuser.studio/v1/canvas_get?canvasId=3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c" \
-H "x-api-key: $FUSER_API_KEY"const result = await fuser.canvas.get({
canvasId: '3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c',
});See the TypeScript SDK.
Input
canvasIdstringrequiredThe canvas id. Pass it to canvas_get, canvas_edit and run_start.
cursorstringnodeIdsstring[]searchstring
Output
canvasIdstringThe canvas id. Pass it to canvas_get, canvas_edit and run_start.
titlestringurlstringrevisionnumberThe canvas revision after this call. Pass it as expectedRevision on your next canvas_edit.
nextCursorstring | nullPass it back as cursor for the next page; null when there are no more.
See what the user has open
The canvas the user has open in Fuser right now, the part of it on their screen, the nodes in that part and the nodes they selected. Call it when they say 'this canvas', 'what I'm looking at', 'these' or 'the selected ones'. Ids work with canvas_get nodeIds and canvas_edit.
Edit a canvas
Apply a graph diff to a canvas all at once: add nodes and edges, change inputs, disconnect edges, delete nodes. Every change lands or none does. Keep each edit to about 30 new nodes; build a bigger canvas one section per edit, so a mistake costs one small resend.