Create Feature
Create a new feature definition. The featureType is automatically derived from the featureValue type (boolean, number, or string). Slugs must be unique per merchant and contain only lowercase letters, numbers, and hyphens. Optionally attach metrics to the feature for usage tracking.
Authorization
bearerAuth Use your secret API key as the bearer token
In: header
Request Body
application/json
Machine-readable identifier. Must be lowercase letters, numbers, and hyphens only.
^[a-z0-9-]+$3 <= length <= 50Human-readable name for the feature
Optional description of the feature
The default value for this feature. Type is inferred (boolean, number, or string).
Whether this feature can be overridden at the subscription level
falseOptional list of metric IDs to attach to this feature for usage tracking
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.getlumen.dev/v1/features" \ -H "Content-Type: application/json" \ -d '{ "slug": "api-access", "displayName": "API Access", "description": "Access to the REST API", "featureValue": true, "isOverrideFeature": false }'{
"feature": {
"id": "feat_Lo4xGg1Yk9pB2eWv3sNtA",
"merchantId": "mer_abc123def456ghi789jkl",
"slug": "api-access",
"displayName": "API Access",
"description": "Access to the REST API",
"featureType": "boolean",
"featureValue": true,
"isOverrideFeature": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"deletedAt": null
},
"metricIds": []
}{
"error": "Slug must contain only lowercase letters, numbers, and hyphens"
}{
"error": "Feature with this slug already exists"
}{
"error": "Failed to create feature"
}