Edits a single change in a change request
PUT /api/admin/projects/:projectId/change-requests/:changeRequestId/changes/:changeId
This endpoint will edit one change from a change request if it matches the provided id. The edit removes previous change and inserts a new one. You should not rely on the changeId for subsequent edits and always check the most recent changeId.
Request
Path Parameters
- projectId string required
- changeRequestId string required
- changeId string required
- application/json
Body
required
changeRequestCreateSchema
- MOD1
- MOD2
- MOD3
- MOD4
- MOD5
- MOD6
- MOD7
- MOD8
- MOD9
- MOD10
- MOD11
- action string required
Possible values: [
updateSegment
]The name of this action.
payload objectrequired
Data used to create or update a segment
id integer requiredThe ID of the segment to update.
- action string required
Possible values: [
deleteSegment
]The name of this action.
payload objectrequired
Required data to delete a segment.
id integer requiredThe ID of the segment to delete.
- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
updateEnabled
]The name of this action.
payload objectrequired
enabled boolean requiredThe new state of the feature.
shouldActivateDisabledStrategies booleanOnly relevant when ALL the strategies are disabled. If
true
, all the disabled strategies will be enabled. Iffalse
, the default strategy will be added- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
addStrategy
]The name of this action.
payload objectrequired
Create a strategy configuration in a feature
name string requiredThe name of the strategy type
title string nullableA descriptive title for the strategy
disabled boolean nullableA toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs
sortOrder numberThe order of the strategy in the list
constraints object[]required
A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/strategy-constraints
Array [contextName string requiredThe name of the context field that this constraint should apply to.
operator string requiredPossible 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
]The operator to use when evaluating this constraint. For more information about the various operators, refer to the strategy constraint operator documentation.
caseInsensitive booleanDefault value:
false
Whether the operator should be case sensitive or not. Defaults to
false
(being case sensitive).inverted booleanDefault value:
false
Whether the result should be negated or not. If
true
, will turn atrue
result into afalse
result and vice versa.values string[]The context values that should be used for constraint evaluation. Use this property instead of
value
for properties that accept multiple values.value stringThe context value that should be used for constraint evaluation. Use this property instead of
values
for properties that only accept single values.]variants object[]
Strategy level variants
Array [name string requiredThe variant name. Must be unique for this feature flag
weight integer requiredPossible values:
<= 1000
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
weightType string requiredPossible values: [
variable
,fix
]Set to
fix
if this variant must have exactly the weight allocated to it. If the type isvariable
, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the variant weight documentation.stickiness string requiredThe stickiness to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time
payload object
Extra data configured for this variant
type string requiredPossible values: [
json
,csv
,string
,number
]The type of the value. Commonly used types are string, number, json and csv.
value string requiredThe actual value of payload
]parameters objectrequired
A list of parameters for a strategy
property name* stringsegments number[]Ids of segments to use for this strategy
- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
updateStrategy
]The name of this action.
payload objectrequired
Update a strategy configuration in a feature
id string requiredThe ID of the strategy to update.
- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
deleteStrategy
]The name of this action.
payload objectrequired
id string requiredThe ID of the strategy to update.
- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
archiveFeature
]The name of this action.
- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
patchVariant
]The name of this action.
payload objectrequired
variants object[]required
Array [name string requiredThe variants name. Is unique for this feature flag
weight number requiredPossible values:
<= 1000
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
weightType stringPossible values: [
variable
,fix
]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
stickiness stringStickiness is how Unleash guarantees that the same user gets the same variant every time
payload object
Extra data configured for this variant
type string requiredPossible values: [
json
,csv
,string
,number
]The type of the value. Commonly used types are string, number, json and csv.
value string requiredThe 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.
Array [contextName string requiredThe name of the context field used to determine overrides
values string[] requiredWhich values that should be overriden
]]- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
reorderStrategy
]The name of this action.
payload object[]required
An array of strategies with their new sort order
Array [id string requiredThe ID of the strategy
sortOrder number requiredThe new sort order of the strategy
]- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
addDependency
]The name of this action.
payload objectrequired
Feature dependency on a parent feature in write model
feature string requiredThe name of the feature we depend on.
enabled booleanWhether the parent feature should be enabled. When
false
variants are ignored.true
by default.variants string[]The list of variants the parent feature should resolve to. Leave empty when you only want to check the
enabled
status.- feature string required
The name of the feature that this change applies to.
- action string required
Possible values: [
deleteDependency
]The name of this action.
- 200
- 404
changeRequestSchema
- application/json
- Schema
Schema
- MOD1
- MOD2
- id number required
This change requests's ID.
- title string
A title describing the change request's content.
- environment string required
The environment in which the changes should be applied.
- minApprovals number required
The minimum number of approvals required before this change request can be applied.
- project string required
The project this change request belongs to.
features object[]required
The list of features and their changes that relate to this change request.
Array [name string requiredThe name of the feature
conflict stringA string describing the conflicts related to this change. Only present if there are any concflicts on the feature level.
changes object[]required
List of changes inside change request. This list may be empty when listing all change requests for a project.
Array [id number requiredThe ID of this change.
action string requiredThe kind of action that the change contains information about.
conflict stringA description of the conflict caused by this change. Only present if there are any conflicts.
payload objectrequired
The data required to perform this action.
oneOf- MOD1
- MOD2
- MOD4
- setStrategySortOrderSchema
stringbooleannumberArray [id string requiredThe ID of the strategy
sortOrder number requiredThe new sort order of the strategy
]createdBy object
The user who created this change.
username string nullableThe user's username.
imageUrl uri nullableThe URL where the user's image can be found.
createdAt date-timeWhen this change was suggested
]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.
action string requiredThe kind of action this is.
payload object requiredThe necessary data to perform this change.
]segments object[]required
The list of segments and their changes that relate to this change request.
Array [id number requiredThe ID of this change.
action string requiredThe kind of action that the change contains information about.
conflict stringA description of the conflict caused by this change. Only present if there are any conflicts.
payload objectrequired
The data required to perform this action.
oneOf- MOD1
- MOD2
- MOD4
- setStrategySortOrderSchema
stringbooleannumberArray [id string requiredThe ID of the strategy
sortOrder number requiredThe new sort order of the strategy
]createdBy object
The user who created this change.
username string nullableThe user's username.
imageUrl uri nullableThe URL where the user's image can be found.
createdAt date-timeWhen this change was suggested
name string requiredThe current name of the segment
]approvals object[]
A list of approvals that this change request has received.
Array [createdBy objectrequired
Information about the user who gave this approval.
id numberThe ID of the user who gave this approval.
username stringThe approving user's username.
imageUrl uriThe URL where the user's image can be found.
createdAt date-time requiredWhen the approval was given.
]rejections object[]
A list of rejections that this change request has received.
Array [createdBy objectrequired
Information about the user who gave this approval.
id numberThe ID of the user who gave this approval.
username stringThe approving user's username.
imageUrl uriThe URL where the user's image can be found.
createdAt date-time requiredWhen the approval was given.
]comments object[]
All comments that have been made on this change request.
Array [id numberThe comment's ID. Unique per change request.
text string requiredThe content of the comment.
createdBy objectrequired
Information about the user who posted the comment
username string nullableThe user's username.
imageUrl uri nullableThe URL where the user's image can be found.
createdAt date-time requiredWhen the comment was made.
]createdBy objectrequired
The user who created this change request.
username string nullableimageUrl uri nullableThe URL of the user's profile image.
- createdAt date-time required
When this change request was created.
- state string required
Possible values: [
Draft
,In review
,Approved
,Applied
,Cancelled
,Rejected
]The current state of the change request.
- id number required
This change requests's ID.
- title string
A title describing the change request's content.
- environment string required
The environment in which the changes should be applied.
- minApprovals number required
The minimum number of approvals required before this change request can be applied.
- project string required
The project this change request belongs to.
features object[]required
The list of features and their changes that relate to this change request.
Array [name string requiredThe name of the feature
conflict stringA string describing the conflicts related to this change. Only present if there are any concflicts on the feature level.
changes object[]required
List of changes inside change request. This list may be empty when listing all change requests for a project.
Array [id number requiredThe ID of this change.
action string requiredThe kind of action that the change contains information about.
conflict stringA description of the conflict caused by this change. Only present if there are any conflicts.
payload objectrequired
The data required to perform this action.
oneOf- MOD1
- MOD2
- MOD4
- setStrategySortOrderSchema
stringbooleannumberArray [id string requiredThe ID of the strategy
sortOrder number requiredThe new sort order of the strategy
]createdBy object
The user who created this change.
username string nullableThe user's username.
imageUrl uri nullableThe URL where the user's image can be found.
createdAt date-timeWhen this change was suggested
]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.
action string requiredThe kind of action this is.
payload object requiredThe necessary data to perform this change.
]segments object[]required
The list of segments and their changes that relate to this change request.
Array [id number requiredThe ID of this change.
action string requiredThe kind of action that the change contains information about.
conflict stringA description of the conflict caused by this change. Only present if there are any conflicts.
payload objectrequired
The data required to perform this action.
oneOf- MOD1
- MOD2
- MOD4
- setStrategySortOrderSchema
stringbooleannumberArray [id string requiredThe ID of the strategy
sortOrder number requiredThe new sort order of the strategy
]createdBy object
The user who created this change.
username string nullableThe user's username.
imageUrl uri nullableThe URL where the user's image can be found.
createdAt date-timeWhen this change was suggested
name string requiredThe current name of the segment
]approvals object[]
A list of approvals that this change request has received.
Array [createdBy objectrequired
Information about the user who gave this approval.
id numberThe ID of the user who gave this approval.
username stringThe approving user's username.
imageUrl uriThe URL where the user's image can be found.
createdAt date-time requiredWhen the approval was given.
]rejections object[]
A list of rejections that this change request has received.
Array [createdBy objectrequired
Information about the user who gave this approval.
id numberThe ID of the user who gave this approval.
username stringThe approving user's username.
imageUrl uriThe URL where the user's image can be found.
createdAt date-time requiredWhen the approval was given.
]comments object[]
All comments that have been made on this change request.
Array [id numberThe comment's ID. Unique per change request.
text string requiredThe content of the comment.
createdBy objectrequired
Information about the user who posted the comment
username string nullableThe user's username.
imageUrl uri nullableThe URL where the user's image can be found.
createdAt date-time requiredWhen the comment was made.
]createdBy objectrequired
The user who created this change request.
username string nullableimageUrl uri nullableThe URL of the user's profile image.
- createdAt date-time required
When this change request was created.
- state string required
Possible values: [
Scheduled
]The current state of the change request.
schedule objectrequired
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- MOD1
- MOD2
- MOD3
scheduledAt date-time requiredWhen this change request will be applied.
status string requiredPossible values: [
pending
]The status of the schedule.
scheduledAt date-time requiredWhen Unleash last attempted to apply this change request.
status string requiredPossible values: [
failed
]The status of the schedule.
reason string requiredThe reason the scheduled failed to apply.
failureReason string nullable deprecatedThe reason the scheduled failed to apply. Deprecated in favor of the
reason
property.scheduledAt date-time requiredWhen Unleash would have attempted to apply this change request if the schedule was not suspended.
status string requiredPossible values: [
suspended
]The status of the schedule.
reason string requiredWhy the schedule was suspended.
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\"."
}