Skip to content

GET /v1/organizations/{id}/members 500s — core.organization_members does not exist #655

Closed

Description

@thinkclay

Reproduce

GET /v1/organizations/{id}/members
{"error":"Failed to fetch members","message":"Could not find the table 'core.organization_members' in the schema cache"}

routes/organizations.ts:101. Verified against a live local stack with a real org id.

There is no such table anywhere

select table_schema||'.'||table_name from information_schema.tables
where table_name = 'organization_members';
-- (0 rows)

The nearest things are core.team_members and community.memberships, neither of which is org membership.

Organization membership in this schema is core.role_assignments.scope_org_id — that is what lib/org-access.ts uses (added in #617) and what /{id}/location-visibility and /{id}/projects-with-overrides have always used. The members route is the odd one out.

public.organization_members is referenced too, at office-users.ts:174 — see the delete-cascade issue.

Acceptance

  • GET /v1/organizations/{id}/members returns 200, listing members from core.role_assignments joined to core.users
  • The caller is gated with canReadOrgInternals from lib/org-access.ts rather than a fourth inline copy of the predicate
  • A test asserts a non-member cannot list another org's members

Found by the runtime sweep behind #651.

Activity

  1. added
    bug
    agent-ready
    on Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions