Skip to main content

node:embed

Embed a public branch into the user's personal graph. Equivalent to POST /api/node/embed in REST.

Behavior

  • Embeds an existing public branch into the current user's personal graph.
  • The target branch must be public.
  • Expired or revoked public branches cannot be embedded.

Client → Server node:embed

{
"id": "<uuid>" // required
}

Ack

{
"ok": true,
"diff": {
"user": [
{
"op": 30, // USER_UPDATE=30
"before": {
"publicEmbed": null
},
"after": {
"publicEmbed": "uuid-branch-id"
}
}
]
}
}

Example (JavaScript)

socket.emit("node:embed", { id: "<uuid>" }, (resp) => {
if (resp.ok) console.log("Embedded:", resp.diff);
});

Example (Python)

import socketio

sio = socketio.Client()
sio.connect("https://synaptask.space", headers={"Authorization": "Bearer <API_TOKEN>"})

resp = sio.call("node:embed", {"id": "<uuid>"}, timeout=5)
if resp.get("ok"):
print("Node embedded:", resp["diff"])
else:
print("Embed failed:", resp["error"])

See also Node concept and History concept