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"
  }
}

Changes

Changed in 11 of the 21 revisions of this API.14524

    • request body became required

      request-body-became-required

    • the request's body type/format changed from / to object/

      request-body-type-changed

    • the request property context became required

      request-property-became-required

    • the request property context/targetingKey became required

      request-property-became-required

    • the response's body type/format changed from / to object/ for status 400

      response-body-type-changed

    • the response's body type/format changed from / to object/ for status 404

      response-body-type-changed

    • the response's body type/format changed from / to object/ for status 500

      response-body-type-changed

    • the allOf[evaluationSuccess]/ response's property type/format changed from / to object/ for status 200

      response-property-type-changed

    • added subschema #1 subschema #2 to the allOf[evaluationSuccess]/ response property allOf list for the response status 200

      response-property-all-of-added

    • removed subschema #1 subschema #2 from the allOf[evaluationSuccess]/ response property allOf list for the response status 200

      response-property-all-of-removed

    • added codeDefaultFlag to the allOf[evaluationSuccess]/allOf[subschema #2]/ response property oneOf list for the response status 200

      response-property-one-of-added

    • removed subschema #2 from the response body allOf list for the response status 200

      response-body-all-of-removed

    • api operation id evaluateFlag was added

      api-operation-id-added

    • api tag OFREP Core added

      api-tag-added

    • api tag OFREP core removed

      api-tag-removed

  • d86062c9054c13See the full diff
    • the allOf[evaluationSuccess]/allOf[subschema #1]/metadata response's property type/format changed from object/ to / for status 200

      response-property-type-changed

    • added the optional property metadata to the response with the 400 status

      response-optional-property-added

    • added the optional property metadata to the response with the 404 status

      response-optional-property-added

    • added metadata flagMetadataDescription flagMetadataExamples to the allOf[evaluationSuccess]/allOf[subschema #1]/metadata response property allOf list for the response status 200

      response-property-all-of-added

    • added evaluationSuccess subschema #2 to the response body allOf list for the response status 200

      response-body-all-of-added

    • removed subschema #1 subschema #2 from the response body allOf list for the response status 200

      response-body-all-of-removed

    • added the new optional request property context/targetingKey

      new-optional-request-property

    • the optional response header Retry-Later removed for the status 429

      optional-response-header-removed

    • api tag OFREP core added

      api-tag-added

    • removed the DISABLED enum value from the allOf[subschema #1]/reason response property for the response status 200

      response-property-enum-value-removed

    • removed the SPLIT enum value from the allOf[subschema #1]/reason response property for the response status 200

      response-property-enum-value-removed

    • removed the STATIC enum value from the allOf[subschema #1]/reason response property for the response status 200

      response-property-enum-value-removed

    • removed the TARGETING_MATCH enum value from the allOf[subschema #1]/reason response property for the response status 200

      response-property-enum-value-removed

    • removed the UNKNOWN enum value from the allOf[subschema #1]/reason response property for the response status 200

      response-property-enum-value-removed