---
title: "Evaluate A Single Feature Flag"
method: POST
path: "/ofrep/v1/evaluate/flags/{key}"
tags: ["OFREP Core"]
---

# Evaluate A Single Feature Flag

`POST /ofrep/v1/evaluate/flags/{key}`

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.

## Path parameters

- `key` string, required

## Request body

- EvaluationRequest — Request body for single feature flag evaluation. Contains the evaluation context that will be used to evaluate the feature flag.
  - `context` Context, required — Evaluation context containing information used to evaluate feature flags. The context includes a `targetingKey` (required) along with additional properties such as user attributes, session data, or request metadata that can be used for targeting rules.
    - `targetingKey` string, required

## Response `200`

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

- union
  - object — A boolean typed flag value. Used for simple on/off feature flags.
    - `key` string, required — The unique identifier (key) of the feature flag. This is used to reference a specific flag in the flag management system.
    - `reason` 'STATIC' | 'TARGETING_MATCH' | 'SPLIT' | 'DISABLED' | 'UNKNOWN', required — An OpenFeature reason code indicating why the flag was evaluated to this value. See https://openfeature.dev/specification/types/#resolution-reason for reason code definitions.
    - `variant` string — Variant identifier for the evaluated feature flag value. Represents a specific variation or configuration of the feature flag.
    - `metadata` object — Example metadata structure for flags
    - `value` boolean, required
  - object — A string typed flag value.
    - `key` string, required — The unique identifier (key) of the feature flag. This is used to reference a specific flag in the flag management system.
    - `reason` 'STATIC' | 'TARGETING_MATCH' | 'SPLIT' | 'DISABLED' | 'UNKNOWN', required — An OpenFeature reason code indicating why the flag was evaluated to this value. See https://openfeature.dev/specification/types/#resolution-reason for reason code definitions.
    - `variant` string — Variant identifier for the evaluated feature flag value. Represents a specific variation or configuration of the feature flag.
    - `metadata` object — Example metadata structure for flags
    - `value` string, required
  - object — An integer typed flag value.
    - `key` string, required — The unique identifier (key) of the feature flag. This is used to reference a specific flag in the flag management system.
    - `reason` 'STATIC' | 'TARGETING_MATCH' | 'SPLIT' | 'DISABLED' | 'UNKNOWN', required — An OpenFeature reason code indicating why the flag was evaluated to this value. See https://openfeature.dev/specification/types/#resolution-reason for reason code definitions.
    - `variant` string — Variant identifier for the evaluated feature flag value. Represents a specific variation or configuration of the feature flag.
    - `metadata` object — Example metadata structure for flags
    - `value` integer, required
  - object — A float typed flag value.
    - `key` string, required — The unique identifier (key) of the feature flag. This is used to reference a specific flag in the flag management system.
    - `reason` 'STATIC' | 'TARGETING_MATCH' | 'SPLIT' | 'DISABLED' | 'UNKNOWN', required — An OpenFeature reason code indicating why the flag was evaluated to this value. See https://openfeature.dev/specification/types/#resolution-reason for reason code definitions.
    - `variant` string — Variant identifier for the evaluated feature flag value. Represents a specific variation or configuration of the feature flag.
    - `metadata` object — Example metadata structure for flags
    - `value` number, float, required
  - object — An object typed flag value.
    - `key` string, required — The unique identifier (key) of the feature flag. This is used to reference a specific flag in the flag management system.
    - `reason` 'STATIC' | 'TARGETING_MATCH' | 'SPLIT' | 'DISABLED' | 'UNKNOWN', required — An OpenFeature reason code indicating why the flag was evaluated to this value. See https://openfeature.dev/specification/types/#resolution-reason for reason code definitions.
    - `variant` string — Variant identifier for the evaluated feature flag value. Represents a specific variation or configuration of the feature flag.
    - `metadata` object — Example metadata structure for flags
    - `value` object, required
  - object — A flag evaluation that defers to the code default value. When a flag evaluation returns this type, it indicates that the provider should use the default value specified in the application code rather than a value from the flag management system. **Note**: This schema has no `value` property. The provider must use the code default value when processing this response.
    - `key` string, required — The unique identifier (key) of the feature flag. This is used to reference a specific flag in the flag management system.
    - `reason` 'STATIC' | 'TARGETING_MATCH' | 'SPLIT' | 'DISABLED' | 'UNKNOWN', required — An OpenFeature reason code indicating why the flag was evaluated to this value. See https://openfeature.dev/specification/types/#resolution-reason for reason code definitions.
    - `variant` string — Variant identifier for the evaluated feature flag value. Represents a specific variation or configuration of the feature flag.
    - `metadata` object — Example metadata structure for flags

## Other responses

- `400` — Bad evaluation request. The request is malformed or contains invalid context.
- `401` — Unauthorized. Authentication credentials are missing, invalid, or expired.
- `403` — Forbidden. The client does not have permission to access the requested resource.
- `404` — Flag not found. The specified flag key does not exist in the flag management system.
- `429` — Too Many Requests. Rate limit has been exceeded.
- `500` — Internal Server Error. An unexpected error occurred on the server that prevented flag evaluation.

## Changes

- **2025-11-07** `a43d06a57adb` — 8 breaking, 2 info
  - request body became required
  - the request's body type/format changed from ``/`` to `object`/``
  - the request property `context` became required
  - the request property `context/targetingKey` became required
  - …6 more
- **2025-08-21** `ace2bf25318d` — 1 breaking
  - added `#/components/schemas/codeDefaultFlag` to the `allOf[#/components/schemas/evaluationSuccess]/allOf[subschema #2]/` response property `oneOf` list for the response status `200`
- **2025-06-02** `6e3caed39fa7` — 1 info
  - removed `subschema #2` from the response body `allOf` list for the response status `200`
- **2025-02-07** `113e9501a7dc` — 3 info
  - api operation id `evaluateFlag` was added
  - api tag `OFREP Core` added
  - api tag `OFREP core` removed
- **2025-01-31** `d86062c9054c` — 1 breaking, 3 info
  - the `allOf[#/components/schemas/evaluationSuccess]/allOf[subschema #1]/metadata` response's property type/format changed from `object`/`` to ``/`` for status `200`
  - added the optional property `metadata` to the response with the `400` status
  - added the optional property `metadata` to the response with the `404` status
  - added `#/components/schemas/metadata, #/components/schemas/flagMetadataDescription, #/components/schemas/flagMetadataExamples` to the `allOf[#/components/schemas/evaluationSuccess]/allOf[subschema #1]/metadata` response property `allOf` list for the response status `200`

[Full history](https://skmtc.dev/open-feature/apis/openfeature-remote-evaluation-protocol-ofrep/changes/ofrep/v1/evaluate/flags/:key/post.md)

---

[API](https://skmtc.dev/open-feature/apis/openfeature-remote-evaluation-protocol-ofrep.md) · [All operations](https://skmtc.dev/open-feature/apis/openfeature-remote-evaluation-protocol-ofrep/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/open-feature/openfeature-remote-evaluation-protocol-ofrep/revisions/e5f560c5194c/schema)
