Skip to content

Check Feature Flag

GET
/api/v1/features/{flag}
curl --request GET \
--url https://indepai.app/api/v1/features/example \
--header 'Authorization: Bearer <token>'

Check if a specific feature flag is enabled for the current user

flag
required

Feature flag key

string

Feature flag status

Media typeapplication/json
object
success
required
boolean
data
required
object
key
required

Feature flag key

string
enabled
required

Whether the feature is enabled for this user

boolean
reason
required

Reason for the flag value

string
Allowed values: default targeting override disabled rollout
variant

Variant value (for multivariate flags)

string
meta
required
object
timestamp
required

Timestamp in ISO 8601 format

string format: date-time
Example
{
"success": true,
"data": {
"enabled": true,
"reason": "default"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z"
}
}

Unauthorized

Media typeapplication/json
object
success
required

Always false for error responses

boolean
error
required

Error type

string
code

Machine-readable error code

string
details

Detailed validation errors

Array<object>
object
path
required

Path to the invalid field

string
message
required

Error message

string
Example
{
"success": false,
"error": "Validation error",
"code": "VALIDATION_ERROR",
"details": [
{
"path": "currentAge",
"message": "Must be between 18 and 100"
}
]
}

Feature flag not found

Media typeapplication/json
object
success
required

Always false for error responses

boolean
error
required

Error type

string
code

Machine-readable error code

string
details

Detailed validation errors

Array<object>
object
path
required

Path to the invalid field

string
message
required

Error message

string
Example
{
"success": false,
"error": "Validation error",
"code": "VALIDATION_ERROR",
"details": [
{
"path": "currentAge",
"message": "Must be between 18 and 100"
}
]
}