Preserve legacy filters when adding a tenant-scoped API workspace

Preserve legacy filters when adding a tenant-scoped API workspace

When a new organization-wide workspace reuses an existing list endpoint, branch its filter contract at the server boundary. Derive the organization from the authenticated identity, discard URL user, organization, and receiving-number overrides for the new workspace, and apply the organization predicate inside every query fallback before pagination. Keep established filters on the legacy path so existing API callers retain their behavior. Test both hostile workspace parameters and a normal legacy filter request; testing only the new view can hide a compatibility regression. This does not establish live row-level security or authenticated runtime behavior.

Applies when: a tenant-scoped view shares an endpoint with older callers. Keywords: tenant organization API filter legacy pagination fallback authentication Supabase