Projects
Set environment-default strategy
Changed onSets 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
Request
- Base URLhttps://app.unleash-instance.example.com
- URLhttps://app.unleash-instance.example.com/api/admin/projects/{projectId}/environments/{environment}/default-strategy
- Auth
- API key in header Authorization
- or HTTP bearer
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
]
}Changes
- breaking
the
//request property's minLength was increased from0to1 - warning
added the new
SEMVER_GTEenum value to the//response property for the response status - warning
added the new
SEMVER_LTEenum value to the//response property for the response status - info
added the new
SEMVER_GTEenum value to the request property// - info
added the new
SEMVER_LTEenum value to the request property//
- breaking
- warning
added the new
REGEXenum value to the//response property for the response status - info
added the new
REGEXenum value to the request property//
- warning