Complete campaign
Description
Complete a campaign immediately. Completion stops sending messages for running mailings and switches all nested mailings and scenarios to the "inactive" status.
Access rights
To use this method, the API token must have:
- Campaigns — Run
- Access to the groups where the campaigns are located
Configure permissions in Settings → Tokens.
Request URL
Method: POST
https://example.com/api/v1.1/scampaigns/completed
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| id | int | 18 | Yes | Campaign ID |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 18
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>18</id>
</xml>
Response example
- JSON
- XML
{
"data": null,
"error": 0,
"error_text": "Successful operation"
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Returned parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error description |
| data | null | No data returned |
warning
Completing a campaign is irreversible. After completion, the campaign cannot be restarted; you can only create a new one.