Submit Change Request

Submit a change to a feature flag or segment for approval

Below are some examples of the expected payload for other types of updates to feature flags and segments.

Open Change Request to modify an existing feature flag definition

curl  --request POST 'https://api.split.io/internal/api/v2/changeRequests/ws/{ws_id}/environments/{environment_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ADMIN_API_KEY' \
--data-raw '{
	"split": {"name":"admin", "treatments":[{"name":"on","configurations":"{\"color\":\"blue\"}"},{"name":"off","configurations": "{\"color\":\"red\"}"}],"defaultTreatment":"off", "baselineTreatment": "off","rules":[{"buckets":[{"treatment":"on","size":50},{"treatment":"off","size":50}],"condition":{"matchers":[{"type":"IN_SEGMENT","string":"employees"}]}}],"defaultRule":[{"treatment":"off","size":50},{"treatment":"on","size":50}]},
	
	"operationType":"UPDATE",
	"title":"update split definition",
	"comment":"update split defition",
	"approvers":["approvers email address"]
}
'

Open Change Request to kill a feature flag

curl --location --request POST 'https://api.split.io/internal/api/v2/changeRequests/ws/{ws_id}/environments/{environment_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ADMIN_API_EY' \
--data-raw '{
	"{
	"split": {"name":"admin"},
	"operationType":"KILL",
	"title":"kill split submission",
	"comment":"a great Comment",
	"approvers":["approvers email address"]
}
'

Open Change Request to restore a feature flag

curl --request POST 'https://api.split.io/internal/api/v2/changeRequests/ws/{ws_id}/environments/{environment_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ADMIN_API_KEY' \
--data-raw '{
	"split": {"name":"<SPLIT_NAME>"},
	
		"operationType":"RESTORE",
	"title":"restore split",
	"comment":"a great comment",
	"approvers":["[email protected]"]
}
'

Open Change Request to archive a feature flag definition

curl --request POST 'https://api.split.io/internal/api/v2/changeRequests/ws/{ws_id}/environments/{environment_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ADMIN_API_KEY' \
--data-raw '{
	"split": {"name":"<SPLIT_NAME>"},
	
	"operationType":"ARCHIVE",
	"title":"Some CR Title",
	"comment":"Some CR Comment",
	"approvers":["[email protected]"]
}
'

Open Change Request to add members to a segment

curl --request POST 'https://api.split.io/internal/api/v2/changeRequests/ws/{ws_id}/environments/{environment_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ADMIN_API_KEY' \
--data-raw '{
	"segment":{"name":"<SEGMENT_NAME>", "keys":["k1","k2"]},
	"operationType":"CREATE",
	"title":"Some CR Title",
	"comment":"Some CR Comment",
	"approvers":["[email protected]"]
}
'

Open Change Request to add members to a segment via CSV

curl  --request POST 'https://api.split.io/internal/api/v2/changeRequests/ws/{ws_id}/environments/{environment_id}' \
--header 'Authorization: Bearer ADMIN API KEY' \
--form 'file=@/Users/someuser/approvalFlowsKeys.csv' \
--form 'segmentName=<SEGMENT_NAME>' \
--form 'title=Some CR Title' \
--form 'comment=Some CR Comment' \
--form '[email protected],validUserEma[email protected]' \
--form 'operationType=CREATE'

Open Change Request to remove members to a segment

curl --location --request POST 'https://api.split.io/internal/api/v2/changeRequests/ws/{ws_id}/environments/{environment_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ADMIN_API_KEY' \
--data-raw '{
	"segment":{"name":"<SEGMENT_NAME>", "keys":["k1","k2"]},
	"operationType":"ARCHIVE",
	"title":"Some CR Title",
	"comment":"Some CR Comment",
	"approvers":["[email protected]"]
}
'
Language