The Graph API provides access to the full Notion workspace graph — all nodes (pages, databases, users) and their relationships (edges). This is the primary endpoint used by the IVGraph 3D visualization.

GET /api/notion-graph/

Returns the complete graph for the authenticated user's workspace.

Authentication: JWT (or no auth for demo mode)

Parameters:

Param Type Required Default Description
demo string no Set to true for demo data (no auth)
workspace_id UUID no primary Specific workspace to load
connection_id UUID no Specific Airbyte connection
admin_user int no User ID override (staff only)

Example request:

# Authenticated user's graph
curl -H "Authorization: Bearer <jwt_token>" \
  "https://ivgraph.com/api/notion-graph/"

# Demo mode (no auth)
curl "https://ivgraph.com/api/notion-graph/?demo=true"

# Specific workspace
curl -H "Authorization: Bearer <jwt_token>" \
  "https://ivgraph.com/api/notion-graph/?workspace_id=abc-123"
import requests

resp = requests.get(
    "https://ivgraph.com/api/notion-graph/",
    headers={"Authorization": "Bearer <jwt_token>"}
)
graph = resp.json()
print(f"{graph['stats']['nodes']} nodes, {graph['stats']['links']} edges")
const resp = await fetch("https://ivgraph.com/api/notion-graph/", {
  headers: { Authorization: "Bearer <jwt_token>" }
});
const graph = await resp.json();
console.log(`${graph.stats.nodes} nodes, ${graph.stats.links} edges`);

Response:

{
  "nodes": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "type": "page",
      "title": "Project Alpha",
      "url": "https://www.notion.so/Project-Alpha-550e8400...",
      "icon": {"type": "emoji", "emoji": "\ud83d\ude80"},
      "connections_in": 5,
      "connections_out": 12,
      "connections_total": 17,
      "pagerank": 0.42
    }
  ],
  "links": [
    {
      "id": "edge-uuid",
      "source": "550e8400-e29b-41d4-a716-446655440001",
      "target": "550e8400-e29b-41d4-a716-446655440002",
      "type": "reference"
    }
  ],
  "metadata": {
    "generated_at": "2026-04-10T12:00:00Z",
    "user": "username",
    "connection_id": "conn-uuid",
    "sync_time": "2026-04-10T10:00:00Z"
  },
  "stats": {
    "nodes": 342,
    "links": 1205,
    "total_blocks": 4500
  }
}

Response when subscription node limit exceeded (informational, graph still returned):

{
  "nodes": ["..."],
  "links": ["..."],
  "metadata": {},
  "stats": {},
  "node_limit_exceeded": true,
  "node_limit": 500,
  "node_count": 742
}

Response when no connection exists:

{
  "nodes": [],
  "links": [],
  "metadata": {"status": "no_connection"},
  "stats": {"nodes": 0, "links": 0, "total_blocks": 0}
}

Data Schemas

Node

Field Type Description
id UUID Notion page/database/user ID
type string page, database, or user
title string Page title or database name
url string Notion URL
icon object|null Icon data (see below)
connections_in int Incoming edge count
connections_out int Outgoing edge count
connections_total int Total edge count
pagerank float PageRank score (0.0 — 1.0)

Icon

Field Type Description
type string emoji, file, or external
emoji string Emoji character (if type=emoji)
file.url string File URL (if type=file)
external.url string External URL (if type=external)

Edge

Field Type Description
id UUID Edge identifier
source UUID Source node ID
target UUID Target node ID
type string reference, parent, mention, or relation

Edge Types

Type Description
reference Page links to another page
parent Page is a child of database/page
mention Page mentions another page or user
relation Database relation property