curl --request DELETE \
--url "https://api.nixflex.com/v1/sms/campaigns/campaign_fixture" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
import Nixflex from 'nixflex';
const c = new Nixflex({
apiKey: process.env.NIXFLEX_API_KEY,
baseUrl: 'https://api.nixflex.com',
maxRetries: 0,
});
const result = await c.sms.campaigns.delete("campaign_fixture");
if (result.deleted !== true || result.campaign_id !== "campaign_fixture" || typeof result.message !== "string") {
throw new Error("Deletion is not confirmed.");
}
import os
from nixflex import Nixflex
with Nixflex(
api_key=os.environ["NIXFLEX_API_KEY"],
base_url="https://api.nixflex.com",
max_retries=0,
) as c:
result = c.sms.campaigns.delete('campaign_fixture')
if (result.get("deleted") is not True or result.get("campaign_id") != "campaign_fixture"
or not isinstance(result.get("message"), str)):
raise RuntimeError("Deletion is not confirmed.")
nixflex sms campaigns delete campaign_fixture --confirm --json --base-url "https://api.nixflex.com"
{
"name": "delete_sms_campaign",
"arguments": {
"campaign_id": "campaign_fixture",
"confirm": true
}
}
{
"campaign_id": "campaign_example",
"deleted": true,
"message": "Campaign deleted"
}
{
"error": {
"type": "server_error",
"code": "hangup_pending",
"message": "Waiting work is cancelled. Some calls have not confirmed they ended yet. Deletion is queued and will finish once hang-up is confirmed.",
"doc_url": "https://docs.nixflex.com/errors/hangup_pending",
"details": {
"deleted": false,
"retry_pending": true
}
}
}
SMS campaigns
Delete an SMS campaign
Delete an owned SMS campaign, stop waiting work and running calls, and keep sent history and used charges.
DELETE
/
sms
/
campaigns
/
{id}
curl --request DELETE \
--url "https://api.nixflex.com/v1/sms/campaigns/campaign_fixture" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
import Nixflex from 'nixflex';
const c = new Nixflex({
apiKey: process.env.NIXFLEX_API_KEY,
baseUrl: 'https://api.nixflex.com',
maxRetries: 0,
});
const result = await c.sms.campaigns.delete("campaign_fixture");
if (result.deleted !== true || result.campaign_id !== "campaign_fixture" || typeof result.message !== "string") {
throw new Error("Deletion is not confirmed.");
}
import os
from nixflex import Nixflex
with Nixflex(
api_key=os.environ["NIXFLEX_API_KEY"],
base_url="https://api.nixflex.com",
max_retries=0,
) as c:
result = c.sms.campaigns.delete('campaign_fixture')
if (result.get("deleted") is not True or result.get("campaign_id") != "campaign_fixture"
or not isinstance(result.get("message"), str)):
raise RuntimeError("Deletion is not confirmed.")
nixflex sms campaigns delete campaign_fixture --confirm --json --base-url "https://api.nixflex.com"
{
"name": "delete_sms_campaign",
"arguments": {
"campaign_id": "campaign_fixture",
"confirm": true
}
}
{
"campaign_id": "campaign_example",
"deleted": true,
"message": "Campaign deleted"
}
{
"error": {
"type": "server_error",
"code": "hangup_pending",
"message": "Waiting work is cancelled. Some calls have not confirmed they ended yet. Deletion is queued and will finish once hang-up is confirmed.",
"doc_url": "https://docs.nixflex.com/errors/hangup_pending",
"details": {
"deleted": false,
"retry_pending": true
}
}
}
FIXED · campaign MUST Resume covers only unattempted work in the existing running launch, and neither resume nor reuse replays completed work.
reuse_campaign_id replaces settings and recipients atomically only on an owned, never-launched voice draft or scheduled campaign. A launch claim prevents replacement. SMS creation always generates a fresh ID, even if the request forwards this field. Omit it for SMS. NOT OFFERED → do this instead · campaign A launched or finished campaign cannot run again. For another run create a campaign with a fresh ID, selected recipients and reviewed settings. The dashboard’s Use again button follows the same rule for voice: it edits a campaign that never launched, otherwise it opens a new campaign filled with the original settings and recipients for review before launch. SMS campaigns have no Use again button. YOU CAN CHANGE · campaign Use schedule_type=schedule, scheduled_date (YYYY-MM-DD), timezone, window_days and optional paired window_start_minutes/window_end_minutes. UTC date checks, local windows and capacity apply. SCOPE · campaign
Do not send a request body. Review the ID and effect before sending; completed content removal cannot be undone.
Deleting a voice or SMS campaign cancels waiting work, hangs up its running calls, then removes the campaign and recipient list. Calls already made and texts already sent stay in history. Used charges stay in billing; there are no refunds. Owner and Admin can delete; Member cannot. Cancel alone stops future dispatch and lets active calls finish; Delete also requests their hang-up.
The 503 flags are inside
reuse_campaign_id replaces settings and recipients atomically only on an owned, never-launched voice draft or scheduled campaign. A launch claim prevents replacement. SMS creation always generates a fresh ID, even if the request forwards this field. Omit it for SMS. NOT OFFERED → do this instead · campaign A launched or finished campaign cannot run again. For another run create a campaign with a fresh ID, selected recipients and reviewed settings. The dashboard’s Use again button follows the same rule for voice: it edits a campaign that never launched, otherwise it opens a new campaign filled with the original settings and recipients for review before launch. SMS campaigns have no Use again button. YOU CAN CHANGE · campaign Use schedule_type=schedule, scheduled_date (YYYY-MM-DD), timezone, window_days and optional paired window_start_minutes/window_end_minutes. UTC date checks, local windows and capacity apply. SCOPE · campaign
DELETE /v1/calls/batch/{id} deletes a voice campaign. Voice and SMS have separate cancel routes. Cancel stops future work. Running attempts may finish.
For one owned sender, send business_number (encode + as %2B) on GET /v1/campaigns or GET /v1/sms/campaigns. Omit for account scope. Keep the same number and status through SMS cursors. Restart paging if either changes. Voice include_totals=true covers returned campaigns only (default 50, max 200).
Pickup rate = answered attempts / all attempts, including failed starts. Answered means over five seconds with no detected voicemail. Sum counts before dividing. Zero attempts means no rate. SMS delivery rate = delivered / (delivered + failed).
Read the compact AI rules
Stop this campaign and remove its campaign view while preserving sent history and used charges.
Method: DELETE ·
Success: 200 ·
Permission: Owner or Admin
The important part
- Running calls are hung up before content deletion.
- A queued hang-up is not a completed delete; the same request safely resumes it.
- Used charges remain. Customer-managed copies have their own lifecycle.
Authentication
Use the owning account’s server-side credential inAuthorization: Bearer KEY_ID:KEY_SECRET. An organisation API key has Owner authority. Personal dashboard sessions need Owner or Admin authority; Members receive 403.
Request fields
| Field | Type | Required | Limits |
|---|---|---|---|
id (path) | string | Yes | 1–200 characters; the exact owned identifier. |
Response fields
HTTP 200 confirms content deletion. It does not erase billing or every external copy.| Field | Type | Meaning |
|---|---|---|
campaign_id | string | The requested owned campaign ID. |
deleted | boolean | True: the campaign and recipient list are removed. |
message | string | Campaign deleted. |
Example request
These examples use the existing Node, Python, CLI and MCP delete methods. They target test and use an owned fixture ID. SetNIXFLEX_API_KEY privately for that account; configure MCP for the same host. The request changes the campaign. The CLI and MCP require explicit confirmation.
Use the exact supported client version. Its Node/Python clients preserve a proved 503 hangup_pending as NixflexServerError; other uncertain failures use outcome_unknown with the server code in details.original_code. A client exception for HTTP 503 does not mean deletion has stopped. Read its error code and details: hangup_pending is queued, while deletion_unavailable does not confirm a queue. Show deletion as complete only after HTTP 200 with deleted:true. See the response and recovery sections below.
curl --request DELETE \
--url "https://api.nixflex.com/v1/sms/campaigns/campaign_fixture" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
import Nixflex from 'nixflex';
const c = new Nixflex({
apiKey: process.env.NIXFLEX_API_KEY,
baseUrl: 'https://api.nixflex.com',
maxRetries: 0,
});
const result = await c.sms.campaigns.delete("campaign_fixture");
if (result.deleted !== true || result.campaign_id !== "campaign_fixture" || typeof result.message !== "string") {
throw new Error("Deletion is not confirmed.");
}
import os
from nixflex import Nixflex
with Nixflex(
api_key=os.environ["NIXFLEX_API_KEY"],
base_url="https://api.nixflex.com",
max_retries=0,
) as c:
result = c.sms.campaigns.delete('campaign_fixture')
if (result.get("deleted") is not True or result.get("campaign_id") != "campaign_fixture"
or not isinstance(result.get("message"), str)):
raise RuntimeError("Deletion is not confirmed.")
nixflex sms campaigns delete campaign_fixture --confirm --json --base-url "https://api.nixflex.com"
{
"name": "delete_sms_campaign",
"arguments": {
"campaign_id": "campaign_fixture",
"confirm": true
}
}
Example response
{
"campaign_id": "campaign_example",
"deleted": true,
"message": "Campaign deleted"
}
{
"error": {
"type": "server_error",
"code": "hangup_pending",
"message": "Waiting work is cancelled. Some calls have not confirmed they ended yet. Deletion is queued and will finish once hang-up is confirmed.",
"doc_url": "https://docs.nixflex.com/errors/hangup_pending",
"details": {
"deleted": false,
"retry_pending": true
}
}
}
Errors
| Status / code | Meaning | What to do |
|---|---|---|
400 invalid_delete | Invalid identifier length. | Use the exact owned ID, from 1 to 200 characters. |
| 401 | Missing or invalid authentication. | Check the credential and host privately. |
403 permission_denied | The personal session cannot delete. | Ask an Owner or Admin; never give a Member the account key as a workaround. |
404 not_found | The item is missing or belongs to another account. | Check the saved ID and account. Do not infer another account’s data. |
| 429 | Rate limited. | Honour Retry-After and avoid a polling write loop. |
503 hangup_pending | Hang-up is unconfirmed; deletion is queued. | Show queued, not deleted. The worker continues automatically; the same DELETE safely resumes it. |
503 deletion_unavailable | Deletion could not be confirmed. | Check the list and repeat the same DELETE if needed; an existing request safely resumes. |
error.details, not at the response root. hangup_pending includes deleted:false and retry_pending:true; deletion_unavailable includes deleted:false without promising that a queue exists.
Retry and idempotency
If hang-up is not confirmed, HTTP 503hangup_pending returns error.details.deleted:false and error.details.retry_pending:true. Deletion stays queued and continues automatically. Repeating the same DELETE for the same account and ID safely resumes it. A lost response or deletion_unavailable is not success: check the list, then repeat that same DELETE if needed. Missing and foreign IDs share HTTP 404. Bulk call deletion and account closure keep separate safety rules.
Use bounded reads to refresh the list. Do not treat the generic write-retry rule for call creation or SMS sending as the deletion rule: this same-ID DELETE can be repeated deliberately to resume cleanup. It does not require an Idempotency-Key header.