Features API
The Features API allows you to create, manage, and configure features that can be attached to subscription plans. Features define the capabilities and limits of your plans.
Overview
Features are reusable components that can be associated with multiple plans. Each feature has a type (boolean, number, or string) and a value, which determines the entitlement for that feature.
Authentication
All API requests require authentication via merchant credentials.
Endpoints
List all Features
Retrieves a list of all features for the authenticated merchant, with optional text search.
GET https://api.getlumen.dev/v1/features?search={searchText}
Query Parameters
Parameter | Type | Description |
---|---|---|
search | string | A search string to filter features by slug or display name. |
Response
{
"features": [
{
"id": "feat_123",
"slug": "api-calls",
"displayName": "API Calls",
"featureType": "number",
"featureValue": "1000"
}
]
}
Get a Specific Feature
Retrieves a single feature by its ID, including any associated metric IDs.
GET https://api.getlumen.dev/v1/features/{featureId}
Parameters
Parameter | Type | Description |
---|---|---|
featureId | string | The ID of the feature. |
Create a Feature
Creates a new feature.
POST https://api.getlumen.dev/v1/features
Request Body
{
"slug": "new-feature",
"displayName": "New Feature",
"featureValue": true,
"metricIds": ["metric_123"]
}
Update a Feature
Updates an existing feature.
PUT https://api.getlumen.dev/v1/features/{featureId}
Delete a Feature
Soft deletes a feature and all its references in plans and subscriptions.
DELETE https://api.getlumen.dev/v1/features/{featureId}
Check Slug Availability
Checks if a feature slug is already in use for the merchant.
POST https://api.getlumen.dev/v1/features/checkSlug
Request Body
{
"slug": "feature-slug-to-check"
}
Response
{
"conflict": false
}