OpenFeature Remote Evaluation Protocol (OFREP) (0.2.0)
Download OpenAPI specification:Download
The OpenFeature Remote Evaluation Protocol (OFREP) is an API specification for feature flagging that enables vendor-agnostic communication between applications and flag management systems.
OFREP defines a standard API layer between OpenFeature providers and flag management systems, allowing any flag management system to implement the protocol and be compatible with community-maintained providers.
For more information, see the OFREP documentation.
Required: Core APIs to implement to support OFREP.
This is the minimum set of APIs required for a flag management system to be OFREP compatible.
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.
Authorizations:
path Parameters
| key required | string Example: discount-banner The unique identifier (key) of the feature flag |
Request Body schema: application/jsonrequired
Evaluation request containing the context for flag evaluation
required | object (context) Evaluation context containing information used to evaluate feature flags. The context
includes a | ||||
| |||||
Responses
Request samples
- Payload
{- "context": {
- "targetingKey": "user-123",
- "email": "user@example.com",
- "custom-plan": "premium",
- "country": "CA"
}
}Response samples
- 200
- 400
- 404
- 500
{- "key": "discount-banner",
- "value": true,
- "reason": "TARGETING_MATCH",
- "variant": "enabled"
}Bulk Evaluate All Feature Flags
Evaluates all feature flags in a single request using a static context. This endpoint is used by client-side providers for static context evaluation, where all flags are evaluated once and then cached locally for subsequent use.
The endpoint returns an array of all flag evaluations, where each flag can be either a
successful evaluation or an evaluation failure. The response includes an ETag header for
cache validation, allowing clients to use the If-None-Match header to avoid unnecessary
re-evaluation when flags haven't changed.
Authorizations:
header Parameters
| If-None-Match | string Example: "abc123xyz" Optional ETag value from a previous bulk evaluation response. If provided and the ETag matches the current flag set, the server will return a 304 Not Modified response, indicating that flags haven't changed since the last evaluation. |
Request Body schema: application/jsonrequired
required | object (context) Evaluation context containing information used to evaluate feature flags. The context
includes a | ||||
| |||||
Responses
Request samples
- Payload
{- "context": {
- "targetingKey": "user-456",
- "email": "user@example.com",
- "plan": "free",
- "country": "CA"
}
}Response samples
- 200
- 400
- 500
{- "flags": [
- {
- "key": "discount-banner",
- "value": true,
- "reason": "TARGETING_MATCH",
- "variant": "enabled"
}, - {
- "key": "theme-color",
- "value": "blue",
- "reason": "STATIC",
- "variant": "default"
}, - {
- "key": "non-existent-flag",
- "errorCode": "FLAG_NOT_FOUND",
- "errorDetails": "Flag 'non-existent-flag' was not found"
}
], - "metadata": {
- "version": "v12"
}
}