Projects
Set environment-default strategy
Sets a default strategy for this environment. Unleash will use this strategy by default when enabling a feature flag. Use the wild card "*" for :environment to add to all environments.
post/api/admin/projects/{projectId}/environments/{environment}/default-strategy
Path parameters
projectIdstring required
environmentstring required
Request body
Example request
{
"name": "flexibleRollout",
"title": "Gradual Rollout 25-Prod",
"sortOrder": 9999,
"constraints": [
{
"values": [
"1",
"2"
],
"inverted": false,
"operator": "IN",
"contextName": "appName",
"caseInsensitive": false
}
],
"variants": [
{
"name": "blue_group",
"weightType": "fix",
"stickiness": "custom.context.field",
"payload": {
"type": "json",
"value": "{\"color\": \"red\"}"
}
}
],
"segments": [
1,
2
]
}Response
createFeatureStrategySchema
Example response
{
"name": "flexibleRollout",
"title": "Gradual Rollout 25-Prod",
"sortOrder": 9999,
"constraints": [
{
"values": [
"1",
"2"
],
"inverted": false,
"operator": "IN",
"contextName": "appName",
"caseInsensitive": false
}
],
"variants": [
{
"name": "blue_group",
"weightType": "fix",
"stickiness": "custom.context.field",
"payload": {
"type": "json",
"value": "{\"color\": \"red\"}"
}
}
],
"segments": [
1,
2
]
}