Stop a campaign that has not started. Nothing is sent and nothing is charged.
https://telcomw.com/api/v3/campaigns/42/cancelPut the campaign_id in the URL. There is no body. Your API key goes in the X-API-Key header.
| Parameter | Sent in | Required | Description |
X-API-Key |
header | YES | Your API key, sent as a header. You can also send it as Authorization: Bearer YOUR_API_KEY. |
campaign_id |
path | YES | The id of the campaign. |
curl --location --request POST 'https://telcomw.com/api/v3/campaigns/42/cancel' \ --header 'X-API-Key: YOUR_API_KEY'
curl --location --request POST "https://telcomw.com/api/v3/campaigns/42/cancel" ^ --header "X-API-Key: YOUR_API_KEY"
<?php
$headers = [
'X-API-Key: YOUR_API_KEY',
];
$ch = curl_init('https://telcomw.com/api/v3/campaigns/42/cancel');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));
const axios = require('axios');
axios.request({
method: 'post',
url: 'https://telcomw.com/api/v3/campaigns/42/cancel',
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}).then((res) => console.log(res.data))
.catch((err) => console.error(err.response ? err.response.data : err.message));
import requests
headers = {
'X-API-Key': 'YOUR_API_KEY'
}
response = requests.request('POST', 'https://telcomw.com/api/v3/campaigns/42/cancel', headers=headers)
print(response.json())
The response is JSON.
{
"success": true,
"request_id": "req_5f2c9a1d0e7b4a63",
"data": {
"campaign_id": 42,
"name": "November sale",
"sender_id": "WGIT",
"message": "Our sale starts today. Visit us!",
"status": "cancelled",
"scheduled_at": "2026-11-20T07:00:00.000Z",
"recipients_source": "numbers",
"group_id": null,
"recipients": 2,
"queued": 0,
"failed": 0,
"cost": 0,
"currency": "MWK",
"notify_before": true,
"batch_ids": [],
"error": null,
"started_at": null,
"completed_at": null,
"created_at": "2026-11-05T09:12:44.000Z"
}
}
{
"success": false,
"request_id": "req_5f2c9a1d0e7b4a63",
"error": {
"code": "CAMPAIGN_NOT_CANCELLABLE",
"message": "This campaign is completed. Only a scheduled campaign can be cancelled."
}
}
| Field | Description |
success | true when the request worked. |
request_id | The number of this request. Quote it if you contact us. |
data.campaign_id | The id of the campaign. Use it in the other campaign calls. |
data.status | scheduled, running, completed, failed or cancelled. |
data.scheduled_at | When the campaign runs (UTC). |
data.recipients_source | numbers (a list you sent) or group (a phonebook group). |
data.recipients | How many numbers the campaign has. |
data.queued | After it ran: how many messages were queued for delivery. |
data.failed | After it ran: how many could not be queued. |
data.cost | After it ran: what it cost, in MWK. 0 before. |
data.error | Why a failed campaign failed, otherwise null. |