Skip to main content
Internal documentation for developers. This page covers organization management endpoints, membership operations, and settings management. Not intended for end users.

Route Map


Auth Pattern

Organization endpoints use standard withPermissionRoute. Most org-level write operations require org.manage or admin-tier permissions. Org isolation is enforced at the session level: req.session.organization.id is the active org. Cross-org access is blocked by the permission layer.

Current Organization

The current endpoint is a lightweight helper used by the frontend to get the active org without knowing its ID upfront:

Invitation Flow

Invitation tokens are short-lived (72 hours by default). After expiry, the invitee must be re-invited.

Org Settings (PATCH)

The PATCH /api/organizations/[id] endpoint accepts:

Known Issues / Gotchas

  • Organization deletion is a destructive operation that cascades to ALL org resources (agents, contacts, conversations, datastores). Protected by a confirmation step in the UI. Backend must verify the DELETE is intentional.
  • current endpoint must be invalidated/re-fetched after update-org (auth session switch).
  • Multi-org users see multiple orgs in the org selector. The GET /api/organizations list is scoped to memberships where status='active'.