Accounts and access
11. Organisation administration
11.1 Audit trail#
GET/v1/orgs/{orgId}/audit#
Returns the organisation's audit events, newest first. Org admin.
| Query parameter | Default | Meaning |
|---|---|---|
limit |
100 | 1 to 500. |
before |
(none) | Return only events with an id lower than this. Use the previous page's next. |
event |
(none) | Exact event name to filter on. |
user |
(none) | Account id to filter on. |
format |
json |
json or csv. |
curl "https://graphlife.example.com/v1/orgs/$ORG_ID/audit?limit=200" \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"events": [
{
"id": 1842,
"at": 1764288000,
"event": "org.member.update",
"actor": "session",
"userId": "0b6f…",
"email": "[email protected]",
"grantId": null,
"detail": "{\"userId\":\"7c21…\",\"role\":\"admin\"}",
"keyId": null
}
],
"next": 1642
}
keyId names the API key an event was written by or about, and is null otherwise. next is the id to pass as before for the following page, or null when the page was not full. detail is a string; for some events it holds JSON, for others a plain value. Events hold metadata only, never graph content.
With format=csv the response is text/csv; charset=utf-8 with the header row id,at,event,actor,userId,email,grantId,detail (no keyId column) and CRLF line endings. Values that begin with =, +, -, @, tab or carriage return are prefixed with an apostrophe so that spreadsheets do not treat them as formulas. The CSV response has no next value; page with before using the lowest id received.
There is no filter by time range. 400 bad_format for any other format; 403 forbidden for a member or guest.
Events recorded against an organisation in this area include:
| Event | Recorded when |
|---|---|
org.created |
The organisation is created. |
org.member.join |
An invite is accepted. |
org.member.update |
A member's role, groups or write group change. |
org.member.remove |
A member is removed or leaves. |
org.invite.created, org.invite.revoked |
|
org.graph.add, org.graph.move |
A graph is created in, or moved into, the organisation. |
graph_unpublished |
An organisation graph is removed. |
graph.server_ai |
Server-side AI is switched on or off for a graph (detail is on or off). |
live_key_created, live_key_revoked |
An API key on an organisation graph is minted or revoked. |
live_key_updated, live_key_rotated |
An API key on an organisation graph is edited or given a new secret. |
org.service_account.created, org.service_account.updated, org.service_account.deleted |
A service account is created, renamed or switched on or off, or deleted. |
org.secret.set |
The model-provider key is stored. |
org.retention |
The audit retention is changed. |
org.exported |
The organisation is exported. |
Events from the graph and connector areas also appear here and are described with those areas. Account-level events such as login, login_fail, password_changed and sso.signin are recorded against the account, not the organisation: they appear in that person's own GET /v1/activity and account export, and not in the organisation's audit trail. An org admin therefore cannot see members' sign-ins through the API.
Some security events are recorded with no account and no organisation, and no API route returns them; they can be read only in the server's database. These are refused SSO sign-ins (sso.refused) and failed sign-ins on the OAuth consent page (oauth.signin_fail). A login attempt for an address that has no account is not recorded at all. The deletion of an organisation (org.deleted) is recorded against the deleting account only.
When a member's account is deleted, their events in the organisation's trail are kept with userId cleared and actor set to deleted_member.
11.2 Audit retention#
GET/v1/orgs/{orgId}/retention#
Org admin.
{ "auditDays": 365, "defaultDays": null }
| Field | Meaning |
|---|---|
auditDays |
The organisation's own setting, or null if it uses the server default. |
defaultDays |
The server-wide default from AUDIT_RETENTION_DAYS, or null if the server keeps audit events indefinitely. |
PUT/v1/orgs/{orgId}/retention#
Org admin.
| Body field | Type | Meaning |
|---|---|---|
auditDays |
integer or null |
30 to 3650, or null to return to the server default. The field must be present. |
Response: the same shape as the GET. 400 bad_audit_days if the field is missing or out of range.
Retention is applied by an hourly sweep. It covers the organisation's audit events and the per-node change records of its graphs. With neither an organisation setting nor a server default, events are kept indefinitely. The server default (AUDIT_RETENTION_DAYS) also applies to account-level audit events, which have no setting of their own.
11.3 Organisation export#
POST/v1/orgs/{orgId}/export#
Returns a ZIP archive of the organisation. Org owner, with re-authentication.
| Body field | Required |
|---|---|
password |
for password accounts |
curl -X POST https://graphlife.example.com/v1/orgs/$ORG_ID/export \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d "{\"password\":\"$DERIVED\"}" -o org-export.zip
Response: 200 OK, Content-Type: application/zip, Content-Disposition: attachment; filename="org-<orgId>.zip".
| Archive entry | Contents |
|---|---|
manifest.json |
format (graphlife.export), version (1), generated_at, subject, the graphs with node and edge counts, and notes. |
graphs/<graphId>.json |
Each organisation graph as a JSON snapshot. |
documents/<graphId>/<docId>-<name> |
Files attached to exported nodes. |
audit.ndjson |
The organisation's full audit trail, one JSON object per line. |
members.json |
user_id, email and role of each member. |
Two categories of content are deliberately left out: content that came from a member's personally connected data source (for example their own mailbox), and nodes that belong to no group.
The archive is built on the server's disk and streamed; the request stays open for as long as that takes. There is no asynchronous export job and no rate limit on this route.
| Status | code |
When |
|---|---|---|
| 401 | unauthorized |
Re-authentication failed. |
| 403 | forbidden |
The caller is not the owner. |