curl --request POST \
--url "https://api.nixflex.com/v1/calls/batch/campaign_fixture/consent" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"event":"consent","confirmed":true}'
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.campaigns.consent("campaign_fixture", {"event": "consent", "confirmed": true});
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.campaigns.consent('campaign_fixture', event='consent', confirmed=True)
$body = @'
{
"event": "consent",
"confirmed": true
}
'@
[IO.File]::WriteAllText('request-92.json', $body, (New-Object Text.UTF8Encoding $false))
nixflex campaigns consent campaign_fixture --body '@request-92.json' --confirm --json --base-url "https://api.nixflex.com"
{
"campaign_id": "campaign_example",
"recorded": true
}
Voice campaigns
Record voice consent
Record consent or withdrawal for the current Nixflex voice campaign policy revision. Review the audience and policy before confirming.
POST
/
calls
/
batch
/
{id}
/
consent
curl --request POST \
--url "https://api.nixflex.com/v1/calls/batch/campaign_fixture/consent" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"event":"consent","confirmed":true}'
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.campaigns.consent("campaign_fixture", {"event": "consent", "confirmed": true});
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.campaigns.consent('campaign_fixture', event='consent', confirmed=True)
$body = @'
{
"event": "consent",
"confirmed": true
}
'@
[IO.File]::WriteAllText('request-92.json', $body, (New-Object Text.UTF8Encoding $false))
nixflex campaigns consent campaign_fixture --body '@request-92.json' --confirm --json --base-url "https://api.nixflex.com"
{
"campaign_id": "campaign_example",
"recorded": 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
Send a JSON object.
confirmed must be true for either event. Omitted fields and false are refused. This endpoint does not launch a campaign or clear suppression. Recording consent can unblock otherwise eligible scheduled or running work. Missing campaigns and unconfirmed database results currently return 503 outcome_unknown.
MCP does not offer this operation because it can enable outreach; use the API, Node, CLI or Python.
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
Record a consent or consent-withdrawal decision for the current voice campaign policy revision. The owner confirms the selected event explicitly.
Method: POST ·
Success: 200 ·
Scope: Owning account
The important part
Review the audience and policy, then record the actual consent decision for the current campaign revision before launch. A revision identifies the campaign policy you confirmed. Reusing a campaign creates a new revision and invalidates earlier confirmations. A campaign confirmation does not override a recipient’s STOP.
- Record actual consent for the intended campaign.
- This record does not bypass suppression or recipient-local contact checks.
The consent rule in plain words
- When it applies. Nixflex can require a consent confirmation before campaign calls are sent. This requirement is managed by Nixflex and may be off. While it is on, each recipient waits with
consent_requireduntil consent is recorded for the campaign. - What the owner confirms. Recording
consentconfirms that your business has permission to contact the recipients in this campaign on this channel. It is your statement; Nixflex does not check it. - What the policy revision is. The revision is the version of this campaign’s recipients and contact settings that you are confirming. A new campaign starts a new revision, so a confirmation never carries over to another campaign. Reusing a voice campaign replaces its recipients and settings and starts a new revision; earlier confirmations no longer count, so confirm again. Its recipients and call purpose cannot be edited any other way.
- Withdrawal. Recording
consent_withdrawnholds the remaining recipients withconsent_withdrawn, even when Nixflex does not require confirmations. - Your own rules. Nixflex does not decide which calls are legal in each country. Check the rules that apply to your business before you launch. For example, marketing calls usually need prior consent, while service or reminder calls to existing customers often have different rules. This is not legal advice.
consent_confirmed: true can record it when creating the campaign. Use the consent endpoint for a subsequent confirmation or withdrawal.
Authentication
SendAuthorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential. Send Content-Type: application/json.
Request fields
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
id (path) | string | Yes | None | Account-owned campaign identifier. Maximum 100 characters. Minimum 1 characters. Pattern: ^[A-Za-z0-9_-]+$. |
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
event | string | Yes | None | Decision to record. Allowed: "consent", "consent_withdrawn". |
confirmed | boolean | Yes | None | Explicitly confirm the selected event, including withdrawal. Value: true. |
Response fields
200 OK returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.
| Field | Type | Meaning |
|---|---|---|
campaign_id | string | Campaign ID. |
recorded | boolean | The decision was recorded. Value: true. |
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. KeepNIXFLEX_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.
curl --request POST \
--url "https://api.nixflex.com/v1/calls/batch/campaign_fixture/consent" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"event":"consent","confirmed":true}'
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.campaigns.consent("campaign_fixture", {"event": "consent", "confirmed": true});
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.campaigns.consent('campaign_fixture', event='consent', confirmed=True)
$body = @'
{
"event": "consent",
"confirmed": true
}
'@
[IO.File]::WriteAllText('request-92.json', $body, (New-Object Text.UTF8Encoding $false))
nixflex campaigns consent campaign_fixture --body '@request-92.json' --confirm --json --base-url "https://api.nixflex.com"
Example response
Illustrative200 response. Identifiers and values are examples; some optional or compatibility fields are omitted.
{
"campaign_id": "campaign_example",
"recorded": true
}
Errors
Failures return anerror 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.
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request | The identifier or request fields are invalid. | Correct the documented fields before resending. |
| 503 | outcome_unknown | The write result could not be confirmed. | Read current state; do not resend automatically. |
| 400 | invalid_json | Invalid JSON body. | Correct JSON syntax. |
| 413 | payload_too_large | The request exceeds the JSON body limit. | Send a smaller request. |
| 401 | unauthorized | The credential is missing or invalid. | Check the full account credential. |
| 429 | rate_limit_exceeded | The account request limit was reached. | Wait for Retry-After. Reconcile uncertain writes before resending. |
Retry and idempotency
No idempotency key is documented. A timeout or 5xx can follow a committed change. Read the current state before deciding whether to submit again; never automatically repeat an uncertain write. Each accepted request appends a decision event; it is not a deduplicated update.Related endpoints
Authorizations
Path Parameters
Body
application/json