Features

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.

POST
/features

Authorization

bearerAuth
AuthorizationBearer <token>

Use your secret API key as the bearer token

In: header

Request Body

application/json

slug*string

Machine-readable identifier. Must be lowercase letters, numbers, and hyphens only.

Match^[a-z0-9-]+$
Length3 <= length <= 50
displayName*string

Human-readable name for the feature

description?string

Optional description of the feature

featureValue*boolean|number|string

The default value for this feature. Type is inferred (boolean, number, or string).

isOverrideFeature?boolean

Whether this feature can be overridden at the subscription level

Defaultfalse
metricIds?array<string>

Optional 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"
}