Evaluate an Unleash context against a set of environments and projects.
POST <your-unleash-url>/api/admin/playground
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
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
- environment string required
The environment to evaluate toggles in.
projects object
context objectrequired
- 200
- 400
- 401
playgroundResponseSchema
- application/json
- Schema
- Example (from schema)
Schema
input objectrequired
features object[]required
{
"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
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"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
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"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."
}
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Request
Request
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'
curl -L -X POST '<your-unleash-url>/api/admin/playground' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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"
}
}'