Validate feature import data
POST <your-unleash-url>/api/admin/features-batch/validate
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Validates a feature flag data set. Checks whether the data can be imported into the specified project and environment. The returned value is an object that contains errors, warnings, and permissions required to perform the import, as described in the import documentation.
Request
- application/json
Body
required
importTogglesSchema
- project string required
The exported project
- environment string required
The exported environment
data objectrequired
Responses
- 200
- 404
importTogglesValidateSchema
- application/json
- Schema
- Example (from schema)
Schema
errors object[]required
warnings object[]required
permissions object[]
{
"errors": [
{
"message": "You cannot import a feature that already exist in other projects. You already have the following features defined outside of project default:",
"affectedItems": [
"my-feature (in project project-854)"
]
}
],
"warnings": [
{
"message": "The following strategy types will be used in import. Please make sure the strategy type parameters are configured as in source environment:",
"affectedItems": [
"custom-strategy-7"
]
}
],
"permissions": []
}
The requested resource was not found.
- 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": "NotFoundError",
"message": "Could not find the addon with ID \"12345\"."
}
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Request
Request
curl / cURL
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
python / requests
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
go / native
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
nodejs / axios
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
ruby / Net::HTTP
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
csharp / RestSharp
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
php / cURL
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
java / OkHttp
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'
powershell / RestMethod
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"project": "My awesome project",
"environment": "development",
"data": {
"features": [
{
"name": "my-feature",
"description": "best feature ever",
"type": "release",
"project": "default",
"stale": false,
"impressionData": false,
"archived": false
}
],
"featureStrategies": [
{
"name": "flexibleRollout",
"id": "924974d7-8003-43ee-87eb-c5f887c06fd1",
"featureName": "my-feature",
"title": "Rollout 50%",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "random"
},
"constraints": [],
"disabled": false,
"segments": [
1
]
}
],
"featureEnvironments": [
{
"enabled": true,
"featureName": "my-feature",
"environment": "development",
"variants": [
{
"name": "a",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
},
{
"name": "b",
"weight": 500,
"overrides": [],
"stickiness": "random",
"weightType": "variable"
}
],
"name": "variant-testing"
}
],
"contextFields": [
{
"name": "appName",
"description": "Allows you to constrain on application name",
"stickiness": false,
"sortOrder": 2,
"legalValues": []
}
],
"featureTags": [
{
"featureName": "my-feature",
"tagType": "simple",
"tagValue": "user-facing"
}
],
"segments": [
{
"id": 1,
"name": "new-segment-name"
}
],
"tagTypes": [
{
"name": "simple",
"description": "Used to simplify filtering of features",
"icon": "#"
}
],
"dependencies": [
{
"feature": "child_feature",
"dependencies": [
{
"feature": "parent_feature",
"enabled": false,
"variants": [
"variantA",
"variantB"
]
}
]
}
]
}
}'