---
title: "Evaluate an Unleash context against a set of environments and projects."
method: POST
path: "/api/admin/playground"
tags: ["Playground"]
---

# Evaluate an Unleash context against a set of environments and projects.

`POST /api/admin/playground`

Deprecated. Will be removed in the next Unleash major update. Use the provided `context`, `environment`, and `projects` to evaluate toggles on this Unleash instance. Returns a list of all toggles that match the parameters and what they evaluate to. The response also contains the input parameters that were provided.

## Request body

- PlaygroundRequestSchema — Data for the playground API to evaluate feature flags
  - `environment` string, required — The environment to evaluate feature flags in.
  - `projects` union — A list of projects to check for feature flags in.
    - string[] — A list of projects to check for feature flags in.
    - '*' — Check feature flags in all projects.
  - `context` SdkContextSchema, required — The Unleash context as modeled in client SDKs
    - `appName` string, required — The name of the application.
    - `currentTime` string, date-time — A DateTime (or similar) data class instance or a string in an RFC3339-compatible format. Defaults to the current time if not set by the user.
    - `environment` string — The environment the app is running in.
    - `properties` object — Additional Unleash context properties
    - `remoteAddress` string — The app's IP address
    - `sessionId` string — An identifier for the current session
    - `userId` string — An identifier for the current user

## Response `200`

playgroundResponseSchema

- PlaygroundResponseSchema — The state of all features given the provided input.
  - `input` PlaygroundRequestSchema, required — Data for the playground API to evaluate feature flags
    - `environment` string, required — The environment to evaluate feature flags in.
    - `projects` union — A list of projects to check for feature flags in.
      - string[] — A list of projects to check for feature flags in.
      - '*' — Check feature flags in all projects.
    - `context` SdkContextSchema, required — The Unleash context as modeled in client SDKs
      - `appName` string, required — The name of the application.
      - `currentTime` string, date-time — A DateTime (or similar) data class instance or a string in an RFC3339-compatible format. Defaults to the current time if not set by the user.
      - `environment` string — The environment the app is running in.
      - `properties` object — Additional Unleash context properties
      - `remoteAddress` string — The app's IP address
      - `sessionId` string — An identifier for the current session
      - `userId` string — An identifier for the current user
  - `features` PlaygroundFeatureSchema[], required — The list of features that have been evaluated.
    - `name` string, required — The feature's name.
    - `projectId` string, required — The ID of the project that contains this feature.
    - `strategies` object, required — The feature's applicable strategies and cumulative results of the strategies
      - `result` union, required — The cumulative results of all the feature's strategies. Can be `true`, `false`, or `unknown`. This property will only be `unknown` if one or more of the strategies can't be fully evaluated and the rest of the strategies all resolve to `false`.
        - boolean
        - 'unknown'
      - `data` PlaygroundStrategySchema[], required — The strategies that apply to this feature.
        - `name` string, required — The strategy's name.
        - `title` string — Description of the feature's purpose.
        - `id` string, required — The strategy's id.
        - `result` union, required — The strategy's evaluation result. If the strategy is a custom strategy that Unleash can't evaluate, `evaluationStatus` will be `unknown`. Otherwise, it will be `true` or `false`
          - object
            - `evaluationStatus` 'incomplete' | 'unevaluated', required — Signals that this strategy could not be evaluated. This is most likely because you're using a custom strategy that Unleash doesn't know about. The `unevaluated` result is also returned if the strategy is disabled.
            - `enabled` union, required — Whether this strategy resolves to `false` or if it might resolve to `true`. Because Unleash can't evaluate the strategy, it can't say for certain whether it will be `true`, but if you have failing constraints or segments, it _can_ determine that your strategy would be `false`.
              - …
          - object
            - `evaluationStatus` 'complete', required — Signals that this strategy was evaluated successfully.
            - `enabled` boolean, required — Whether this strategy evaluates to true or not.
            - `variant` object, nullable — The feature variant you receive based on the provided context or the _disabled variant_. If a feature is disabled or doesn't have any variants, you would get the _disabled variant_. Otherwise, you'll get one of the feature's defined variants.
              - …
            - `variants` VariantSchema[] — The feature variants.
              - …
        - `disabled` boolean, nullable, required — The strategy's status. Disabled strategies are not evaluated
        - `segments` PlaygroundSegmentSchema[], required — The strategy's segments and their evaluation results.
          - `id` integer, required — The segment's id.
          - `name` string, required — The name of the segment.
          - `result` boolean, required — Whether this was evaluated as true or false.
          - `constraints` PlaygroundConstraintSchema[], required — The list of constraints in this segment.
            - `contextName` string, required — The name of the context field that this constraint should apply to.
            - `operator` 'NOT_IN' | 'IN' | 'STR_ENDS_WITH' | 'STR_STARTS_WITH' | 'STR_CONTAINS' | 'NUM_EQ' | 'NUM_GT' | 'NUM_GTE' | 'NUM_LT' | 'NUM_LTE' | 'DATE_AFTER' | 'DATE_BEFORE' | 'SEMVER_EQ' | 'SEMVER_GT' | 'SEMVER_LT' | 'SEMVER_GTE' | 'SEMVER_LTE' | 'REGEX', required — The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/concepts/activation-strategies#constraint-operators).
            - `caseInsensitive` boolean — Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).
            - `inverted` boolean — Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.
            - `values` string[] — The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.
            - `value` string — The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.
            - `result` boolean, required — Whether this was evaluated as true or false.
        - `constraints` PlaygroundConstraintSchema[], required — The strategy's constraints and their evaluation results.
          - `contextName` string, required — The name of the context field that this constraint should apply to.
          - `operator` 'NOT_IN' | 'IN' | 'STR_ENDS_WITH' | 'STR_STARTS_WITH' | 'STR_CONTAINS' | 'NUM_EQ' | 'NUM_GT' | 'NUM_GTE' | 'NUM_LT' | 'NUM_LTE' | 'DATE_AFTER' | 'DATE_BEFORE' | 'SEMVER_EQ' | 'SEMVER_GT' | 'SEMVER_LT' | 'SEMVER_GTE' | 'SEMVER_LTE' | 'REGEX', required — The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/concepts/activation-strategies#constraint-operators).
          - `caseInsensitive` boolean — Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).
          - `inverted` boolean — Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.
          - `values` string[] — The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.
          - `value` string — The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.
          - `result` boolean, required — Whether this was evaluated as true or false.
        - `parameters` ParametersSchema, required — A list of parameters for a strategy
        - `links` object, required — A set of links to actions you can perform on this strategy
          - `edit` string, required
    - `hasUnsatisfiedDependency` boolean — Whether the feature has a parent dependency that is not satisfied
    - `isEnabledInCurrentEnvironment` boolean, required — Whether the feature is active and would be evaluated in the provided environment in a normal SDK context.
    - `isEnabled` boolean, required — Whether this feature is enabled or not in the current environment. If a feature can't be fully evaluated (that is, `strategies.result` is `unknown`), this will be `false` to align with how client SDKs treat unresolved feature states.
    - `variant` object, nullable, required — The feature variant you receive based on the provided context or the _disabled variant_. If a feature is disabled or doesn't have any variants, you would get the _disabled variant_. Otherwise, you'll get one of thefeature's defined variants.
      - `name` string, required — The variant's name. If there is no variant or if the flag is disabled, this will be `disabled`
      - `enabled` boolean, required — Whether the variant is enabled or not. If the feature is disabled or if it doesn't have variants, this property will be `false`
      - `payload` object — An optional payload attached to the variant.
        - `type` string, required — The format of the payload.
        - `value` string, required — The payload value stringified.
      - `feature_enabled` boolean — Use `featureEnabled` instead.
      - `featureEnabled` boolean — Whether the feature is enabled or not.
    - `variants` VariantSchema[], required — The feature variants.
      - `name` string, required — The variants name. Is unique for this feature flag
      - `weight` number, required — The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information
      - `weightType` 'variable' | 'fix' — Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000
      - `stickiness` string — [Stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time
      - `payload` object — Extra data configured for this variant
        - `type` 'json' | 'csv' | 'string' | 'number', required — The type of the value. Commonly used types are string, number, json and csv.
        - `value` string, required — The actual value of payload
      - `overrides` OverrideSchema[] — Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence.
        - `contextName` string, required — The name of the context field used to determine overrides
        - `values` string[], required — Which values that should be overriden

## Other responses

- `400` — The request data does not match what we expect.
- `401` — Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`.

---

[API](https://skmtc.net/unleash/apis/unleash-api-3.md) · [All operations](https://skmtc.net/unleash/apis/unleash-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unleash/unleash-api-3/revisions/b2c3116e633e/schema)
