API ReferenceFlag Evaluation APIOFREP

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.

POST
/ofrep/v1/evaluate/flags

Request Body

application/jsonRequired

Evaluation request with context

contextRequiredEvaluationContext

Header Parameters

X-API-KeyRequiredstring

API key for authentication

If-None-Matchstring

ETag from a previous response. If the flag configuration hasn't changed, the server returns 304 Not Modified.

curl -X POST "https://example.com/ofrep/v1/evaluate/flags" \
  -H "X-API-Key: <string>" \
  -H "If-None-Match: <string>" \
  -H "Content-Type: application/json" \
  -d '{
    "context": {
      "targetingKey": "string",
      "properties": {
        "property1": null,
        "property2": null
      }
    }
  }'

{
  "flags": [
    {
      "result": {
        "key": "string",
        "errorCode": "string",
        "errorDetails": "string"
      }
    }
  ],
  "metadata": {
    "property1": null,
    "property2": null
  }
}