Roam Research Docs · Developer documentation
~/.roam-local-api.json to discover the port and last opened graph:
{
"port": 3333,
"last-graph": "my-graph-name"
}
port - the current API port (may be stale if app is not running)
last-graph - the most recently opened graph name
text
POST http://localhost:3333/api/:graph-name
Content-Type: application/json
{"action": "...", "args": [...]}
action - the Roam Alpha API method path (e.g., data.q, data.block.create)
args - array of arguments to pass to the method
curl -X POST http://localhost:3333/api/my-graph \
-H "Content-Type: application/json" \
-d '{"action": "data.q", "args": ["[:find ?title :where [?e :node/title ?title]]"]}'
curl -X POST http://localhost:3333/api/my-graph \
-H "Content-Type: application/json" \
-d '{"action": "data.block.create", "args": [{"location": {"parent-uid": "abc123", "order": 0}, "block": {"string": "Hello"}}]}'
{"success": true, "result": [...]}
{"success": false, "error": "Local API is disabled. Enable it in Settings menu."}
text
GET http://localhost:3333/api/graphs/open
curl http://localhost:3333/api/graphs/open
{"success": true, "result": [{"name": "my-graph", "type": "hosted"}, ...]}
type is either "hosted" or "offline"
text
GET http://localhost:3333/api/graphs/available
curl http://localhost:3333/api/graphs/available
{"success": true, "result": [...]}
{"success": false, "error": "No graph window open. Please open a graph first."}
markdown version · view in Roam Research · exported 2026-07-03