graphlife Docs graphlife.app

Graph data

6. Change feed

GET /v1/graphs/{graphId}/changes — session token only.

This section describes the history view used by the apps. A program that keeps a copy of a graph in step should use the gap-free feed instead, GET /v1/graphs/{graphId}/changes?order=asc, which also accepts a live key holding changes, or have changes pushed to it with webhooks: see The change feed and Webhooks.

Reports which nodes changed, who changed them and with which operation. It never contains the changed content; fetch the node to read it. It can be used as a history view or as a long-poll for new changes.

Query parameter Default Description
since — A cursor from a previous response. Returns the changes after it, in the order they happened. When more than limit entries are waiting, the newest limit are returned and more is true; the older ones are skipped, and the returned cursor moves past them. To read every entry after a gap, page backwards with before instead.
wait 0 With since: if nothing has changed, hold the request for up to this many seconds (0–25) until something does.
limit 100 1 to 200 entries.
before — Without since: return entries with a revision lower than this, for paging backwards through history.
node — Without since: only entries that touched this node id.

Without since, entries are returned newest first.

Response 200:

{
  "cursor": "57.3fa9c1d20b7e",
  "revision": 57,
  "changed": true,
  "entries": [
    {
      "revision": 57, "at": 1790000900, "tool": "update_node",
      "by": { "userId": "…", "email": "[email protected]" },
      "mine": false, "via": "key",
      "nodes": [ { "id": "…", "label": "Acme Srl", "deleted": false } ]
    }
  ],
  "more": false
}
Field Description
cursor Pass as since on the next call. It encodes the revision and the caller's current access; a change to what the caller may read also produces a new cursor.
changed With since: true when the cursor moved.
revision The graph's current revision.
entries[].tool The operation: a live operation name, publish (a snapshot replaced the graph) or extract. An extraction undo appears as delete_node.
entries[].by The account that made the change. For a live key or OAuth token this is the person who created it. email is null when the account no longer exists.
entries[].mine true when that account is the caller's.
entries[].via key for a live key or OAuth token, app for a session, a snapshot publish or an extraction.
entries[].nodes The affected nodes the caller can see in full. Entries with none are omitted.
more true when more visible entries exist beyond limit.

Limits and behaviour to plan for:

  • Only changes to nodes the caller can see in full are listed. An edge change is listed only when both ends are visible.
  • At most 5,000 change rows are scanned per request; older history beyond that is not reachable in one call.
  • A publish that changes more than 5,000 nodes records no per-node entries; changed and the new revision are the only signal.
  • Writes that touch no node (add_capture, creating or renaming a group) raise the revision but produce no entry.
  • The first publish of a graph, and nodes removed by a publish, produce no entry.
  • This view is not available to live keys or OAuth tokens; they use the order=asc feed or webhooks (see above). wait holds the request only when since equals the current cursor.
  • Change history for personal graphs is kept for 90 days. For organisation graphs it follows the organisation's audit retention setting, or the AUDIT_RETENTION_DAYS environment variable; when neither is set it is kept indefinitely.

Errors: 400 bad_request (since does not start with an integer), 401 unauthorized, 404 not_found. Non-numeric wait, limit and before values are ignored and the defaults apply.

Obtain the first cursor by calling the route without since, then pass the cursor you received:

curl -s "https://graphlife.example.com/v1/graphs/team-kb/changes?since=57.3fa9c1d20b7e&wait=25" \
  -H "Authorization: Bearer $SESSION_TOKEN"