Graph data
5. The live endpoint
POST/v1/live
One endpoint carries every read and write on a readable graph. Each request names one operation (a "tool") and its arguments. The same call can also be made as POST /v1/live/{tool} with the arguments as the whole body, and GET /v1/live/tools lists the operations a credential may call with the schema of their arguments (see OpenAPI and tool discovery). The same operations, with the exception of ask, are offered to AI assistants over MCP at /v1/live/mcp; all of these run the same code and apply the same permissions.
Accepted credentials: a live key, an OAuth access token, or a session token.
5.1 Request and response#
{ "tool": "search", "args": { "query": "Rossi", "limit": 10 } }
| Field | Type | Description |
|---|---|---|
tool |
string | The operation name. |
args |
object | The operation's arguments. May be omitted for operations that take none. |
args.graph |
string | The graph to act on. Required only when the credential reaches more than one graph (a session token, an OAuth grant covering several graphs, or a key that has created graphs with create_graph). A live key that reaches one graph never needs it. |
Response 200:
{ "result": <operation result>, "revision": 44 }
revision is present only when the call changed the graph, and holds the graph's revision after the change.
curl -s https://graphlife.example.com/v1/live \
-H "Authorization: Bearer $GRAPHLIFE_KEY" \
-H "Content-Type: application/json" \
-d '{"tool": "search", "args": {"query": "Rossi", "limit": 10}}'
5.2 Operations and the permission each one needs#
A credential may call an operation when its scope's tools list contains the name in the right-hand column.
| Operation | Kind | Scope must contain |
|---|---|---|
stats |
read | stats |
list_graphs |
read | stats |
list_groups |
read | stats |
search |
read | search |
search_prose |
read | search_prose |
node |
read | node |
get_nodes |
read | node |
get_document |
read | node |
list_nodes |
read | list_nodes |
list_edges |
read | list_edges |
neighbors |
read | neighbors |
subgraph |
read | subgraph |
paths |
read | paths |
context |
read | search and subgraph |
ask |
read | search and subgraph |
add_to_graph |
write | add_to_graph |
add_edge |
write | add_to_graph |
add_document |
write | add_to_graph |
add_capture |
write | add_capture |
update_node |
write | update_node |
set_groups |
write | set_groups |
create_group |
write | create_group |
update_group |
write | create_group |
delete_node |
write | delete_node |
restore_node |
write | delete_node |
delete_edge |
write | delete_edge |
end_edge |
write | delete_edge |
restore_edge |
write | delete_edge |
create_graph |
account | create_graph |
The names of operations that can appear in a scope's tools are therefore: stats, search, search_prose, node, neighbors, subgraph, paths, list_nodes, list_edges, add_to_graph, add_capture, update_node, set_groups, create_group, delete_node, delete_edge, create_graph. A scope may also name changes, export, extract, webhooks and rotate_key, which are not live operations but unlock routes for the key (see Routes that accept a key). list_nodes, list_edges and these five are never granted by default: a key holds them only when they were named at creation or added by editing the key.
With a session token, the permissions come from the caller's position:
| Caller | Operations |
|---|---|
| Owner of a personal graph | Every read and write operation, including list_nodes and list_edges. Not create_graph. Sees every node. |
Organisation owner or admin |
Every read and write operation, including list_nodes and list_edges, on the groups they hold. |
Organisation member |
Every read operation including list_nodes and list_edges, plus add_to_graph, add_edge, add_document, add_capture, update_node, delete_node, restore_node, delete_edge, end_edge, restore_edge. |
Organisation guest |
Read operations only, including list_nodes and list_edges. |
5.3 Errors common to every operation#
| Status | Code | Meaning |
|---|---|---|
| 400 | graph_required |
The credential reaches several graphs and args.graph was not sent. |
| 400 | bad_request |
An argument that the operation validates has the wrong type or an invalid value. An argument of the wrong JSON type answers 400 bad_args (section 1.1). |
| 401 | unauthorized |
Missing, unknown or expired credential; or a session whose account is not active, or has no graph and no organisation. |
| 401 | key_expired |
The live key is past its expiresAt. |
| 403 | revoked |
The live key has been revoked. |
| 403 | forbidden |
The credential's scope does not include the operation, or the operation name is not recognised (including a missing or misspelt tool). The permission check runs before the name is looked up, so an unknown name is normally answered this way. |
| 404 | not_found |
The graph, node, edge or group does not exist or is not visible to this credential. Also returned to a live key on an organisation graph whose creator has left the organisation or no longer holds any of the key's groups. |
| 404 | unknown_tool |
The name is listed in the credential's scope but no operation has that name. |
| 409 | graph_moved |
The graph was moved into an organisation while the write was waiting. Retry. |
| 409 | app_update_required |
Session token only: writes to this personal graph are locked (section 5.8). |
| 429 | rate_limited |
The credential's request allowance, or the ask limit, is used up (section 1.4). Wait Retry-After seconds and send the same request again. |
| 500 | internal |
Unexpected server error. A malformed body answers 400 bad_json, one over the size limit 413 too_large. |
OAuth tokens can additionally return the OAuth error status and code for an invalid or expired token.
5.4 Read operations#
Every row limit below is additionally capped by the credential's maxNodes (200 unless the key was created with another value; always at most 200 for a session token and on an organisation graph). A limit below 1 is treated as 1. The operations in this section have no offset, cursor or "next page": to see more, narrow the query. To read every node or relationship a credential can see, page by page, use list_nodes and list_edges, and to fetch up to 100 nodes by id in one call, get_nodes (see Listing and paging). list_edges with node is also the way to enumerate every relationship of a node that has more than maxNodes of them, which neighbors cannot return in one answer.
stats#
No arguments. Counts the nodes the credential can see, listed nodes included. It does not report an edge count.
{ "nodesByKind": { "individual": 310, "event": 120, "document": 44 }, "totalNodes": 474 }
search#
Searches node labels and aliases.
| Argument | Type | Default | Description |
|---|---|---|---|
query |
string | — | The text to look for. An empty query returns an empty list. |
limit |
integer | 15 | 1 to maxNodes. |
Result: an array of {"id", "kind", "label"}. A listed node carries a masked label and "withheld": true.
Matching is by substring (three-character fragments) with relevance ranking; queries shorter than three characters fall back to a plain substring match ordered by label length.
search_prose#
Searches the long-form text (props.text) of nodes.
| Argument | Type | Default | Description |
|---|---|---|---|
query |
string | — | The text to look for. An empty query returns an empty list. |
limit |
integer | 8 | 1 to maxNodes. |
Result: an array of {"text", "node", "nodeId", "paragraph"} — the matching paragraph, the label and id of the node it is written on, and the paragraph's position (starting at 0). Only nodes the credential sees in full are searched. A key whose scope redacts text receives an empty list.
The whole query is matched together: a paragraph matches when it contains every word of the query. When the graph's paragraph index finds nothing (a graph that was published as a snapshot has no such index), the server falls back to paragraphs that contain the query string verbatim, ignoring case. A long question therefore usually matches nothing; search for one or two distinctive words. This is a keyword search, not a semantic one.
node#
| Argument | Type | Description |
|---|---|---|
id |
string | The node id. |
Result: {"id", "kind", "label", "props"}, or null when the node does not exist or is not visible (the HTTP status is still 200). A listed node is returned as {"id", "kind", "label" (masked), "props": {"doc_type"?}, "withheld": true}.
props holds every stored property except those the key's scope redacts and the internal owner marker, which is never returned.
The result does not include the node's validFrom / validTo, its aliases, its groups or its edges. Use neighbors for edges; the browser read route in section 13.3 returns all of these in one response for a session token. To fetch several nodes by id in one call, use get_nodes.
neighbors#
| Argument | Type | Default | Description |
|---|---|---|---|
id |
string | — | The node id. |
limit |
integer | 100 | 1 to maxNodes. |
Result: an array of
{
"edgeId": "…", "type": "related_to", "predicate": "mentored",
"direction": "out",
"neighborId": "…", "neighborKind": "individual", "neighborLabel": "Anna Bianchi",
"validFrom": "2021", "validTo": "2023-06"
}
direction is out when the queried node is the edge's source and in when it is the destination. predicate, validFrom and validTo appear only when set. A neighbour the credential sees only as listed is returned with a masked neighborLabel, "withheld": true and no dates; a hidden neighbour is omitted together with its edge. If the queried node is not visible, the result is an empty array. Edge properties other than predicate are not returned by neighbors or subgraph; list_edges returns them to a key holding node. Edge ids are returned by this operation, by subgraph and by list_edges.
subgraph#
Returns the neighbourhood of a node.
| Argument | Type | Default | Description |
|---|---|---|---|
id |
string | — | The centre node. |
depth |
integer | 2 | How many steps to walk. Clamped to 1–3. |
limit |
integer | 120 | Maximum nodes. 1 to maxNodes. |
Result:
{
"nodes": [ { "id": "…", "kind": "individual", "label": "…", "depth": 0 } ],
"edges": [ { "id": "…", "src": "…", "dst": "…", "type": "worked_at",
"validFrom": "2019", "validTo": "2022" } ]
}
Nodes are returned nearest first; depth is the number of steps from the centre. Listed nodes carry a masked label and "withheld": true. Only edges between two returned nodes are included; an edge carries predicate when it has one, and validFrom / validTo only when set. If the centre node is not visible, both arrays are empty.
paths#
Finds paths between two nodes.
| Argument | Type | Default | Description |
|---|---|---|---|
from |
string | — | Start node id. |
to |
string | — | End node id. |
maxHops |
integer | 4 | Clamped to 1–4. |
Result: up to 5 paths, each {"nodeIds": ["…","…"], "edgeTypes": ["worked_at", …], "hops": 2}. A path is omitted entirely if any node on it is hidden.
list_graphs#
No arguments. Result: an array of {"id", "label", "nodes"} for each graph the credential reaches. nodes is omitted for organisation graphs.
list_groups#
No arguments (other than graph). Result: an array of
{ "id": "…", "name": "Finance", "color": 3, "nodes": 212, "writeTarget": true }
Only groups the credential holds are listed, unless it sees every node. writeTarget marks the group this credential's new nodes are filed into.
context#
Retrieves the part of the graph relevant to a question and returns it as text sized for a language-model prompt. No model is called.
| Argument | Type | Default | Description |
|---|---|---|---|
query |
string | — | The question or topic. |
maxTokens |
integer | 1200 | Approximate size budget for the returned text. |
depth |
integer | 2 | Walk depth, clamped to 1–3. |
asOf |
string | — | Answer as of a date (YYYY, YYYY-MM or YYYY-MM-DD): only relationships true on that date are included. An invalid value returns 400 bad_request. |
strict |
boolean | false |
With asOf: also drop relationships whose start date is unknown. |
Result: a string — the context as plain text. When nothing visible matches, the string says so. When more matched than fitted, a closing sentence says the text is a slice. The operation does not return node ids, a structured form or a token count over HTTP.
The context is built by searching node labels for the query, taking the best match as the starting point and walking outwards from it. A query that names nothing in the graph therefore returns the "nothing matches" text unless the vector index is enabled.
When the vector index is enabled for the graph (section 9), semantically similar nodes are used as additional starting points, and matching passages of prose are quoted when the credential's scope includes search_prose and does not redact text. A scope that redacts any property does not use vector matches as starting points.
get_document#
| Argument | Type | Description |
|---|---|---|
id |
string | The id of the node the files are attached to. |
Result: an array, one entry per file attached to the node:
{ "id": "…", "nodeId": "…", "name": "contract.pdf",
"mediaType": "application/pdf", "size": 182044, "dataBase64": "JVBERi0…" }
The node must be visible in full; otherwise 404 not_found. A node with no files returns an empty array. All files of the node are returned in one response, bytes included, oldest first. There is no way to list files without downloading them through this operation, and no range or streaming download.
5.5 Write operations#
Writes to one graph are applied one at a time, in arrival order. Every successful write that changed something returns the new revision.
add_to_graph#
Creates nodes and relationships in one call.
| Argument | Type | Required | Description |
|---|---|---|---|
entities |
array | yes | The nodes to create. See below. |
relations |
array | no | The relationships between them. See below. |
sourceText |
string | no | The original text these facts came from. Stored as the source of the new facts. |
resolve |
boolean | no | Default true: an entity whose name matches an existing node is merged into that node instead of creating a duplicate. false creates every entity as a new node. |
Each entity:
| Field | Type | Required | Description |
|---|---|---|---|
local_id |
string | yes | An id of your choosing, unique within this request, used by relations to refer to the entity. |
kind |
string | yes | See the mapping table in section 2.1. |
label |
string | yes | Display name. |
aliases |
array of strings | no | Other names. |
attributes |
object | no | Properties. Values are stored as strings; nested objects and arrays inside attributes are dropped. Use description for a one-line summary and text for long prose. |
date, place, role, org |
string | no | Convenience properties, stored under the same names. date also sets valid_from when that is absent. |
valid_from, valid_to |
string | no | Validity dates. |
source_span |
string | no | The fragment of sourceText that supports this entity. |
confidence |
number | no | 0 to 1. Default 0.6. |
Each relation:
| Field | Type | Required | Description |
|---|---|---|---|
subject_local_id |
string | yes | local_id of the source entity. |
predicate |
string | yes | An edge type from section 2.2, other than same_as. |
object_local_id |
string | yes | local_id of the destination entity. |
attributes |
object | no | Edge properties. For related_to, include predicate with the verb. |
valid_from, valid_to |
string | no | Validity dates. |
source_span, confidence |
no | As for entities. |
Relations can refer only to entities in the same request. To connect to a node that already exists, either include it as an entity and let it merge by name, or use add_edge with node ids.
Result:
{
"nodesCreated": 2, "nodesMerged": 1, "edgesCreated": 2, "candidatesQueued": 0,
"complete": true,
"nodesRequested": 3, "relationsRequested": 2,
"sourceId": "…",
"nodeIds": ["…", "…", "…"],
"resolved": { "p1": "…", "o1": "…", "e1": "…" }
}
| Field | Description |
|---|---|
complete |
false when any entity or relation was rejected. Always check it: a partly applied request still returns 200. |
rejectedEntities, rejectedRelations |
Present only when something was rejected; each entry names the item and a reason. For entities: malformed, missing_field, unknown_kind, duplicate_local_id. For relations, the reasons include malformed, unknown_predicate, dangling_endpoint (it refers to a local_id that is not in the request) and related_to_without_predicate. |
resolved |
Maps each local_id to the id of the node it became — newly created or merged into. |
nodeIds |
The distinct node ids created or merged into. |
candidatesQueued |
Possible duplicates recorded for later review rather than merged. |
New nodes are filed into the credential's write group. On an organisation graph, an entity is merged only into a node the caller can see in full, and only newly created nodes are filed. On a personal graph, a key with a write group also files the nodes its entities merged into, which makes those nodes visible to every key holding that group.
Errors: 403 kind_out_of_scope — an entity's kind is not a word from the table in section 2.1, or the credential's scope does not allow creating that subtype (for example a key with no write group). The whole request is refused and nothing is written.
The dates in valid_from, valid_to and date are stored as sent, without format validation. Send YYYY, YYYY-MM or YYYY-MM-DD, because date filters compare them as strings.
A merge does not update the existing node's properties. To change a node that already exists, use update_node.
curl -s https://graphlife.example.com/v1/live \
-H "Authorization: Bearer $GRAPHLIFE_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool": "add_to_graph",
"args": {
"sourceText": "Acme Srl signed the supply contract on 3 March 2026.",
"entities": [
{"local_id": "o1", "kind": "org", "label": "Acme Srl"},
{"local_id": "d1", "kind": "document", "label": "Supply contract 2026",
"attributes": {"doc_type": "contract", "description": "Annual supply agreement"}}
],
"relations": [
{"subject_local_id": "o1", "predicate": "related_to", "object_local_id": "d1",
"attributes": {"predicate": "signed"}, "valid_from": "2026-03-03"}
]
}
}'
update_node#
Revises an existing node. The node must be visible in full to the credential.
| Argument | Type | Description |
|---|---|---|
id |
string | Required. The node id. |
label |
string | New display name. |
kind |
string | New coarse kind: one of the six in section 2.1. |
attributes |
object | Merged over the existing properties. A key with the value null is deleted. |
replaceAttributes |
boolean | true replaces the whole property set with attributes instead of merging. |
aliases |
array of strings | Names to add. Existing aliases are never removed. |
validFrom, validTo |
string or null | Omit to leave unchanged; send a string to set; send null to clear. Stored as sent, without format validation; send YYYY, YYYY-MM or YYYY-MM-DD. |
baseRevision |
integer | The revision at which you read the node. When sent, the update is refused with 409 edit_conflict if another writer changed the same fields after that revision (see below for who counts as another writer). |
Result: {"id", "label", "kind", "attributes", "validFrom", "validTo"} — the node after the update.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request |
An argument has the wrong type, or kind is not one of the six. |
| 403 | forbidden |
Organisation graph, the person behind the credential is not an owner or admin, and the change would alter the node's subtype (replaceAttributes, an attributes.subtype, or a kind change on a node with no subtype). Also returned when the scope lacks node (section 4.1). |
| 404 | not_found |
The node does not exist or is not visible in full. |
| 409 | edit_conflict |
See below. |
The edit_conflict error body carries the details needed to resolve it:
{ "error": {
"code": "edit_conflict",
"node": { "id": "…", "kind": "…", "label": "…", "props": { … } },
"fields": ["a.phone", "label"],
"changedBy": "[email protected]",
"changedAt": 1790000900,
"revision": 57
} }
fields lists the conflicting fields (label, kind, validFrom, validTo, a.<property> for a property, a.* when one side replaced the whole property set, groups). node is the node as it is now, and revision is the revision to retry from. Conflicts are checked field by field: two callers changing different properties of the same node both succeed. Aliases are add-only and never conflict. Without baseRevision the last write wins.
Who counts as another writer:
| Graph | A conflict is raised by |
|---|---|
| Organisation graph | An update_node or set_groups made by a different account. Changes made by the caller's own account, through any credential, never conflict. |
| Personal graph | An update_node or set_groups made through any live key or OAuth token (the caller's own included) or by another account; and a snapshot publish that changed the node, which conflicts with every field. Two session-token writers of the same account do not conflict with each other. |
changedBy is the e-mail address of the account that made the conflicting change, or null when that account no longer exists. On a personal graph it is the literal string your phone when the change came from a snapshot publish, and the body carries an additional "via": "key" when the change was made through a live key or OAuth token.
curl -s https://graphlife.example.com/v1/live \
-H "Authorization: Bearer $GRAPHLIFE_KEY" \
-H "Content-Type: application/json" \
-d '{"tool": "update_node",
"args": {"id": "NODE_ID", "attributes": {"phone": "+39 02 1234567", "fax": null},
"baseRevision": 56}}'
add_edge#
Creates one relationship between two existing nodes. Both must be visible in full.
| Argument | Type | Required | Description |
|---|---|---|---|
src, dst |
string | yes | Source and destination node ids. |
type |
string | yes | An edge type from the table in section 2.2. |
attributes |
object | no | Edge properties. Required for related_to, with a non-empty predicate. |
validFrom, validTo |
string | no | YYYY, YYYY-MM or YYYY-MM-DD. |
Result: {"added": true, "src": "…", "dst": "…", "type": "…"}. added is false when the same relationship already exists or src equals dst; in that case nothing changes and no revision is returned. The result does not contain the new edge's id; read it with neighbors.
Errors: 400 bad_type, 400 bad_predicate (related_to without a verb), 400 bad_date, 400 bad_request (attributes is not an object), 404 not_found.
end_edge#
Records that a relationship ended on a date. The relationship stays in the graph as something that was true.
| Argument | Type | Required |
|---|---|---|
id |
string (edge id) | yes |
validTo |
string date | yes |
Result: {"ended": true, "id": "…"}. Errors: 400 bad_request (missing validTo), 400 bad_date, 404 not_found.
delete_node and restore_node#
delete_node soft-deletes a node and every edge attached to it. Argument: id.
Result: {"id": "…", "label": "…", "deleted": true, "edgesRemoved": 4, "restorable": true}. On an organisation graph, edgesRemoved counts only the edges to nodes the caller can see.
restore_node brings back a node deleted with delete_node, with its edges. Argument: id. Result: {"restored": true, "id": "…"}; restored is false when the node is not deleted. Only deletions made through delete_node (or an extraction undo) can be restored this way; anything else answers 404 not_found. Publishing a new snapshot over a personal graph discards the ability to restore earlier deletions.
delete_edge and restore_edge#
delete_edge soft-deletes one edge. Argument: id. Result: {"id": "…", "deleted": true, "src": "…", "dst": "…", "type": "…"}.
restore_edge reverses it. Argument: id. Result: {"restored": true, "id": "…"}; restored is false when the edge is not deleted, or when the same relationship has been created again in the meantime.
Both require both ends of the edge to be visible; otherwise 404 not_found.
set_groups#
Changes which groups a node belongs to, and therefore who can read it.
| Argument | Type | Description |
|---|---|---|
id |
string | Required. The node; must be visible in full. |
groups |
array of group ids | The groups to add, or with replace, the complete new set. |
replace |
boolean | true makes groups the node's set: groups the credential holds and that are not listed are removed. Groups the credential does not hold are left untouched. |
primary |
group id | The node's primary group. Must be one of its groups after the change. |
baseRevision |
integer | As for update_node; the conflicting field is groups. |
Result: {"nodeId": "…", "groups": ["…"]}. groups echoes the group ids named in the request, sorted; it is not the node's complete membership after the change.
Errors: 400 no_groups (nothing to add, or the node would be left in no group), 400 too_many_groups (more than 32), 400 bad_request (primary is not among the node's groups), 403 group_out_of_scope (the credential does not hold a named group), 404 not_found, 409 edit_conflict.
create_group and update_group#
create_group arguments: name (1–120 characters, required), color (integer, default 1).
Result: {"groupId": "…", "name": "…", "usableByThisKey": true}. When usableByThisKey is false, a note explains that the group exists but an owner must grant it to the key before the key can file nodes into it.
update_group arguments: id (required), name, color. Result: {"id", "name", "color"}.
Errors: 400 bad_label (empty or over-long name), 404 not_found (update_group: unknown group, or one the credential does not hold), 409 connector_group (update_group: the group mirrors an external source and is renamed there). A graph holds at most 500 groups; creating one more is refused with an error.
add_capture#
Stores a text verbatim as a source, without creating nodes.
Argument: text (string, required; an empty text returns 400 bad_request). Result: {"sourceId": "…", "characters": 182}.
The live endpoint has no operation that reads a capture back.
add_document#
Uploads a file and attaches it to a node, or creates a new document node for it.
| Argument | Type | Required | Description |
|---|---|---|---|
dataBase64 |
string | yes | The file, base64-encoded. Decoded size at most 50 MB. |
nodeId |
string | no | Attach to this existing node (must be visible in full). When omitted, a new node of kind document is created. |
filename |
string | no | Default document. |
mediaType |
string | no | Default application/octet-stream. |
label |
string | no | Label of the new node. Defaults to filename, or to Document when neither is sent. Ignored with nodeId. |
docType |
string | no | Stored as doc_type on the new node (for example contract, invoice, passport). Ignored with nodeId. |
attributes |
object | no | Properties of the new node. Ignored with nodeId. |
Result: {"nodeId": "…", "nodeIds": ["…"], "created": true, "bytes": 182044}. created is false when the file was attached to an existing node.
Errors: 400 bad_data (missing or invalid base64), 400 bad_request, 403 kind_out_of_scope (the credential may not create a document node), 404 not_found, 413 document_too_large, 413 storage_full.
The server stores the bytes as received. It does not extract text from the file, and file contents are not searchable.
curl -s https://graphlife.example.com/v1/live \
-H "Authorization: Bearer $GRAPHLIFE_KEY" \
-H "Content-Type: application/json" \
-d "{\"tool\": \"add_document\", \"args\": {
\"filename\": \"contract.pdf\", \"mediaType\": \"application/pdf\",
\"label\": \"Supply contract 2026\", \"docType\": \"contract\",
\"dataBase64\": \"$(base64 -w0 contract.pdf)\"}}"
base64 -w0 is the GNU form; on macOS use base64 -i contract.pdf. Passing the file on the command line works for small files only. For anything larger than a few hundred kilobytes, write the JSON body to a file and send it with curl --data-binary @body.json.
5.6 create_graph#
Creates a new, empty personal graph owned by the account that created the live key, and makes it reachable from the same key.
Argument: label (1–120 characters). Result:
{ "id": "…", "label": "Suppliers", "nodes": 0, "note": "Empty, and reachable from this connection: pass \"graph\": \"…\" to any tool." }
After the first create_graph, the key reaches more than one graph, so every later call must send args.graph (the key's original graph included). When the key has a write group, a group with the same id, name and colour is created in the new graph, so that nodes the key adds there are filed and readable. The new graph has server-side AI off.
Errors: 400 bad_label, 403 forbidden (the scope lacks create_graph; or the credential is a session token, an OAuth token, or a key on an organisation graph), 403 too_many_graphs (100 personal graphs per account).
5.7 The write gate: what a credential may create and change#
These rules apply to every write, whichever route it arrives on.
| Rule | Effect |
|---|---|
| A credential may only change what it can see in full. | Updating, deleting, regrouping or attaching a file to a node that is hidden or listed returns 404 not_found. |
| A credential may only create what it would be able to read back. | Creating a node requires a write group (or allNodes), and the subtype must be within the scope's kinds if it has any. Otherwise 403 kind_out_of_scope. A scope restricted by nodeIds cannot create nodes. |
| New nodes are filed into the credential's write group. | The single group the key holds, or its writeGroup. A key with allNodes and no group, and the owner of a personal graph using a session token, create nodes in no group. On an organisation graph a member's session files into the write group set for that member, or into the organisation's "Everyone" group. |
| A credential may only file nodes into groups it holds. | Otherwise 403 group_out_of_scope. |
| Creating a group does not by itself widen a key. | See usableByThisKey under create_group. |
| On an organisation graph, names are merged only into nodes the caller can see. | A matching node the caller cannot see is left alone and a new node is created. |
| On an organisation graph, the first-person node ("Me") is the calling member. | It is identified by the member's account e-mail address. |
5.8 Session-token writes to a personal graph#
A personal graph can also be held on a phone that synchronises by publishing and exporting whole snapshots. To prevent a browser edit from being lost to a device that replaces its copy, session-token writes to a personal graph are refused with 409 app_update_required until either a device has published the graph with pullMerge: true, or the owner has called PATCH /v1/graphs/{graphId} with {"pullMerge": true}. The error body carries an additional detail string.
This gate applies to session tokens only. Live keys and OAuth tokens are never subject to it, organisation graphs are never locked, and reads are never gated. Graphs created with create_graph are unlocked from the start.
5.9 Audit#
Each successful live call on a graph is recorded in the audit log as live.<tool>, with the acting account and, on an organisation graph, the organisation. For a live key or OAuth token the acting account is the person (or service account) the credential acts for, and the entry also records the key or token id. Reads by the owner of a personal graph with a session token are not recorded, list_graphs is not recorded, create_graph is recorded as graph_created, and calls that end in an error are not recorded. The log holds no request or response content. GET /v1/activity?limit=N (session token; default 100, maximum 500, no cursor) returns the calling account's own entries, newest first, as {"activity": [{"event", "actor", "detail", "at", "keyId"?}]}; keyId is present on an entry written for a key or about one. The organisation audit route is described under organisation administration in Accounts and access.