Create/Add change to a change request
POST/api/admin/projects/:projectId/environments/:environment/change-requests
Given a change request exists, this endpoint will attempt to add a change to an existing change request for the user. If a change request does not exist. It will attempt to create it.
Request
Path Parameters
- application/json
Body
required
changeRequestOneOrManyCreateSchema
- MOD1
- MOD2
- MOD3
- MOD4
- MOD5
- MOD6
- MOD7
- MOD8
- MOD9
- MOD10
- MOD11
- MOD12
Array [
]
Array [
]
Array [
Array [
]
]
Array [
]
Array [
- MOD1
- MOD2
- MOD3
- MOD4
- MOD5
- MOD6
- MOD7
- MOD8
- MOD9
- MOD10
- MOD11
Array [
]
Array [
]
Array [
Array [
]
]
Array [
]
]
oneOf
The name of this action.
Possible values: [updateSegment
]
payload
object
required
Data used to create or update a segment
The ID of the segment to update.
1
The name of this action.
Possible values: [deleteSegment
]
payload
object
required
Required data to delete a segment.
The ID of the segment to delete.
1
Update the enabled state for a feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [updateEnabled
]
payload
object
required
The new state of the feature.
true
Only relevant when ALL the strategies are disabled. If true
, all the disabled strategies will be enabled. If false
, the default strategy will be added
true
Add a strategy to the feature
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [addStrategy
]
payload
object
required
Create a strategy configuration in a feature
The name of the strategy type
flexibleRollout
A descriptive title for the strategy
Gradual Rollout 25-Prod
A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs
false
The order of the strategy in the list
9999
constraints
object[]
required
A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/strategy-constraints
The name of the context field that this constraint should apply to.
appName
The operator to use when evaluating this constraint. For more information about the various operators, refer to the strategy constraint operator documentation.
Possible values: [NOT_IN
, IN
, STR_ENDS_WITH
, STR_STARTS_WITH
, STR_CONTAINS
, NUM_EQ
, NUM_GT
, NUM_GTE
, NUM_LT
, NUM_LTE
, DATE_AFTER
, DATE_BEFORE
, SEMVER_EQ
, SEMVER_GT
, SEMVER_LT
]
IN
Whether the operator should be case sensitive or not. Defaults to false
(being case sensitive).
false
Whether the result should be negated or not. If true
, will turn a true
result into a false
result and vice versa.
false
The context values that should be used for constraint evaluation. Use this property instead of value
for properties that accept multiple values.
["my-app","my-other-app"]
The context value that should be used for constraint evaluation. Use this property instead of values
for properties that only accept single values.
my-app
variants
object[]
Strategy level variants
The variant name. Must be unique for this feature flag
blue_group
The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on variant weights for more information
Possible values: <= 1000
Set to fix
if this variant must have exactly the weight allocated to it. If the type is variable
, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the variant weight documentation.
Possible values: [variable
, fix
]
fix
The stickiness to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time
custom.context.field
payload
object
Extra data configured for this variant
The type of the value. Commonly used types are string, number, json and csv.
Possible values: [json
, csv
, string
, number
]
The actual value of payload
parameters
object
required
A list of parameters for a strategy
Ids of segments to use for this strategy
[1,2]
Update a strategy belonging to this feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [updateStrategy
]
payload
object
required
Update a strategy configuration in a feature
The ID of the strategy to update.
0103487d-8788-4cda-af59-0a68642dbc5a
Delete a strategy from this feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [deleteStrategy
]
payload
object
required
The ID of the strategy to update.
0103487d-8788-4cda-af59-0a68642dbc5a
Archive a feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [archiveFeature
]
Update variants for this feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [patchVariant
]
payload
object
required
variants
object[]
required
The variants name. Is unique for this feature flag
blue_group
The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on variant weights for more information
Possible values: <= 1000
Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000
Possible values: [variable
, fix
]
variable
Stickiness is how Unleash guarantees that the same user gets the same variant every time
custom.context.field
payload
object
Extra data configured for this variant
The type of the value. Commonly used types are string, number, json and csv.
Possible values: [json
, csv
, string
, number
]
The actual value of payload
overrides
object[]
Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence.
The name of the context field used to determine overrides
userId
Which values that should be overriden
["red","blue"]
Reorder strategies for this feature
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [reorderStrategy
]
payload
object[]
required
An array of strategies with their new sort order
The ID of the strategy
9c40958a-daac-400e-98fb-3bb438567008
The new sort order of the strategy
1
Add a parent feature dependency.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [addDependency
]
payload
object
required
Feature dependency on a parent feature in write model
The name of the feature we depend on.
parent_feature
Whether the parent feature should be enabled. When false
variants are ignored. true
by default.
false
The list of variants the parent feature should resolve to. Leave empty when you only want to check the enabled
status.
["variantA","variantB"]
Remove a parent feature dependency or all dependencies if no payload.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [deleteDependency
]
oneOf
The name of this action.
Possible values: [updateSegment
]
payload
object
required
Data used to create or update a segment
The ID of the segment to update.
1
The name of this action.
Possible values: [deleteSegment
]
payload
object
required
Required data to delete a segment.
The ID of the segment to delete.
1
Update the enabled state for a feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [updateEnabled
]
payload
object
required
The new state of the feature.
true
Only relevant when ALL the strategies are disabled. If true
, all the disabled strategies will be enabled. If false
, the default strategy will be added
true
Add a strategy to the feature
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [addStrategy
]
payload
object
required
Create a strategy configuration in a feature
The name of the strategy type
flexibleRollout
A descriptive title for the strategy
Gradual Rollout 25-Prod
A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs
false
The order of the strategy in the list
9999
constraints
object[]
required
A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/strategy-constraints
The name of the context field that this constraint should apply to.
appName
The operator to use when evaluating this constraint. For more information about the various operators, refer to the strategy constraint operator documentation.
Possible values: [NOT_IN
, IN
, STR_ENDS_WITH
, STR_STARTS_WITH
, STR_CONTAINS
, NUM_EQ
, NUM_GT
, NUM_GTE
, NUM_LT
, NUM_LTE
, DATE_AFTER
, DATE_BEFORE
, SEMVER_EQ
, SEMVER_GT
, SEMVER_LT
]
IN
Whether the operator should be case sensitive or not. Defaults to false
(being case sensitive).
false
Whether the result should be negated or not. If true
, will turn a true
result into a false
result and vice versa.
false
The context values that should be used for constraint evaluation. Use this property instead of value
for properties that accept multiple values.
["my-app","my-other-app"]
The context value that should be used for constraint evaluation. Use this property instead of values
for properties that only accept single values.
my-app
variants
object[]
Strategy level variants
The variant name. Must be unique for this feature flag
blue_group
The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on variant weights for more information
Possible values: <= 1000
Set to fix
if this variant must have exactly the weight allocated to it. If the type is variable
, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the variant weight documentation.
Possible values: [variable
, fix
]
fix
The stickiness to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time
custom.context.field
payload
object
Extra data configured for this variant
The type of the value. Commonly used types are string, number, json and csv.
Possible values: [json
, csv
, string
, number
]
The actual value of payload
parameters
object
required
A list of parameters for a strategy
Ids of segments to use for this strategy
[1,2]
Update a strategy belonging to this feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [updateStrategy
]
payload
object
required
Update a strategy configuration in a feature
The ID of the strategy to update.
0103487d-8788-4cda-af59-0a68642dbc5a
Delete a strategy from this feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [deleteStrategy
]
payload
object
required
The ID of the strategy to update.
0103487d-8788-4cda-af59-0a68642dbc5a
Archive a feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [archiveFeature
]
Update variants for this feature.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [patchVariant
]
payload
object
required
variants
object[]
required
The variants name. Is unique for this feature flag
blue_group
The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on variant weights for more information
Possible values: <= 1000
Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000
Possible values: [variable
, fix
]
variable
Stickiness is how Unleash guarantees that the same user gets the same variant every time
custom.context.field
payload
object
Extra data configured for this variant
The type of the value. Commonly used types are string, number, json and csv.
Possible values: [json
, csv
, string
, number
]
The actual value of payload
overrides
object[]
Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence.
The name of the context field used to determine overrides
userId
Which values that should be overriden
["red","blue"]
Reorder strategies for this feature
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [reorderStrategy
]
payload
object[]
required
An array of strategies with their new sort order
The ID of the strategy
9c40958a-daac-400e-98fb-3bb438567008
The new sort order of the strategy
1
Add a parent feature dependency.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [addDependency
]
payload
object
required
Feature dependency on a parent feature in write model
The name of the feature we depend on.
parent_feature
Whether the parent feature should be enabled. When false
variants are ignored. true
by default.
false
The list of variants the parent feature should resolve to. Leave empty when you only want to check the enabled
status.
["variantA","variantB"]
Remove a parent feature dependency or all dependencies if no payload.
The name of the feature that this change applies to.
my-best-feature
The name of this action.
Possible values: [deleteDependency
]
Responses
- 200
changeRequestSchema
- application/json
- Schema
Schema
- MOD1
- MOD2
Array [
Array [
- MOD1
- MOD2
- MOD3
- MOD4
- setStrategySortOrderSchema
Array [
]
]
]
Array [
- MOD1
- MOD2
- MOD3
- MOD4
- setStrategySortOrderSchema
Array [
]
]
Array [
]
Array [
]
Array [
]
Array [
Array [
- MOD1
- MOD2
- MOD3
- MOD4
- setStrategySortOrderSchema
Array [
]
]
]
Array [
- MOD1
- MOD2
- MOD3
- MOD4
- setStrategySortOrderSchema
Array [
]
]
Array [
]
Array [
]
Array [
]
- MOD1
- MOD2
- MOD3
oneOf
This change requests's ID.
3
A title describing the change request's content.
Increasing gradual rollout
The environment in which the changes should be applied.
development
The minimum number of approvals required before this change request can be applied.
2
The project this change request belongs to.
unleash-project
features
object[]
required
The list of features and their changes that relate to this change request.
The name of the feature
my-feature
A string describing the conflicts related to this change. Only present if there are any concflicts on the feature level.
Feature has been archived
changes
object[]
required
List of changes inside change request. This list may be empty when listing all change requests for a project.
The ID of this change.
33
The kind of action that the change contains information about.
updateStrategy
A description of the conflict caused by this change. Only present if there are any conflicts.
Strategy has been deleted
payload
object
required
The data required to perform this action.
oneOf
string
boolean
object
number
An array of strategies with their new sort order
The ID of the strategy
9c40958a-daac-400e-98fb-3bb438567008
The new sort order of the strategy
1
createdBy
object
The user who created this change.
The user's username.
The URL where the user's image can be found.
When this change was suggested
2023-07-31T13:22:03+02:00
defaultChange
object
A description of a default change that will be applied with the change request to prevent invalid states.
Default changes are changes that are applied in addition to explicit user-specified changes when a change request is applied. Any default changes are applied in the background and are not a real part of the change request.
The kind of action this is.
addStrategy
The necessary data to perform this change.
{"name":"flexibleRollout","title":"","disabled":false,"segments":[],"parameters":{"groupId":"my-feature","rollout":"100","stickiness":"default"},"constraints":[{"values":["ux"],"inverted":false,"operator":"STR_CONTAINS","contextName":"userId","caseInsensitive":false}]}
segments
object[]
required
The list of segments and their changes that relate to this change request.
The ID of this change.
33
The kind of action that the change contains information about.
updateStrategy
A description of the conflict caused by this change. Only present if there are any conflicts.
Strategy has been deleted
payload
object
required
The data required to perform this action.
oneOf
string
boolean
object
number
An array of strategies with their new sort order
The ID of the strategy
9c40958a-daac-400e-98fb-3bb438567008
The new sort order of the strategy
1
createdBy
object
The user who created this change.
The user's username.
The URL where the user's image can be found.
When this change was suggested
2023-07-31T13:22:03+02:00
The current name of the segment
beta-users
approvals
object[]
A list of approvals that this change request has received.
createdBy
object
required
Information about the user who gave this approval.
The ID of the user who gave this approval.
33
The approving user's username.
unleash-user
The URL where the user's image can be found.
When the approval was given.
2022-12-12T12:13:24.218Z
rejections
object[]
A list of rejections that this change request has received.
createdBy
object
required
Information about the user who gave this approval.
The ID of the user who gave this approval.
33
The approving user's username.
unleash-user
The URL where the user's image can be found.
When the approval was given.
2022-12-12T12:13:24.218Z
comments
object[]
All comments that have been made on this change request.
The comment's ID. Unique per change request.
33
The content of the comment.
This is a comment
createdBy
object
required
Information about the user who posted the comment
The user's username.
unleash-user
The URL where the user's image can be found.
When the comment was made.
2022-12-12T12:13:24.218Z
createdBy
object
required
The user who created this change request.
Hunter
The URL of the user's profile image.
When this change request was created.
2023-07-31T13:33:02Z
The current state of the change request.
Possible values: [Draft
, In review
, Approved
, Applied
, Cancelled
, Rejected
]
This change requests's ID.
3
A title describing the change request's content.
Increasing gradual rollout
The environment in which the changes should be applied.
development
The minimum number of approvals required before this change request can be applied.
2
The project this change request belongs to.
unleash-project
features
object[]
required
The list of features and their changes that relate to this change request.
The name of the feature
my-feature
A string describing the conflicts related to this change. Only present if there are any concflicts on the feature level.
Feature has been archived
changes
object[]
required
List of changes inside change request. This list may be empty when listing all change requests for a project.
The ID of this change.
33
The kind of action that the change contains information about.
updateStrategy
A description of the conflict caused by this change. Only present if there are any conflicts.
Strategy has been deleted
payload
object
required
The data required to perform this action.
oneOf
string
boolean
object
number
An array of strategies with their new sort order
The ID of the strategy
9c40958a-daac-400e-98fb-3bb438567008
The new sort order of the strategy
1
createdBy
object
The user who created this change.
The user's username.
The URL where the user's image can be found.
When this change was suggested
2023-07-31T13:22:03+02:00
defaultChange
object
A description of a default change that will be applied with the change request to prevent invalid states.
Default changes are changes that are applied in addition to explicit user-specified changes when a change request is applied. Any default changes are applied in the background and are not a real part of the change request.
The kind of action this is.
addStrategy
The necessary data to perform this change.
{"name":"flexibleRollout","title":"","disabled":false,"segments":[],"parameters":{"groupId":"my-feature","rollout":"100","stickiness":"default"},"constraints":[{"values":["ux"],"inverted":false,"operator":"STR_CONTAINS","contextName":"userId","caseInsensitive":false}]}
segments
object[]
required
The list of segments and their changes that relate to this change request.
The ID of this change.
33
The kind of action that the change contains information about.
updateStrategy
A description of the conflict caused by this change. Only present if there are any conflicts.
Strategy has been deleted
payload
object
required
The data required to perform this action.
oneOf
string
boolean
object
number
An array of strategies with their new sort order
The ID of the strategy
9c40958a-daac-400e-98fb-3bb438567008
The new sort order of the strategy
1
createdBy
object
The user who created this change.
The user's username.
The URL where the user's image can be found.
When this change was suggested
2023-07-31T13:22:03+02:00
The current name of the segment
beta-users
approvals
object[]
A list of approvals that this change request has received.
createdBy
object
required
Information about the user who gave this approval.
The ID of the user who gave this approval.
33
The approving user's username.
unleash-user
The URL where the user's image can be found.
When the approval was given.
2022-12-12T12:13:24.218Z
rejections
object[]
A list of rejections that this change request has received.
createdBy
object
required
Information about the user who gave this approval.
The ID of the user who gave this approval.
33
The approving user's username.
unleash-user
The URL where the user's image can be found.
When the approval was given.
2022-12-12T12:13:24.218Z
comments
object[]
All comments that have been made on this change request.
The comment's ID. Unique per change request.
33
The content of the comment.
This is a comment
createdBy
object
required
Information about the user who posted the comment
The user's username.
unleash-user
The URL where the user's image can be found.
When the comment was made.
2022-12-12T12:13:24.218Z
createdBy
object
required
The user who created this change request.
Hunter
The URL of the user's profile image.
When this change request was created.
2023-07-31T13:33:02Z
The current state of the change request.
Possible values: [Scheduled
]
schedule
object
required
A schedule for a change request's application. The schedule can either be pending, failed, or suspended. The schedule will always contain the state of the schedule and the last scheduled time, but other data varies between the different states.
oneOf
A pending schedule for a change request.
When this change request will be applied.
2023-07-31T13:33:02Z
The status of the schedule.
Possible values: [pending
]
pending
A failed schedule for a change request.
When Unleash last attempted to apply this change request.
2023-07-31T13:33:02Z
The status of the schedule.
Possible values: [failed
]
failed
The reason the scheduled failed to apply.
conflicts
The reason the scheduled failed to apply. Deprecated in favor of the reason
property.
conflicts
A suspended schedule for a change request.
When Unleash would have attempted to apply this change request if the schedule was not suspended.
2023-07-31T13:33:02Z
The status of the schedule.
Possible values: [suspended
]
suspended
Why the schedule was suspended.
The user who scheduled this change request (user id: 123) has been deleted from this Unleash instance.