Endpoints split into sharer-side (you own the ontology and grant access) and
recipient-side (an ontology has been shared with you). Recipient-side
endpoints additionally rely on your Supabase session, sent via the
X-Supabase-Token header, so row-level security scopes the results to you.Sharer-side
Share an ontology
Grant another user access to one of your ontologies. Identify the recipient bysub, by email, or by username together with organization.
List shares (outbox)
Return every share you have created, most recent first. Optionally filter to a single ontology.data is an array of share objects (share_id, project_id, share_role,
status, recipient identity, and timestamps).
Update a share’s role
Change a share betweenviewer and editor in place — the recipient is not
forced to re-accept. Updating to the role it already has is a no-op that returns
data.changed = false.
Revoke a share
Revoke access you previously granted. Pass either ashare_id, or a
project_id together with a recipient_sub. Revoking is idempotent.
Recipient-side
List inbox
Return every share currently visible to you as a recipient — pending invitations and already-accepted shares. Each entry is annotated withhas_local_token so you can tell “accepted on this workspace” from “accepted
elsewhere”.
data is an array of inbox entries (share_id, project_id, share_role,
status, has_local_token, sharer identity, and timestamps).
Accept a share
Claim a pending share. The scoped token is vaulted into your workspace so you can open the shared ontology. Idempotent for shares already accepted on this workspace.Leave a share
Detach yourself from a share you previously accepted (or a pending one). This removes the local token and marks the shareleft. Idempotent.
Sync inbox
Reconcile your locally-vaulted shares against the source of truth. Local entries whose share is no longeraccepted (revoked, superseded, left, or missing) are
pruned. Use this as a safety net to catch up after a missed real-time update.

