SysEnableCampaign
Enables or disables a campaign. Only the enabled flag is changed — all other campaign fields are left untouched. The campaign must not have ended.
The campaign configuration is re-validated before it is enabled, so a campaign that has become invalid (for example, because its target segment was deleted) cannot be enabled until it is fixed.
| Service | Operation |
|---|---|
| campaign | SYS_ENABLE_CAMPAIGN |
Method Parameters
| Parameter | Description |
|---|---|
| campaignCode | The campaign code to enable or disable. |
| enable | true to enable the campaign, false to disable it. |
Usage
http://localhost:3000
- C#
- C++
- Obj-C
- Java
- JavaScript
- Dart
- Roblox
- GDScript
- Lua
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
-- N/A
N/A
-- Cloud Code only. To view example, switch to the Cloud Code tab
var campaignCode = "SUMMER2026";
var enable = true;
var campaignProxy = bridge.getCampaignServiceProxy();
var postResult = campaignProxy.sysEnableCampaign(campaignCode, enable);
{
"service": "campaign",
"operation": "SYS_ENABLE_CAMPAIGN",
"data": {
"campaignCode": "SUMMER2026",
"enable": true
}
}
JSON Response
{
"data": {
"campaignCode": "SUMMER2026",
"enabled": true,
"version": 2,
"updatedAt": 1811725200000
},
"status": 200
}
Common Error Codes
Status Codes
| Code | Name | Description |
|---|---|---|
| 40345 | MISSING_RECORD | No campaign exists for the specified campaignCode. |
| 40001 | INVALID_REQUEST | The campaign has ended and can no longer be modified. |
| 41055 | INVALID_CAMPAIGN_CONFIGURATION | The campaign configuration is no longer valid and the campaign cannot be enabled. The error message describes the specific problem. |
| 40616 | CLOUD_CODE_ONLY_METHOD | The method was called from a client. It can only be called from Cloud Code or S2S. |
| 40731 | FEATURE_NOT_SUPPORTED_BY_BILLING_PLAN | Billing plan does not include the Campaign feature. Requires a plan that includes Enterprise features. |