fluidsoul

Configuring Rules

Define dimensions, signals, and thresholds to classify users for your app.

Configuring Rules

Each workspace has a rules config — a JSON object that tells fluidsoul how to classify users. You can read and update it via the API.

API endpoints

GET  /v1/workspace/config    # Read current config
PUT  /v1/workspace/config    # Update config (replaces entire config)

Both require authentication (Bearer token + X-Workspace-Id header).

Full schema

{
  "dimensions": [
    {
      "name": "user_role",
      "values": ["analyst", "executive", "developer"],
      "default_value": "new_user",
      "hybrid_value": "hybrid"
    }
  ],
  "signals": [
    {
      "dimension": "user_role",
      "value": "analyst",
      "conditions": [
        { "field": "event_type", "equals": "report_viewed" },
        { "field": "metadata.role", "equals": "analyst" }
      ]
    },
    {
      "dimension": "user_role",
      "value": "executive",
      "conditions": [
        { "field": "event_type", "equals": "summary_viewed" },
        { "field": "metadata.role", "equals": "executive" }
      ]
    }
  ],
  "thresholds": {
    "dominant_ratio": 0.7
  },
  "feature_defaults": {
    "analyst": ["reports", "analytics", "data_export"],
    "executive": ["summary", "kpis", "reports"]
  },
  "recommended_defaults": {
    "analyst": {
      "default_view": "reports",
      "default_period": "weekly"
    },
    "executive": {
      "default_view": "summary",
      "default_period": "monthly"
    }
  },
  "engagement_thresholds": {
    "high": 15,
    "moderate": 5
  },
  "maturity_thresholds": {
    "power_user_breadth": 5,
    "power_user_days": 30,
    "intermediate_breadth": 3,
    "intermediate_days": 14
  }
}

Dimensions

A dimension is a classification axis. The first dimension is the primary one used for user_category and preferred_mode.

FieldTypeDescription
namestringDimension name (e.g. "user_role")
valuesstring[]Possible values (e.g. ["analyst", "executive"])
default_valuestringValue when no signals match (default: "new_user")
hybrid_valuestringValue when no clear dominant (default: "hybrid")

Signals

Signals map events to dimension values. A signal matches if any of its conditions match.

FieldTypeDescription
dimensionstringWhich dimension this signal feeds
valuestringWhich value to increment when matched
conditionsarrayList of conditions (OR logic)

Conditions

Each condition checks a single field:

FieldTypeDescription
fieldstring"event_type" or "metadata.<key>"
equalsstringValue to match against

Thresholds

FieldTypeDefaultDescription
dominant_rationumber0.7Ratio required for a clear classification

If the dominant value's ratio is below this threshold, the user is classified as the hybrid_value.

Feature defaults

A map from dimension value → ordered list of features. These are appended to the frequency-based priorities.

A map from dimension value → object of default settings. Returned as recommended_defaults in the context.

Engagement thresholds

FieldTypeDefaultDescription
highnumber15Events in last 30 days for "high" engagement
moderatenumber5Events in last 30 days for "moderate" engagement

Maturity thresholds

FieldTypeDefaultDescription
power_user_breadthnumber5Unique event types for power user
power_user_daysnumber30Days active for power user
intermediate_breadthnumber3Unique event types for intermediate
intermediate_daysnumber14Days active for intermediate

Empty config

If your workspace has an empty config ({}), fluidsoul falls back to a generic mode:

  • No dimension-based classification
  • user_category is set to "active_user"
  • Feature priorities are based on event type frequency only
  • Engagement and maturity still work with default thresholds

Example: update config via curl

curl -X PUT https://api.fluidsoul.dev/v1/workspace/config \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-Id: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "dimensions": [{
      "name": "user_type",
      "values": ["power_seller", "casual_buyer"],
      "default_value": "new_user",
      "hybrid_value": "mixed"
    }],
    "signals": [{
      "dimension": "user_type",
      "value": "power_seller",
      "conditions": [
        { "field": "event_type", "equals": "listing_created" },
        { "field": "metadata.role", "equals": "seller" }
      ]
    }],
    "thresholds": { "dominant_ratio": 0.6 },
    "feature_defaults": {
      "power_seller": ["listings", "analytics", "shipping"],
      "casual_buyer": ["search", "wishlist", "orders"]
    },
    "recommended_defaults": {
      "power_seller": { "default_view": "seller_dashboard" },
      "casual_buyer": { "default_view": "browse" }
    }
  }'

On this page