The xkg-server REST API. Conforms to the
Stability Contract and the
SLO.
Base URL: https://<your-hub>/api —
self-hosted in the default configuration; the same server also serves
/frontend/<file> as static assets.
Auth: Bearer token in Authorization. Tokens are
issued by the desktop client at first launch and stored in your OS
keychain.
Last revised: 2026-08-21
Content-Type: application/json on every POST / PUT / PATCH.Content-Type: application/json; charset=utf-8.{ "data": ..., "request_id": "<ulid>" }.{ "error": "<code>", "message": "...", "request_id": "..." }.| HTTP | error | Meaning |
|---|---|---|
| 400 | bad_request | Malformed JSON, missing required field, or invalid enum value. |
| 401 | unauthorized | Missing / expired bearer token. |
| 403 | forbidden | Token valid but does not have the requested scope. |
| 404 | not_found | No resource matches <resource_id>. |
| 409 | conflict | Idempotency-Key reused with a different payload. |
| 422 | unprocessable | Semantically invalid (e.g. body parses but client_msg_id is empty). |
| 429 | rate_limited | Back off; see Retry-After header. |
| 500 | internal | Server-side bug. The request_id is what we need. |
| 503 | unavailable | Hub is in maintenance or out of disk. |
Liveness + readiness check. Never authenticated; never rate-limited.
curl -s https://<your-hub>/api/health
{
"data": {
"status": "ok",
"version": "1.0.0",
"api_version": "1.0.0",
"uptime_seconds": 86123,
"schema_version": 7,
"device_count": 3
},
"request_id": "01JC..."
}
The single endpoint that powers the home dashboard. Returns counts and the last 24h activity timeline.
curl -s -H "Authorization: Bearer $TOKEN" \
https://<your-hub>/api/dashboard
List captured conversations, newest first. Stable.
| Query | Default | Meaning |
|---|---|---|
limit | 50 | 1–500. |
offset | 0 | Cursor-style pagination; use the previous response's next_offset. |
llm | (none) | One of chatgpt, claude, grok, gemini. |
since | (none) | RFC 3339 timestamp; returns rows with updated_at > since. |
One conversation with full message list.
The keyword index used by the FTS5-backed search box. Returns
{ keyword: hit_count } for the top 100 terms in your store.
Trending topics across all LLMs in the last 30 days. Sorted by mention count desc.
Same as /api/topics but restricted to ChatGPT / Claude / Gemini
(via the LLM extractors).
Same, restricted to Grok-sourced conversations.
Action items extracted from your conversations.
| Query | Default | Meaning |
|---|---|---|
limit | 100 | 1–1,000. |
priority | (none) | p0 / p1 / p2 / p3. |
status | open | open / done / archived. |
since | (none) | RFC 3339 timestamp. |
Bookmarked tweets you've imported. Sorted by created_at desc.
Conversations that started as a bookmarked tweet (used for the "tweet → thread" linking feature).
Tweets related to the given one by FTS5-similarity threshold 0.8.
Same shape as /api/tweets but for long-form posts.
The list of graphs you've marked public. Stable.
Last 100 captured tabs across all open windows.
Bulk import a browser tab dump (Chrome / Brave export format). Body is the JSON form produced by the TabMind extension.
Single-tab import (legacy endpoint, kept for back-compat; prefer
/api/tabs/import for new clients).
D3-friendly graph dump: { nodes: [...], edges: [...] }. Used by
the dashboard's force-directed view. Supports ?root=<node_id> to
restrict to a 2-hop neighborhood.
See the dedicated Sync architecture doc for threat model + envelope shape. The relevant endpoints:
| Method | Path | Stability |
|---|---|---|
| POST | /api/sync/devices | Stable |
| POST | /api/sync/upload | Stable |
| GET | /api/sync/download | Stable |
| GET | /api/sync/download?since={cursor} | Beta |
Hot-reload the in-memory data caches without restarting the process. Authenticated; admin scope required.
Returns the static SPA index. Not part of the JSON API; do not script against it.
Static files served from the bundled frontend/ directory.
Every endpoint is tagged with one of three stability tiers in the table above. The full contract — deprecation window, removal policy, breaking-change process — lives in the API Stability Contract.