Accounts and access
10. Organisations, members and roles
An organisation is a set of accounts that share graphs. All organisation routes require a session. A call without one answers 401 unauthorized. A call on an organisation the caller does not belong to answers 404 not_found, whatever the route.
Any account may create an organisation; its creator becomes its owner.
10.1 Roles#
| Role | Graph tools on the organisation's graphs | Organisation management |
|---|---|---|
owner |
All read, write and list tools, and every integration tool | Everything an admin can do, plus: grant or remove the owner and admin roles, change an admin's or owner's groups, invite admins, create and manage admin service accounts, export the organisation, delete the organisation, turn server-side AI on or off for a graph. |
admin |
All read, write and list tools, and every integration tool | Invite and remove members and guests, change their role between member and guest, change their groups, create and manage member and guest service accounts, mint, edit, rotate and revoke API keys, add graphs, read the audit trail, set audit retention, set the organisation's model-provider key. |
member |
Read and list tools, plus add_to_graph, add_capture, update_node, delete_node, delete_edge, and the integration tools changes and export |
None. May list members and leave the organisation. |
guest |
Read and list tools, and the integration tools changes and export |
None. May list members and leave the organisation. |
create_graph is never available on an organisation graph, in any role. A role's tools are the most a credential acting for that person can hold; a key or OAuth connection still holds only the tools its own scope names.
10.2 Groups and what a member can see#
Access to content in an organisation graph is decided by groups. Every node belongs to zero or more groups, and a person sees a node only if they hold one of its groups. This applies to owners and admins too: no role reads everything.
A member holds:
- the organisation's everyone group (created with the organisation), unless their role is
guest; - the groups an admin has given them (
groupson the member or on their invite); - on a given graph, any group that mirrors an access list from a connected data source and names them. These groups are granted by the data source, never by an admin; trying to assign one answers
409 connector_group.
New nodes a member creates are filed into their writeGroup when one is set and they hold it. When no write group is set, the everyone group is used. A write group that the member does not hold is not honoured and is not replaced by the everyone group, so set it only to a group the member holds. Guests cannot write.
Groups are identified by id. Group ids are created by the graph tools (create_group, and list_groups to read them), which are described in graph data; this part of the API has no route to list or create groups.
10.3 Organisations#
POST/v1/orgs#
Creates an organisation. Session.
| Body field | Required | Meaning |
|---|---|---|
name |
yes | 1 to 120 characters. |
curl -X POST https://graphlife.example.com/v1/orgs \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' -d '{"name":"Example Ltd"}'
{ "orgId": "5d0e…", "name": "Example Ltd" }
| Status | code |
When |
|---|---|---|
| 400 | bad_name |
Empty or longer than 120 characters. |
| 403 | too_many_orgs |
The account already owns 3 organisations, or has created 5 this calendar month. |
GET/v1/orgs#
Lists the organisations the caller belongs to. Session. Not paginated.
{ "orgs": [ { "orgId": "5d0e…", "name": "Example Ltd", "role": "owner" } ] }
DELETE/v1/orgs/{orgId}#
Deletes the organisation immediately, with all of its graphs, attached files, members, invites and keys. Org owner. There is no grace period and no undo.
| Body field | Required | Meaning |
|---|---|---|
confirm |
yes | The organisation's exact name. |
Response: 200 OK with {"deleted": "<orgId>"}.
| Status | code |
When |
|---|---|---|
| 400 | confirm_mismatch |
confirm is not the organisation's name. |
| 403 | forbidden |
The caller is not an owner. |
There is no route to read a single organisation or to rename one.
10.4 Members#
GET/v1/orgs/{orgId}/members#
Lists the members, in the order they joined. Org member (any role). Not paginated.
{
"members": [
{ "userId": "0b6f…", "email": "[email protected]", "role": "owner", "lastSeen": 1764288000 },
{ "userId": "7c21…", "email": "[email protected]", "role": "member", "lastSeen": null }
]
}
lastSeen (the time the member's most recent session was issued) is included only when the caller is an org admin. The listing does not include a member's groups, and lists people only: service accounts have their own routes under /v1/orgs/{orgId}/service-accounts, described in Service accounts.
PATCH/v1/orgs/{orgId}/members/{userId}#
Changes a member's role, groups or write group. Org admin, with the restrictions below.
| Body field | Type | Meaning |
|---|---|---|
role |
string | One of owner, admin, member, guest. |
groups |
array of group ids | Replaces the full set of groups an admin has given this member. Send the complete list. |
writeGroup |
group id or null |
Where the member's new nodes are filed. null clears it. |
Omitted fields are left unchanged.
curl -X PATCH https://graphlife.example.com/v1/orgs/$ORG_ID/members/$USER_ID \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"role":"member","groups":["4f0c2f6e-1d2b-4a55-8a3e-9d2f6b1c7e21"]}'
Response: 200 OK with {"userId": "…", "role": "member"}.
Rules:
- Only an owner may change a role to or from
owneroradmin. - Only an owner may change the groups or write group of another owner or admin.
- An admin may add only groups that they hold themselves.
- The last owner cannot be demoted.
- A service account cannot be made
owner.
| Status | code |
When |
|---|---|---|
| 400 | invalid |
Unknown role, or a field of the wrong type. |
| 403 | forbidden |
The caller is not an admin, or the change needs an owner. |
| 404 | not_found |
The target is not a member. |
| 409 | last_owner |
The change would leave the organisation without an owner. |
| 409 | connector_group |
A listed group mirrors a data source's access list and cannot be assigned by hand. |
| 409 | scope_exceeds_yours |
An admin tried to add a group they do not hold. |
Ownership is transferred by promoting another member to owner and then, if wanted, demoting or removing the previous one.
DELETE/v1/orgs/{orgId}/members/{userId}#
Removes a member. Org admin; any member may remove themselves (leave). Only an owner may remove an owner or admin other than themselves.
Response: 200 OK with {"removed": "<userId>"}.
Effects: the member loses access to the organisation's graphs at once. API keys and OAuth connections they hold on organisation graphs stop reaching anything from their next call. Data sources the member had connected personally stop syncing and the content they brought in is queued for removal.
| Status | code |
When |
|---|---|---|
| 403 | forbidden |
The caller may not remove this member. |
| 404 | not_found |
The target is not a member. |
| 409 | last_owner |
The target is the organisation's only owner. |
| 409 | service_account |
The target is a service account; delete it through its own route. |
10.5 Invites#
An invite is a single-use token bound to one email address. The server does not send it. The create call returns the token and a ready-made link, and the inviting admin delivers it by whatever channel they choose.
POST/v1/orgs/{orgId}/invites#
Creates an invite. Org admin. Only an owner may invite an admin.
| Body field | Type | Required | Meaning |
|---|---|---|---|
email |
string | yes | The address being invited. |
role |
string | no | admin, member (default) or guest. An owner cannot be invited; promote a member instead. |
groups |
array of group ids | no | Groups the new member receives on joining. An admin may list only groups they hold. |
curl -X POST https://graphlife.example.com/v1/orgs/$ORG_ID/invites \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","role":"member"}'
{
"inviteId": "a3f1…",
"token": "kV9…",
"url": "https://graphlife.example.com/app/#invite=kV9…"
}
token is shown only here. The invite expires after 7 days. url opens the server's built-in team page; it is built from PUBLIC_URL when set, otherwise from the request's host.
| Status | code |
When |
|---|---|---|
| 400 | invalid |
No @ in the address, an unknown role, or groups not an array. |
| 403 | forbidden |
The caller is not an admin, or an admin tried to invite an admin. |
| 409 | connector_group |
A listed group mirrors a data source's access list. |
| 409 | scope_exceeds_yours |
An admin listed a group they do not hold. |
GET/v1/orgs/{orgId}/invites#
Lists every invite of the organisation, newest first, including accepted, revoked and expired ones. Org admin. Not paginated.
{
"invites": [
{
"inviteId": "a3f1…",
"email": "[email protected]",
"role": "member",
"groups": [],
"createdAt": 1764201600,
"expiresAt": 1764806400,
"acceptedAt": null,
"revokedAt": null
}
]
}
DELETE/v1/orgs/{orgId}/invites/{inviteId}#
Revokes a pending invite. Org admin. Response: 200 OK with {"revoked": "<inviteId>"}. 404 not_found if the invite does not exist, was already accepted, or was already revoked.
POST/v1/orgs/invites/accept#
Accepts an invite as the signed-in account. Session. The account's email address must equal the invited address.
| Body field | Required |
|---|---|
token |
yes |
Response: 200 OK with {"orgId": "…", "role": "member"}.
| Status | code |
When |
|---|---|---|
| 400 | invalid |
token missing. |
| 403 | email_mismatch |
The invite was issued for a different address. |
| 404 | not_found |
Unknown token. |
| 409 | already_member |
The account already belongs to the organisation. |
| 410 | invite_gone |
The invite was accepted, revoked or has expired. |
An invite can also be accepted while creating an account: send it as orgInvite on POST /v1/accounts/signup, or sign in through SSO with the invited address (section 9.2).
10.6 Organisation graphs#
POST/v1/orgs/{orgId}/graphs#
Creates a new, empty organisation graph, or moves one of the caller's personal hosted graphs into the organisation. Org admin.
To create:
| Body field | Required | Meaning |
|---|---|---|
storage |
yes | Must be the string cloud_readable. It is an explicit acknowledgement that an organisation graph is stored readable by the server. |
label |
yes | 1 to 120 characters. |
Response: 200 OK with {"graphId": "…", "label": "…"}.
To move a personal graph in:
| Body field | Required | Meaning |
|---|---|---|
graphId |
yes | A personal hosted graph owned by the caller. |
Response: 200 OK with {"graphId": "…"}. Nodes that were in no group join the everyone group, the mover receives the graph's other groups, and existing keys and OAuth connections on the graph become bounded by their holder's role from then on. If the mover is not an owner of the organisation, server-side AI is switched off for the graph. The graph's earlier change history is discarded. Moving a graph into an organisation is allowed even when the organisation already holds 100 graphs. The move cannot be undone through the API.
| Status | code |
When |
|---|---|---|
| 400 | storage_required |
Create: storage is not cloud_readable. |
| 400 | bad_label |
Create: label empty or too long. |
| 403 | forbidden |
The caller is not an admin. |
| 403 | too_many_graphs |
Create: the organisation already has 100 graphs. |
| 404 | not_found |
Move: no such personal graph owned by the caller. |
| 409 | group_in_use |
Move: the graph contains a group id the organisation already uses. |
An organisation graph is removed with DELETE /v1/graphs/{graphId} (Org admin), described in graph data.
PATCH/v1/graphs/{graphId}#
Changes two access-related settings of a graph. Graph owner for a personal graph; Org owner for an organisation graph.
| Body field | Type | Meaning |
|---|---|---|
serverAi |
boolean | Allows or stops server-side AI features (extraction, semantic search, ask) from reading this graph and sending its content to the configured model provider. Off by default. |
pullMerge |
true |
Personal graphs only. Unlocks editing of the graph from the built-in browser client. Only true is accepted. |
Response: 200 OK with graphId and the fields that were set.
| Status | code |
When |
|---|---|---|
| 400 | invalid |
Neither field sent, a wrong type, or pullMerge on an organisation graph. |
| 403 | forbidden |
An organisation member who is not the owner. |
| 404 | not_found |
No such graph for the caller. |
10.7 Organisation model-provider key#
PUT/v1/orgs/{orgId}/secrets/anthropic#
Stores the organisation's own API key for the model provider used by the server-side AI features, so that usage is billed to the organisation. Org admin. The key is encrypted at rest and is write-only: no route returns it.
| Body field | Required |
|---|---|
key |
yes |
Response: 200 OK with {"status":"ok"}.
| Status | code |
When |
|---|---|---|
| 400 | invalid |
key missing or empty. |
| 403 | forbidden |
The caller is not an admin. |
| 503 | secrets_disabled |
The server has no SECRET_KEY configured, so it cannot store credentials. |
This feature is off unless the operator sets SECRET_KEY (a base64-encoded 32-byte key). There is no route to delete a stored key; it is removed when the organisation is deleted.