> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluxrate.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Switch Features

> Boolean feature flags to enable or disable capabilities per plan tier.

Switch features are simple **on/off flags** that let you gate capabilities based on a customer's plan. Unlike meter features, they don't track usage — they simply indicate whether a customer has access to something.

## Use Cases

* Enable/disable specific dashboard sections
* Grant access to advanced exports, priority support, or SSO
* Control access to beta features for higher-tier plans
* Toggle API rate limit overrides

## Creating a Switch Feature

<Tabs>
  <Tab title="Dashboard">
    1. Go to **Features** in the sidebar
    2. Click **Add Feature**
    3. Select **Switch** as the type
    4. Enter a name and `lookup_key`
    5. Click **Create**
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://api.fluxrate.co/api/v1/features \
      -H "Content-Type: application/json" \
      -H "Cookie: access_token=<token>" \
      -d '{
        "name": "Advanced Analytics",
        "lookup_key": "advanced_analytics",
        "description": "Access to advanced analytics dashboard and exports",
        "type": "switch"
      }'
    ```
  </Tab>
</Tabs>

## Attaching to a Plan

```bash theme={null}
# Enable for a higher-tier plan
curl -X POST https://api.fluxrate.co/api/v1/plans/<plan_id>/features \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "feature_id": "<feature_id>",
    "is_enabled": true
  }'

# Explicitly disabled for a starter plan
curl -X POST https://api.fluxrate.co/api/v1/plans/<starter_plan_id>/features \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "feature_id": "<feature_id>",
    "is_enabled": false
  }'
```

## Checking a Feature in Your App

Query the customer's subscription to check if a switch feature is enabled:

```bash theme={null}
GET /api/v1/subscriptions/<subscription_id>
```

The response includes the plan's feature entitlements. Check `is_enabled` for switch features.

<Note>
  Switch features are the simplest way to implement plan-based feature gating. Combine them with meter features for a complete entitlement model.
</Note>
