v1

latestOpenAPI 3.1.0Apache-2.02026-07-1722527.1 KB
OFREP Core

Evaluate A Single Feature Flag

Evaluates a single feature flag by its key. This endpoint is used by server-side providers for dynamic context evaluation, where each evaluation request includes the evaluation context.

The endpoint returns the evaluated flag value along with metadata including the evaluation reason, variant, and any flag-specific metadata. The flag value can be one of several types: boolean, string, integer, float, object, or a code default (indicating the provider should use the code default value).

Use Case: Server-side applications where evaluation context may change between requests and real-time targeting decisions are required.

post/ofrep/v1/evaluate/flags/{key}

Path parameters

keystring required

The unique identifier (key) of the feature flag

Request body

Example request

{
  "context": {
    "targetingKey": "user-123",
    "email": "user@example.com",
    "plan": "premium",
    "country": "CA"
  }
}

Response

Successful flag evaluation. Returns the evaluated flag value with metadata.

OR
OR
OR
OR
OR

Example response

{
  "key": "discount-banner",
  "metadata": {
    "team": "ecommerce",
    "businessPurpose": "experiment",
    "owner": "product-team"
  }
}
All 2 operations