Skip to main content

Member Filters

Tags: filters, members, organization

Endpoints

Update Convert

PUT /api/v2/w/{workspace_uuid}/member-filters/{member_filter_id}/convert

Description:

Saved member filters and search criteria

Convert a legacy rules filter to a query-engine predicate. One-way.

Adapts the filter's legacy rules to a single IR predicate (adapt_member_rules), runs strict save-time validation, stores the normalized predicate on MemberFilter.query, and deletes the legacy rule rows — all in one transaction, so the filter is never left half converted. There is intentionally no reverse operation: once a filter is query-format the legacy rule editor no longer applies to it.

With dryRun=true the full validation chain runs (same 404/409/422/400 behavior) but nothing is persisted: the response carries the normalized predicate in query alongside the still-intact legacy rules so the client can preview the conversion reversibly.

Rules the LEGACY engine itself ignores (empty operands — e.g. name:partial with an empty query) adapt to nothing and are skipped silently; they never block conversion because skipping them preserves the matched member set exactly.

Error Responses:

  • 404 Not Found: Filter does not exist
  • 409 Conflict: Filter already has a query predicate (already converted, or authored in the Query builder)
  • 422 Unprocessable Entity: Filter has no rules, or every rule is a legacy no-op so there is no predicate to store (detail lists objectType:filterType pairs — structure only, never rule values)
  • 400 Bad Request: Adapted predicate fails engine save-time validation (mapped by the global domain exception handlers)

Authorization: Requires members:write scope

Parameters:

  • member_filter_id (Integer)
  • dryRun (Annotated[bool, Query()])

Response: See MemberFilterResponse