graphlife Docs graphlife.app

Accounts and access

1. Conventions

Topic Behaviour
Transport The server speaks plain HTTP on the port given by PORT (default 8080). TLS is expected to be terminated by a reverse proxy or load balancer in front of it.
Request bodies JSON objects (Content-Type: application/json), except the OAuth token and revocation endpoints and the browser forms, which are application/x-www-form-urlencoded. An empty body is read as {}.
Response bodies JSON, with Content-Type: application/json and X-Content-Type-Options: nosniff, unless a route says otherwise (HTML pages, CSV, ZIP archives, 204 No Content).
Timestamps Integers, Unix time in seconds, unless a field says otherwise.
Identifiers Account, organisation, key, invite and graph identifiers created by the server are 32 hexadecimal digits grouped 8-4-4-4-12. Graph identifiers supplied by a client must match ^[A-Za-z0-9_-]{1,64}$.
Field naming Field names are not uniform across the API. The login, token, share-grant and inbox-token routes use snake_case (access_token, refresh_token, device_id); the organisation, key and OAuth-grant management routes use camelCase (orgId, keyId, graphIds). Some account routes mix the two: sign-up takes orgInvite, the password change takes currentPassword and newPassword, and the SSO device flow takes pollSecret and deviceId while returning access_token and refresh_token. Each route below lists its exact field names.
Path prefix Most routes live under /v1. The OAuth protocol endpoints (/oauth/*, /.well-known/*), /health and /legal/* are not under /v1.
Unknown routes A path that matches no route, or a known path with an unsupported method, answers 404 not_found. There are three exceptions. GET or DELETE on /v1/live/mcp answers 405 method_not_allowed. Any path under /v1/orgs answers 401 unauthorized when the request carries no valid session, and 404 not_found when the caller is not a member of the organisation named in the path, before the rest of the path is examined. While SSO is off, any path under /v1/sso/ and /v1/accounts/identities answers 404 sso_disabled (section 9).
"Not yours" and "not there" A resource that exists but that the caller may not reach generally answers 404 not_found, the same as a resource that does not exist. 403 forbidden is used when the caller is a member of the organisation concerned but lacks the required role.
DELETE with a body Three DELETE routes read a JSON body: DELETE /v1/accounts/me, DELETE /v1/accounts/identities and DELETE /v1/orgs/{orgId}. Make sure your HTTP client and any proxy in front of the server forward a body on DELETE.
Cross-origin requests The server sends no CORS headers. Browser code on another origin cannot call the API directly.