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
Prepare an SMS campaign’s template, recipients and contact checks, then track acceptance, delivery and replies separately.
Creation: Can send immediately ·
Variables: Nested per recipient ·
Results: Separate counts
The important part
- Creating a campaign can send immediately or when scheduled.
- SMS creation makes new work; it has no reuse_campaign_id replacement mode.
- Keep uncertain sends visible and reconcile the saved campaign ID.
Choose the task
Prerequisites
KeepNIXFLEX_API_KEY private on the server. Raw HTTP base URL: https://api.nixflex.com/v1. Node and Python SDK base URL: https://api.nixflex.com. The SDK adds /v1. Use owned identifiers; SDK and CLI examples need the documented minimum versions. Use an active owned agent and explicit sender. Set NXF_AGENT_ID and other example identifiers before using these examples.
1. Inspect campaign state
2. Prepare the template and replies
Usemessage_template with values in each recipient’s nested variables. Every required placeholder needs a value. Set reply_context_prompt for campaign-specific reply context; the number still needs SMS auto-reply enabled and appropriate instructions. The default association window is 168 hours.
3. Review and create
POST/v1/sms/campaigns with agent, sender, template and recipients. Choose duplicate handling, confirm permission and preview contact hours. now requests launch immediately. schedule uses scheduled_date and may send when due. Do not send reuse_campaign_id; SMS creation always creates new work.
4. Handle delivery separately
Storecampaign_id and read campaign state. Sent, delivered and failed counts are distinct. A recipient response can arrive later; message acceptance is not delivery. Unknown transport outcomes must remain unknown rather than being silently resent.
5. Control unsent work
UsePOST /v1/sms/campaigns/{id}/cancel to stop future dispatch, and the documented resume or consent routes when appropriate. Delete removes the campaign and recipient list after stopping waiting work and any running calls. Neither action recalls a sent text. PATCH edits only the fields and states allowed by the API.
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. If hang-up is not confirmed, HTTP 503 hangup_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.
Example response
The creation result includescampaign_id, accepted and rejected row counts, duplicates and state. Campaign reads expose separate sent_count, delivered_count, failed_count and reply_count; do not compute one by subtracting unrelated totals.