Evaluate single flag
Evaluate a single feature flag for the given context
Path Parameters
Flag key to evaluate
Header Parameters
API key for authentication
Request Body
application/json
Evaluation request with context
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://loading/ofrep/v1/evaluate/flags/string" \ -H "X-API-Key: string" \ -H "Content-Type: application/json" \ -d '{ "context": { "targetingKey": "string" } }'{
"key": "string",
"value": null,
"reason": "string",
"variant": "string",
"metadata": {
"property1": null,
"property2": null
}
}{
"key": "string",
"errorCode": "string",
"errorDetails": "string"
}{
"key": "string",
"errorCode": "string",
"errorDetails": "string"
}{
"errorCode": "string",
"errorDetails": "string"
}Evaluate all flags
Evaluate all feature flags for the given context. ## ETag Caching This endpoint supports ETag-based caching to reduce bandwidth and improve performance for polling clients. ### How it works 1. **First request**: Call without `If-None-Match` header. Response includes an `ETag` header. 2. **Subsequent requests**: Include the `If-None-Match` header with the previous `ETag` value. 3. **If flags unchanged**: Server returns `304 Not Modified` with no body. 4. **If flags changed**: Server returns `200 OK` with new flag values and a new `ETag`. ### Example flow ``` # First request POST /ofrep/v1/evaluate/flags X-API-Key: your-api-key Response: 200 OK ETag: "abc123" { "flags": [...] } # Subsequent request with ETag POST /ofrep/v1/evaluate/flags X-API-Key: your-api-key If-None-Match: "abc123" Response: 304 Not Modified (no body) ``` ### When to use Use ETag caching when polling for flag updates. For real-time updates, consider using the SSE endpoint at `/api/v1/flags/events` instead.
Targeting & Segments Guide
Practical targeting strategies for rollouts