Activate campaign
Description
Activates a campaign.
Can be used to activate and launch a campaign instantly.
Also you can override campaign audience source for a different database or segment.
If run_now
= true
, the specified campaign launches instantly.
override_source_type
and override_source_id
are valid only if run_now
= true
.
override_limit
parameter sets sending limitations for the current run.
If no override options are set - campaigns will use their default audience sources and sending limitations.
Request URL
Method: POST
https://example.com/api/v1.1/campaigns/activate/
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
id | int | 12 | Yes | Campaign ID |
run_now | bool | true | No | Launch campaign instantly |
override_source_type | enum | "list" or "segment" | No | Override audience source |
override_source_id | int | 5 | No | New audience source ID |
override_limit | int | 300 | No | Override campaign limitations |
content | JSON object | {"field":"value"} | No | Additional content for API content filter node and template apicontent variables |
attach | JSON array | [] | No | Attach file(s) to campaign messages |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 82,
"override_source_id": 1,
"override_source_type": "list",
"run_now": true
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>82</id>
<override_source_id>1</override_source_id>
<override_source_type>list</override_source_type>
<run_now>true</run_now>
</xml>
Response example
- JSON
- XML
{
"data": null,
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data/>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |