graphlife Docs graphlife.app

Graph data

1. Conventions

1.1 Requests and responses#

Topic Behaviour
Transport JSON over HTTP. Request bodies are JSON objects; responses are JSON with Content-Type: application/json unless stated otherwise.
Path prefix Every route in this document starts with /v1/.
Authentication Authorization: Bearer <token> on every request. The kind of token each route accepts is stated per route (section 1.2).
Errors Any non-2xx JSON response has the body {"error": {"code": "<code>", "message": "…", "requestId": "…"}}. Switch on code; message is one sentence for a person reading a log and may be reworded; requestId is also sent in the X-Request-Id response header. Some errors add fields beside these; they are listed where they occur. See Errors and request ids.
Maximum request body 69,970,602 bytes (about 66.7 MB) on every route. This is sized to carry one 50 MB document encoded as base64 inside JSON. The whole body is held in memory before it is processed.
Graph identifiers 1 to 64 characters from A-Z a-z 0-9 _ -. Graphs created by the server receive a UUID.
Timestamps Fields maintained by the server (updatedAt, createdAt, at, created_at, and so on) are Unix epoch seconds, unless stated otherwise. Dates stored inside a graph (validFrom, validTo) are strings in the form YYYY, YYYY-MM or YYYY-MM-DD.
Field naming Most routes use camelCase. The inbox, encrypted sync and blob routes use snake_case. Field names are given exactly as the server sends them.

A few behaviours are worth knowing before you write a client:

  • A request body that is not valid JSON is answered with 400 bad_json; one over the body limit (about 66 MB) with 413 too_large; an argument of the wrong JSON type with 400 bad_args, whose arg field names it (see Malformed requests).
  • A body that is valid JSON but not an object (an array, a string) is read as an empty object.
  • Unknown paths, and the routes in this document called with an unsupported method, are answered with 404 not_found.

1.2 Credentials#

Credential Looks like Obtained from Used for
Session token A JWT access token, valid for one hour Signing in to an account (see Accounts and access) Managing graphs, keys, exports, extraction, the change feed and the browser read routes. Also accepted by the live endpoint.
Live key glk_… POST/v1/graphs/{graphId}/keys (section 4) The live endpoint (POST /v1/live, POST /v1/live/{tool}, GET /v1/live/tools), POST /v1/ask and the MCP endpoint. A key carries a scope that says which operations it may call and which nodes it may see, and may carry an expiry. A key whose scope names the tool for it may also call the export, extraction, change-feed and webhook routes listed in Routes that accept a key.
OAuth access token Issued by the server's OAuth flow An MCP client that connects through OAuth Accepted wherever a live key is accepted.
Inbox token glin_… POST/v1/inbox/graphs/{graphId}/tokens (section 11) Write-only delivery into a graph's encrypted inbox.

A session token identifies a person. A live key identifies a grant made by a person. On a graph that belongs to an organisation, what a live key or OAuth token may do is re-evaluated on every call against the current role and groups of the person who created it: if that person is demoted or removed, the key narrows or stops working at once.

1.3 Not found means "not yours" as well as "not there"#

Whenever a caller names a graph, node, edge, group or job that it may not see, the server answers 404 not_found, exactly as it does for an identifier that does not exist. This is deliberate: an error must not reveal that something exists. A 403 forbidden is returned only when the caller can see the resource but lacks the permission for the operation.

1.4 Rate limits#

Applies to Limit Response when exceeded
Session tokens on the live endpoint (/v1/live, /v1/live/{tool}, /v1/live/tools, /v1/live/mcp), on POST /v1/ask and on the browser read routes (/v1/desk/*) A token bucket per account, shared by all of these routes: 20 requests per second, burst of 60 (RATE_SESSION_PER_SEC, RATE_SESSION_BURST) 429 rate_limited
Live keys and OAuth tokens on the same routes (except /v1/desk/*, which they cannot call) A token bucket per key or token: 100 requests per second, burst of 1,000 by default (RATE_KEY_PER_SEC, RATE_KEY_BURST) 429 rate_limited
The ask operation and POST /v1/ask 20 calls per 60 seconds, per live key or per OAuth access token, or per account for a session. Refused calls (for example an empty question) count too. 429 rate_limited
Account export (POST /v1/accounts/me/export) 1 per 24 hours per account 429 rate_limited
Inbox delivery (POST /v1/mcp) 120 requests per 60 seconds per client IP address, counted before the token is checked. Behind a reverse proxy the client address is taken from X-Forwarded-For only when the server runs with TRUST_PROXY=true; otherwise every request appears to come from the proxy and shares one allowance. 429 rate_limited

Every 429 rate_limited carries a Retry-After header and the same number of seconds in error.retryAfter. Rate-limit counters are held in memory and reset when the server restarts. The limits that apply to keys on the export and extraction routes are listed in Rate limits.

1.5 Storage and usage limits#

Limit Value Configuration
One uploaded document 50 MB (52,428,800 bytes) Fixed
Total stored bytes per account, or per organisation 2 GiB by default Environment variable QUOTA_BYTES
Graphs per account (personal graphs), and graphs per organisation 100. Checked when a graph is created with create_graph (section 5.6) or with POST /v1/orgs/{orgId}/graphs (section 3.7). Publishing a snapshot (section 3.2), storing a sealed graph and moving a personal graph into an organisation do not check it. Fixed
Groups per graph 500 Fixed
Groups one node may belong to 32 Fixed
A published snapshot 33,554,432 characters of JSON, 50,000 nodes, 200,000 edges, 65,536 bytes of properties per node or edge, JSON nesting depth 40 Fixed
Rows returned by one live read operation The credential's maxNodes, 200 by default (section 4.1) Per key
A sealed (encrypted) graph 33,554,432 characters Fixed
Monthly model-token budget for server-side AI on the operator's model key 0 (off) by default Environment variable LLM_MONTHLY_TOKENS

For an organisation, stored bytes count uploaded documents plus the organisation's graph files and vector index files. For an account, they count uploaded documents on personal graphs plus encrypted blobs. Exceeding the byte quota refuses new uploads only (413 storage_full); nothing is deleted and reads are never blocked.