Skip to main content
Version: 6.1.0

SysDeleteScenario

Deletes a variant scenario from a campaign, along with its player participation records and collected metrics. Any weight the scenario held is moved to the control scenario (_). The control scenario itself cannot be deleted — delete the campaign instead. The campaign must not have ended.

If the campaign is in progress (enabled and within its startAt/endAt window) and the scenario has a weight above 0, you must pass force as true to delete it.

ServiceOperation
campaignSYS_DELETE_SCENARIO

Method Parameters​

ParameterDescription
campaignCodeThe campaign code that owns the scenario.
scenarioCodeThe scenario code to delete — for example A or B. The control scenario (_) cannot be deleted.
versionVersion of the scenario being deleted. Pass -1 to delete regardless of the current version.
forceIf true, allows deleting a scenario that has weight allocated while the campaign is in progress. Defaults to false.

Usage​

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"campaignCode": "SUMMER2026",
"scenarioCode": "A"
},
"status": 200
}
Common Error Codes

Status Codes​

CodeNameDescription
40345MISSING_RECORDNo scenario exists for the specified campaignCode and scenarioCode.
40001INVALID_REQUESTThe campaign has ended and can no longer be modified.
41063CAMPAIGN_SCENARIO_VERSION_MISMATCHThe specified version no longer matches the scenario — it was updated by someone else. Re-read and retry.
40660INVALID_PARAMETER_VALUEscenarioCode is the control scenario (_), which cannot be deleted.
41054CAMPAIGN_UPDATE_ERRORThe scenario has weight allocated while the campaign is in progress. Pass force as true to delete it.
40616CLOUD_CODE_ONLY_METHODThe method was called from a client. It can only be called from Cloud Code or S2S.
40731FEATURE_NOT_SUPPORTED_BY_BILLING_PLANBilling plan does not include the Campaign feature. Requires a plan that includes Enterprise features.