Export feature flags from an environment
POST <your-unleash-url>/api/admin/features-batch/export
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Exports all features listed in the features
property from the environment specified in the request body. If set to true
, the downloadFile
property will let you download a file with the exported data. Otherwise, the export data is returned directly as JSON. Refer to the documentation for more information about Unleash's export functionality.
Request
- application/json
Body
required
exportQuerySchema
- MOD1
- MOD2
- MOD3
- environment string required
The environment to export from
- downloadFile boolean
Whether to return a downloadable file
- features string[] required
Possible values:
non-empty
Selects features to export by name. If the list is empty all features are returned.
- environment string required
The environment to export from
- downloadFile boolean
Whether to return a downloadable file
- tag string required
Selects features to export by tag.
- environment string required
The environment to export from
- downloadFile boolean
Whether to return a downloadable file
- project string required
Selects project to export the features from. Used when no tags or features are provided.
- 200
- 404
exportResultSchema
- application/json
- Schema
- Example (from schema)
Schema
features object[]required
featureStrategies object[]required
featureEnvironments object[]
contextFields object[]
featureTags object[]
segments object[]
tagTypes object[]required
dependencies object[]
{
"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"
]
}
]
}
]
}
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 -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'
curl -L -X POST '<your-unleash-url>/api/admin/features-batch/export' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"environment": "development",
"downloadFile": true,
"features": [
"MyAwesomeFeature"
]
}'