Skip to main content
POST
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 Create an SMS campaign and its recipient rows. The default now mode immediately requests launch; schedule mode saves scheduled work that can run automatically. There is no public draft-only flag.
Method: POST ·
Success: 201 ·
Scope: Owning account
The important part
  • Scheduling. Use schedule_type: "schedule" and scheduled_date (YYYY-MM-DD). The scheduler checks the date against UTC. Supply both window bounds in minutes, or omit both. Choose a window and time zone for the earliest eligible work. There is no exact-time scheduled_at field or guaranteed dispatch minute.
  • Each successful create saves a new campaign. Sending reuse_campaign_id cannot replace or replay an SMS campaign. To run it again, submit a fresh campaign. To replace recipients on a scheduled campaign, cancel the original and confirm its state before creating the replacement. Work already in progress can finish.
  • The default now mode immediately requests launch; scheduled work can run automatically. There is no public draft-only mode.
  • Review recipients, consent and message content before creating the campaign, because creation can send messages.

Authentication

Send Authorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential. Send Content-Type: application/json.

Request fields

Send a JSON object. The scheduler and final contact checks use recipient-local eligibility, consent, suppression and capacity. A campaign time zone is not a substitute for an unknown recipient location. Preview contact hours before saving; a preview is advisory. Wider hours require the recorded explanation and remain subject to policy. Choose duplicate_policy deliberately. reject refuses repeated accepted numbers, allow keeps every row, and warn reports duplicates but still allows this route to request launch. The duplicate_choice_required response flag is advisory. It does not create a safe draft or block sending. The scheduled example can contact its recipients when due. Use an approved destination and consent; the date is illustrative. No public draft-only flag is accepted. SMS creation always makes a new campaign ID. An incoming reuse_campaign_id is ignored. To run it again, create a new campaign and review its recipients and consent. JSON request size and database constraints can limit a request before the maximum accepted-recipient count. No additional text length limit is declared for the prompt or message template on this route.

Response fields

201 Created returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.

Scheduled creation

Immediate launch

Example request

These examples require Node/CLI 0.11.0 or later, Python 0.4.0 or later and MCP 0.5.0 or later. Keep NIXFLEX_API_KEY private. cURL uses Bash; CLI uses PowerShell and reads the key through NIXFLEX_API_KEY. Replace fixture identifiers and reserved example numbers with approved account-owned values. Configure the existing MCP installation for the same account at https://api.nixflex.com before using the shown tool arguments. Python shows the synchronous client; AsyncNixflex uses the same method with async with and await. This example changes state. Review the target and payload before running it. Running it can contact recipients immediately or when scheduled; scheduled creation is executable, not a draft. The existing MCP create tool does not expose nullable timezone as a typed argument, so its example omits that field.

Example response

Illustrative 201 response. Identifiers and values are examples; some optional or compatibility fields are omitted.

Errors

Failures return an error object with code, message, doc_url and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.

Retry and idempotency

Creation is not idempotent. Do not automatically retry after a timeout, 5xx, or saved-but-refused launch. Read the campaign list/detail using the returned campaign_id when available; ask support to reconcile an unknown result. Duplicate detection compares input rows, not repeated HTTP requests. Queue admission or a sent count does not confirm contact or delivery.

Authorizations

Authorization
string
header
required

KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A verified personal dashboard Bearer session may be used where the operation documents role-based access.

Body

application/json
agent_id
string
required

Active agent owned by this account.

from_number
string
required

International number with + and digits; no spaces.

Pattern: ^\+[1-9][0-9]{6,14}$
recipients
object[]
required

At least one accepted recipient; send at most 1,000 recipients per campaign (the whole request must stay under 100 KB). For a bigger list, create several campaigns.

Required array length: 1 - 1000 elements
message_template
string
required

Nonblank text template. Each placeholder such as {{name}} must have a value in every recipient’s variables.

name
string

Campaign label. Empty or omitted uses the channel-specific Untitled campaign label.

schedule_type
enum<string>
default:now

now requests launch immediately after creation. schedule saves scheduled work that the scheduler can launch.

Available options:
now,
schedule
scheduled_date
string<date> | null

For schedule mode, use YYYY-MM-DD. A date and optional sending window control eligibility. No scheduled_at field or exact dispatch time is supported.

window_start_minutes
integer | null

Start minute after midnight; supply both ends. Zero means midnight.

Required range: 0 <= x <= 1439
window_end_minutes
integer | null

End minute after midnight; supply both ends. A lower end denotes an overnight window.

Required range: 0 <= x <= 1439
window_days
enum<string>[] | null

Optional selected weekdays; duplicate values are collapsed and empty means unset.

Weekday.

Available options:
mon,
tue,
wed,
thu,
fri,
sat,
sun
timezone
string | null

Optional valid IANA campaign time zone. It does not replace a recipient’s location.

source
enum<string>
default:api

Origin label only; API clients should keep api.

Available options:
api,
dashboard
skip_invalid
boolean
default:false

When true, omit invalid phone rows only. At least one valid row remains required; other validation failures still refuse.

duplicate_policy
enum<string>
default:warn

warn retains duplicate rows and reports them; allow explicitly keeps them; reject refuses duplicates. warn is advisory and does not prevent automatic launch. No silent deduplication.

Available options:
allow,
warn,
reject

Record confirmation for this campaign. Missing consent holds contact until recorded.

allow_wider_hours
boolean
default:false

Request wider hours with a recorded explanation. Recipient policy and other checks still apply.

hours_confirmation
string

Required when wider hours is true: trimmed explanation at least 20 characters; raw maximum 1,000.

Required string length: 20 - 1000
reply_context_prompt
string | null

Instructions for replies associated with this campaign.

reply_window_hours
integer
default:168

Hours for campaign reply association; positive integer. Omitted or zero uses 168.

Required range: x >= 1

Response

Created

Scheduled creation or immediate launch result.

campaign_id
string
required

Saved campaign ID.

total
integer
required

Original input row count.

total_recipients
integer
required

Accepted saved rows.

valid_count
integer
required

Accepted recipient rows.

invalid_count
integer
required

Rejected phone rows.

invalid
object[]
required
duplicates
object[]
required

Repeated accepted destinations.

duplicate_policy
enum<string>
required

Applied duplicate decision.

Available options:
allow,
warn,
reject
duplicate_choice_required
boolean
required

Advisory flag for repeated rows under warn; it is not a server-side launch lock.

status
string
required

Saved campaign state.