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 a voice 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.
  • Edit before launch. Send reuse_campaign_id to replace all recipients and settings of an owned draft or scheduled voice campaign in one operation. Keep schedule_type set to schedule to leave it scheduled. To run a launched campaign again, create a new campaign.
  • Controls. Cancel stops future work. Resume covers unattempted rows on the current running launch. Delete the owned voice campaign after eligible work settles.
  • The default now mode immediately requests launch; scheduled work can run automatically. There is no public draft-only mode.
  • Review recipients, consent and contact rules before creating the campaign, because creation can contact people.
The campaign prompt is the outbound call purpose. It and each recipients[].prompt_override have no separate character limit; the whole JSON request must be under 100 KB (102,400 bytes), or you get 413 payload_too_large. Keep call purposes short: a few hundred to a few thousand characters. Supply custom placeholders in each recipient’s variables. The SMS and website instruction limits are separate. This route does not accept prompt_validation: the field is ignored and there is no 10-character check when the campaign is created. Only a blank prompt is refused (400 missing_field). Write each purpose with at least 10 characters after trimming; a shorter one can make the agent apologise and end the call.

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. Delete the owned voice campaign after eligible work settles. Reuse replaces the recipient list and settings only while the owned campaign has never launched. The 100 KB JSON request limit and database constraints can limit a request before the maximum accepted-recipient count. There is no separate text length limit for the prompt or prompt_override 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
prompt
string
required

Nonblank default instructions used by every row without a prompt override. No separate maximum; the whole JSON request must be under 100 KB. This route does not read prompt_validation and does not check a 10-character minimum.

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
reuse_campaign_id
string | null

Replace an owned never-launched draft or scheduled voice campaign atomically. Launched campaigns are refused; this is not an idempotency key.

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.