Workflow
Feature flag evaluate API
Resolves a feature flag by walking ordered JsonLogic targeting rules against a context and returning the first matching value, else the default, with which rule served it. Answers 'Is this flag on for this user?', 'Which flag variant should I serve?'.
Price$0.02per request
MethodPOST
Route/v1/workflow/feature-flag
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
feature-flagflagtargetingrollouttogglejsonlogicexperimentworkflow
API URL
Integration docshttps://x402.hexl.dev/v1/workflow/feature-flagExample request
{
"flagKey": "new-ui",
"rules": [
{
"when": {
"==": [
{
"var": "plan"
},
"pro"
]
},
"value": true
}
],
"default": false,
"context": {
"plan": "pro"
}
}Example response
{
"flagKey": "new-ui",
"value": true,
"matchedRule": 0,
"usedDefault": false,
"interpretation": "Flag 'new-ui' served by rule 0 -> true."
}Input schema
{
"type": "object",
"required": [
"flagKey",
"default"
],
"properties": {
"flagKey": {
"type": "string",
"examples": [
"new-ui"
]
},
"rules": {
"type": "array",
"examples": [
[
{
"when": {
"==": [
{
"var": "plan"
},
"pro"
]
},
"value": true
}
]
]
},
"default": {
"examples": [
false
]
},
"context": {
"type": "object",
"examples": [
{
"plan": "pro"
}
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}