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
- application/json
Body
required
playgroundRequestSchema
- MOD1
- MOD2
Array [
]
The environment to evaluate toggles in.
developmentprojects
object
A list of projects to check for toggles in.
oneOf
A list of projects to check for toggles in.
string
Check toggles in all projects.
string
Possible values: [*]
context
object
required
The Unleash context as modeled in client SDKs
The name of the application.
Possible values: non-empty
My cool application.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.
2022-07-05T12:56:41+02:00The environment the app is running in.
properties
object
Additional Unleash context properties
The app's IP address
192.168.1.1An identifier for the current session
b65e7b23-fec0-4814-a129-0e9861ef18fcAn identifier for the current user
username@provider.comThe Unleash context as modeled in client SDKs
Responses
- 200
- 400
- 401
playgroundResponseSchema
- application/json
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
Array [
]
Array [
- MOD1
- MOD2
Array [
- MOD1
- MOD2
- MOD1
- MOD2
Array [
Array [
]
]
Array [
Array [
]
]
Array [
]
]
Array [
Array [
]
]
]
input
object
required
The given input used to evaluate the features.
The environment to evaluate toggles in.
developmentprojects
object
A list of projects to check for toggles in.
oneOf
A list of projects to check for toggles in.
string
Check toggles in all projects.
string
Possible values: [*]
context
object
required
The Unleash context as modeled in client SDKs
The name of the application.
Possible values: non-empty
My cool application.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.
2022-07-05T12:56:41+02:00The environment the app is running in.
properties
object
Additional Unleash context properties
The app's IP address
192.168.1.1An identifier for the current session
b65e7b23-fec0-4814-a129-0e9861ef18fcAn identifier for the current user
username@provider.comThe Unleash context as modeled in client SDKs
features
object[]
required
The list of features that have been evaluated.
The feature's name.
my-featureThe ID of the project that contains this feature.
my-projectstrategies
object
required
The feature's applicable strategies and cumulative results of the strategies
result
object
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.
anyOf
boolean
string
Possible values: [unknown]
data
object[]
required
The strategies that apply to this feature.
The strategy's name.
Description of the feature's purpose.
Beta rolloutThe strategy's id.
3AECCF7E-FF82-4174-8287-8EBE06079A50result
object
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
anyOf
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.
Possible values: [incomplete, unevaluated]
enabled
object
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.
anyOf
boolean
Possible values: [false]
string
Possible values: [unknown]
Signals that this strategy was evaluated successfully.
Possible values: [complete]
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.
The variant's name. If there is no variant or if the toggle is disabled, this will be disabled
red-variantWhether 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.
The format of the payload.
Possible values: [json, csv, string, number]
The payload value stringified.
{"property": "value"}variants
object[]
The feature variants.
The variants name. Is unique for this feature flag
blue_groupThe 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 for more information
Possible values: <= 1000
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
Possible values: [variable, fix]
variableStickiness is how Unleash guarantees that the same user gets the same variant every time
custom.context.fieldpayload
object
Extra data configured for this variant
The type of the value. Commonly used types are string, number, json and csv.
Possible values: [json, csv, string, number]
The actual value of payload
overrides
object[]
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.
The name of the context field used to determine overrides
userIdWhich values that should be overriden
["red","blue"]The strategy's status. Disabled strategies are not evaluated
falsesegments
object[]
required
The strategy's segments and their evaluation results.
The segment's id.
The name of the segment.
segment AWhether this was evaluated as true or false.
constraints
object[]
required
The list of constraints in this segment.
The name of the context field that this constraint should apply to.
appNameThe operator to use when evaluating this constraint. For more information about the various operators, refer to the strategy constraint operator documentation.
Possible values: [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]
INWhether the operator should be case sensitive or not. Defaults to false (being case sensitive).
falseWhether the result should be negated or not. If true, will turn a true result into a false result and vice versa.
falseThe context values that should be used for constraint evaluation. Use this property instead of value for properties that accept multiple values.
["my-app","my-other-app"]The context value that should be used for constraint evaluation. Use this property instead of values for properties that only accept single values.
my-appWhether this was evaluated as true or false.
constraints
object[]
required
The strategy's constraints and their evaluation results.
The name of the context field that this constraint should apply to.
appNameThe operator to use when evaluating this constraint. For more information about the various operators, refer to the strategy constraint operator documentation.
Possible values: [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]
INWhether the operator should be case sensitive or not. Defaults to false (being case sensitive).
falseWhether the result should be negated or not. If true, will turn a true result into a false result and vice versa.
falseThe context values that should be used for constraint evaluation. Use this property instead of value for properties that accept multiple values.
["my-app","my-other-app"]The context value that should be used for constraint evaluation. Use this property instead of values for properties that only accept single values.
my-appWhether this was evaluated as true or false.
parameters
object
required
The strategy's constraints and their evaluation results.
links
object
required
A set of links to actions you can perform on this strategy
/projects/some-project/features/some-feature/strategies/edit?environmentId=some-env&strategyId= 3AECCF7E-FF82-4174-8287-8EBE06079A50Whether the feature has a parent dependency that is not satisfied
Whether the feature is active and would be evaluated in the provided environment in a normal SDK context.
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.
truevariant
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.
The variant's name. If there is no variant or if the flag is disabled, this will be disabled
red-variantWhether 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.
The format of the payload.
The payload value stringified.
{"property": "value"}Use featureEnabled instead.
trueWhether the feature is enabled or not.
truevariants
object[]
required
The feature variants.
The variants name. Is unique for this feature flag
blue_groupThe 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 for more information
Possible values: <= 1000
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
Possible values: [variable, fix]
variableStickiness is how Unleash guarantees that the same user gets the same variant every time
custom.context.fieldpayload
object
Extra data configured for this variant
The type of the value. Commonly used types are string, number, json and csv.
Possible values: [json, csv, string, number]
The actual value of payload
overrides
object[]
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.
The name of the context field used to determine overrides
userIdWhich values that should be overriden
["red","blue"]{
"input": {
"environment": "development",
"projects": [
"my-project"
],
"context": {
"appName": "My cool application.",
"currentTime": "2022-07-05T12:56:41+02:00",
"properties": {
"customContextField": "this is one!",
"otherCustomField": "3"
},
"remoteAddress": "192.168.1.1",
"sessionId": "b65e7b23-fec0-4814-a129-0e9861ef18fc",
"userId": "username@provider.com"
}
},
"features": [
{
"name": "my-feature",
"projectId": "my-project",
"strategies": {
"result": true,
"data": [
{
"name": "string",
"title": "Beta rollout",
"id": "3AECCF7E-FF82-4174-8287-8EBE06079A50",
"result": {},
"disabled": false,
"segments": [
{
"id": 0,
"name": "segment A",
"result": true,
"constraints": [
{
"contextName": "appName",
"operator": "IN",
"caseInsensitive": false,
"inverted": false,
"values": [
"my-app",
"my-other-app"
],
"value": "my-app",
"result": true
}
]
}
],
"constraints": [
{
"contextName": "appName",
"operator": "IN",
"caseInsensitive": false,
"inverted": false,
"values": [
"my-app",
"my-other-app"
],
"value": "my-app",
"result": true
}
],
"parameters": {
"myParam1": "param value"
},
"links": {
"edit": "/projects/some-project/features/some-feature/strategies/edit?environmentId=some-env&strategyId= 3AECCF7E-FF82-4174-8287-8EBE06079A50"
}
}
]
},
"hasUnsatisfiedDependency": true,
"isEnabledInCurrentEnvironment": true,
"isEnabled": true,
"variant": {
"name": "green",
"enabled": true
},
"variants": [
{
"name": "blue_group",
"weight": 0,
"weightType": "variable",
"stickiness": "custom.context.field",
"payload": {
"type": "json",
"value": "{\"color\": \"red\"}"
},
"overrides": [
{
"contextName": "userId",
"values": [
"red",
"blue"
]
}
]
}
]
}
]
}
The request data does not match what we expect.
- application/json
- Schema
- Example (from schema)
Schema
The ID of the error instance
9c40958a-daac-400e-98fb-3bb438567008The name of the error kind
ValidationErrorA description of what went wrong.
The request payload you provided doesn't conform to the schema. The .parameters property should be object. You sent [].{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "ValidationError",
"message": "The request payload you provided doesn't conform to the schema. The .parameters property should be object. You sent []."
}
Authorization information is missing or invalid. Provide a valid API token as the authorization header, e.g. authorization:*.*.my-admin-token.
- application/json
- Schema
- Example (from schema)
Schema
The ID of the error instance
9c40958a-daac-400e-98fb-3bb438567008The name of the error kind
AuthenticationRequiredA description of what went wrong.
You must log in to use Unleash. Your request had no authorization header, so we could not authorize you. Try logging in at /auth/simple/login.{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "AuthenticationRequired",
"message": "You must log in to use Unleash. Your request had no authorization header, so we could not authorize you. Try logging in at /auth/simple/login."
}