Rebuild Knowledge Graph
Queue a replay of this workspace's deterministic knowledge-graph ingestion (admin+): what the rules derived from leads and the timeline (edges, `rules@v1` facts) is deleted and folded again from the start; LLM-extracted facts are kept and nothing is re-extracted. One rebuild per workspace waits at a time: while one is queued or running, it is returned (`created: false`).
API key access
admin scope with an API key (ro_pat_...). A signed-in session uses the caller's role./api/v1/kg/rebuildAccess token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).
In: header
Header Parameters
Id of the workspace to act on (must be a member).
Response Body
curl -X POST "http://localhost:8000/api/v1/kg/rebuild" \ -H "X-Workspace-Id: string"{
"job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"created": true
}Merge Duplicates
Merge one duplicate lead or company (a `GET /kg/duplicates` suggestion) into another (admin+; never automatic). In one transaction every child row of the duplicate (timeline, consents, calls, meetings, enrollments, drafts, replies, research, enrichment, signals, deliveries, knowledge-graph nodes, edges and facts; for companies also their leads) moves to the kept record, empty fields of the kept record are filled from it and the duplicate is deleted. Compliance keeps the stricter state: a consent revoked on either lead revokes the other's for the same channel and purpose, and suppressed addresses (or domains) suppress the kept record's. A timeline note and the audit log record it. Idempotent: repeating it answers the recorded outcome (`already_merged: true`). 404 a record is not a live one of this workspace; 409 `call_in_progress`, `privacy_request_open`, or `already_merged` into another record.
Count Unread Notifications
How many of the caller's notifications are unread (the bell's badge).