> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nixflex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare and send an SMS campaign

> Build SMS campaign templates and recipient variables, review consent and hours, and create one campaign while preserving uncertain outcomes.

**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** `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](https://docs.nixflex.com/ai-rules.md#campaigns)

Prepare a complete SMS template and recipient set, then create the campaign once with explicit contact choices.

Content: **Message template** · Recipients: **Nested variables** · Creation: **Can send messages**

**The important part**

* To send again, create a new campaign. To adjust an existing one, use the [SMS settings that can be updated](https://docs.nixflex.com/api-reference/sms-campaigns/patch-sms-campaigns-id.md). Creating with an old ID still makes a new campaign. See [creation and scheduling](https://docs.nixflex.com/api-reference/sms/campaigns-create.md).

* Creating a campaign can send immediately or automatically when scheduled.

* Every template placeholder needs a value in each recipient’s nested variables.

* SMS creation always creates new work; reuse\_campaign\_id is not supported.

[Business guide](https://docs.nixflex.com/guides/business/sms-campaigns.md) · [API reference](https://docs.nixflex.com/api-reference/introduction.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Prepare the message and recipients

Choose an active owned agent and explicit eligible sender. Put personalised values in each recipient’s `variables` object, and validate every placeholder in `message_template`. Keep recipient `phone`, known country and IANA time zone alongside those variables.

Preview the recipient-local contact window and confirm permission to send. A campaign clock cannot replace an unknown recipient location. Choose duplicate handling deliberately: `warn` retains rows and does not block sending; `reject` refuses duplicate accepted numbers.

## Decide how replies should work

Set `reply_context_prompt` for instructions specific to replies associated with this campaign. The number also needs SMS auto-reply enabled and suitable SMS instructions. The reviewed default reply association window is 168 hours; this is association context, not a promise that a reply will arrive.

## Review the complete request

This illustrates the [create SMS campaign](https://docs.nixflex.com/api-reference/sms/campaigns-create.md) body with fictional values. It is not a live test fixture. A scheduled campaign may send when due, and consent false is a contact hold rather than a general dry-run switch.

```json theme={"dark"}
{
  "agent_id":"agent_example",
  "from_number":"+12025550100",
  "name":"Appointment follow-up",
  "message_template":"Hello {{name}}, would you like to discuss an appointment?",
  "recipients":[{"phone":"+12025550101","variables":{"name":"Sam"},"country":"US","timezone":"America/New_York"}],
  "duplicate_policy":"reject",
  "schedule_type":"schedule",
  "scheduled_date":"2030-11-04",
  "consent_confirmed":false
}
```

Default `now` mode requests launch immediately; there is no public draft-only flag. `schedule` uses a calendar date and current recipient eligibility. Do not send `reuse_campaign_id`: it does not implement SMS campaign replacement.

## Save once and inspect the result

Disable automatic mutation retries. Save `campaign_id`, accepted and rejected rows, duplicate information and current state. Up to 100,000 accepted rows are supported, but request-size limits can be reached earlier.

| Result | Recovery |
| - | - |
| Missing template value | Correct that recipient before creating again. |
| Saved campaign with launch refusal | Read the returned ID and resolve the existing hold. |
| `campaign_outcome_unknown` | Preserve the saved ID and reconcile; do not create another campaign. |
| Timeout or lost response | Keep the intended work record and inspect existing state before another write. |

Duplicate detection compares input rows; it does not deduplicate repeated HTTP requests.

* [Read delivery and control unsent work](https://docs.nixflex.com/guides/developer/sms-campaigns/delivery-and-controls.md)
* [Configure SMS replies](https://docs.nixflex.com/sms/sms-agent.md)
* [Check contact controls](https://docs.nixflex.com/guides/developer/contact-controls.md)

## Related dashboard and AI tasks

* [Review messages and recipients before sending](https://docs.nixflex.com/guides/business/sms-campaigns/review-recipients.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.