Request Body
Human-readable name for the feature (e.g., “API Access”, “Advanced Analytics”)
Unique identifier for API lookups (e.g., “api_access”, “advanced_analytics”)Must be unique within the environment. Used for programmatic access.
Type of featureValues:
BOOLEAN: Simple on/off feature flag
METERED: Usage-based feature with consumption tracking
STATIC: Feature with a fixed configuration value
Detailed description of what this feature provides
ID of an existing meter to use for METERED featuresEither meter_id or meter must be provided for METERED features.
Meter configuration for METERED features (alternative to meter_id)
Event type to track (e.g., “api_call”, “storage_gb”)
How to aggregate usageValues: SUM, COUNT, MAX, UNIQUE_COUNT
Field to aggregate (required for SUM and MAX)
Singular unit name (e.g., “API call”, “GB”)Both unit_singular and unit_plural must be provided together.
Plural unit name (e.g., “API calls”, “GBs”)Both unit_singular and unit_plural must be provided together.
Alert configuration for usage thresholdsShow Alert settings object
Type of thresholdValues: PERCENTAGE, ABSOLUTE
Threshold value that triggers alerts
Custom metadata as key-value pairs
Response
Unique identifier for the feature
Lookup key for programmatic access
Feature type (BOOLEAN, METERED, or STATIC)
ID of the associated meter (for METERED features)
Full meter object (if expanded)
Timestamp when feature was created
Timestamp when feature was last updated
curl -X POST "https://api.flexprice.io/v1/features" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Advanced Analytics",
"lookup_key": "advanced_analytics",
"type": "BOOLEAN",
"description": "Access to advanced analytics dashboard"
}'
{
"id": "feat_abc123",
"name": "API Calls",
"lookup_key": "api_calls",
"type": "METERED",
"description": "REST API access with usage tracking",
"meter_id": "meter_xyz789",
"unit_singular": "API call",
"unit_plural": "API calls",
"metadata": {},
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}
Feature Types Explained
BOOLEAN
Simple on/off feature flags. Used for access control without usage tracking.Examples:
- Premium support
- Advanced analytics
- Custom branding
METERED
Usage-based features that track consumption. Requires a meter for tracking.Examples:
- API calls
- Storage (GB)
- Monthly active users
STATIC
Features with fixed configuration values (e.g., “5 team members”, “10GB storage”).Examples:
- User seats
- Storage limits
- Project count
Creating Features with Meters
For METERED features, you have two options:
Option 1: Use Existing Meter
Reference a meter you’ve already created:{
"name": "API Calls",
"type": "METERED",
"meter_id": "meter_xyz789"
}
Option 2: Create Meter Inline
Define the meter configuration in the same request:{
"name": "API Calls",
"type": "METERED",
"meter": {
"name": "API Call Counter",
"event_type": "api_call",
"aggregation": "COUNT"
}
}
FlexPrice will create the meter automatically.
After Creating a Feature
Once you’ve created a feature, you can:
- Add to plans: Include the feature in your plan entitlements
- Check access: Use the Check Access endpoint to gate features
- Track usage: Send events to meter usage for METERED features
- Set limits: Configure usage limits via entitlements