node:restore
Restore a node from the trash via WebSocket event.
Equivalent to POST /api/node/restore in REST.
Visibility & Permissions
- User must have editor access to the node.
- If ACL check fails →
forbiddenerror.
- If ACL check fails →
- Node must already be in trash.
- If not trashed →
not_trashed_nodeerror.
- If not trashed →
Client → Server node:restore
{
"id": "<uuid>" // required, node id
}
Success (ack)
{
"ok": true,
"diff": {
"batchId": "uuid",
"actor": {
"username": "alice",
"email": "alice@example.com"
},
"ts": "2025-09-25T11:00:00Z",
"nodes": [
{
"op": 4, // NODE_RESTORE=4
"before": {
"id": "uuid",
"inTrash": true,
"version": 4
},
"after": { // Hidrated
"id": "uuid",
"title": "string",
"description": "string",
"status": 0,
"dueDate": "2025-09-13T10:00:00Z",
"tags": ["backend", "urgent"],
"priority": 5,
"independent": false,
"volume": 5,
"type": 0,
"assignee": [],
"inTrash": false,
"version": 5,
"publicToken": "string",
"publicDue": "2026-09-13T10:00:00Z",
"ownerUsername": "BLACK",
"ownerEmail": "black@synaptask.space",
"createdTime": "2025-09-13T10:00:00Z",
"lastEditedTime": "2025-09-25T11:00:00Z",
"x": 0.0,
"y": 0.0,
"z": 0.0,
"access": 0,
"pinned": false,
"collapsed": false,
"shareRoots": ["uuid1", "uuid2"]
}
},
{ // side effect
"op": 2, // NODE_STATUS=2
"before": {
"id": "uuid2",
"Status": 1, // Node status Available=1
"version": 4
},
"after": {
"id": "uuid2",
"Status": 2, // Node status Blocked=2
"version": 5,
"lastEditedTime": "2025-09-25T11:00:00Z",
"shareRoots": ["uuid1", "uuid2"]
}
}
],
"links": [
{
"op": 13, // History operation type LINK_RESTORE=13
"before": {
"id": "uuid",
"inTrash": true,
"version": 4
},
"after": {
"id": "uuid",
"source": "node-uuid-A",
"target": "node-uuid-B",
"type": 0,
"wasBlocker": true,
"private": true,
"version": 1,
"shareRoots": ["root-uuid-1", "root-uuid-2"],
"createdTime": "2025-09-13T10:00:00Z",
"lastEditedTime": "2025-09-13T10:00:00Z",
"lastBatchID": "batch-uuid",
"version": 5,
"inTrash": false,
"shareRoots": ["root-uuid-1", "root-uuid-2"],
"lastEditedTime": "2025-09-13T10:00:00Z"
}
},
{ // side effect
"op": 13, // History operation type LINK_RESTORE=13
"before": {
"id": "uuid2",
"inTrash": true,
"version": 8
},
"after": {
"id": "uuid",
"source": "node-uuid-A",
"target": "node-uuid-B",
"type": 0,
"wasBlocker": true,
"private": true,
"version": 1,
"shareRoots": ["root-uuid-1", "root-uuid-2"],
"createdTime": "2025-09-13T10:00:00Z",
"lastEditedTime": "2025-09-13T10:00:00Z",
"lastBatchID": "batch-uuid",
"version": 9,
"inTrash": false,
"shareRoots": ["root-uuid-1", "root-uuid-2"],
"lastEditedTime": "2025-09-13T10:00:00Z",
}
}
],
"user": [],
"access": [],
}
}
info
The diff contains the restored node and any side effects
(e.g. links automatically restored when parent node is restored).
Consumers must merge diffs by id+version, not overwrite blindly.
Broadcasting (graph:diff)
On success the server broadcasts
graph:diffto:
- the user’s own room (
user:<uid>) except the caller,- all relevant ACL branch rooms.
The calling client receives the ACK directly.
Error (ack)
{
"ok": false,
"error": "bad_request" | "forbidden" | "not_found" | "conflict" | "internal.exception",
"message": "<optional human-readable>"
}
Errors: see error codes
Examples
JavaScript
socket.emit("node:restore", { id: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6" }, (resp) => {
if (resp.ok) {
console.log("Node restored:", resp.diff);
} else {
console.error("Restore failed:", resp.error, resp.message);
}
});
Python (socketio-client)
import socketio
sio = socketio.Client()
sio.connect("https://synaptask.space", headers={"Authorization": "Bearer <API_TOKEN>"})
resp = sio.call("node:restore", {"id": "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"}, timeout=5)
if resp.get("ok"):
print("Node restored:", resp["diff"])
else:
print("Failed:", resp["error"], resp.get("message"))
See also Node concept and Trash concept