API ReferenceOpenFeature (OFREP)
Evaluate Flags
Single and bulk flag evaluation via the OFREP API.
Evaluate Flags
Single Flag Evaluation
POST /api/ofrep/v1/evaluate/flags/{flagKey}
Authorization: Bearer ksh_xxx
Content-Type: application/jsonRequest Body
{
"context": {
"tenantSlug": "sakura-tokyo",
"orderCount": 42,
"region": "us-east"
}
}Response
{
"key": "delivery-tracking-enabled",
"value": true,
"variant": "on",
"reason": "TARGETING_MATCH",
"metadata": {}
}Evaluation Reasons
| Reason | Description |
|---|---|
DEFAULT | No targeting rule matched, default variant returned |
TARGETING_MATCH | A targeting rule matched |
DISABLED | Flag is disabled |
ERROR | Evaluation error (flag not found, invalid context) |
Bulk Evaluation
Evaluate all flags at once:
POST /api/ofrep/v1/evaluate/flags
Authorization: Bearer ksh_xxx
Content-Type: application/jsonRequest Body
{
"context": {
"tenantSlug": "sakura-tokyo"
}
}Response
{
"flags": [
{
"key": "delivery-tracking-enabled",
"value": true,
"variant": "on",
"reason": "TARGETING_MATCH"
},
{
"key": "analytics-dashboard-enabled",
"value": false,
"variant": "off",
"reason": "DEFAULT"
}
]
}Context Variables
You can pass any key-value pair in the context object. Common variables:
| Variable | Description |
|---|---|
tenantSlug | The instance slug — used for per-tenant targeting |
orderCount | A numeric metric — used for threshold-based targeting |
region | Geographic region — used for geographic targeting |
userId | End user identifier — used for user-level targeting |
CEL targeting rules reference these variables directly: tenantSlug == "sakura-tokyo" && orderCount > 10

