curl --request GET \
--url "https://api.nixflex.com/v1/campaigns/$NXF_CAMPAIGN_ID" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
const base = 'https://api.nixflex.com'.replace(/\/$/, '');
const id = encodeURIComponent(process.env.NXF_CAMPAIGN_ID);
const response = await fetch(`${base}/v1/campaigns/${id}`, {
headers: { Authorization: `Bearer ${process.env.NIXFLEX_API_KEY}` },
});
const result = await response.json();
if (!response.ok) throw new Error(result.error?.code ?? `HTTP ${response.status}`);
console.log(result.campaign);
import json
import os
from urllib.parse import quote
from urllib.request import Request, urlopen
base = "https://api.nixflex.com".rstrip("/")
campaign_id = quote(os.environ["NXF_CAMPAIGN_ID"], safe="")
request = Request(
f"{base}/v1/campaigns/{campaign_id}",
headers={"Authorization": f"Bearer {os.environ['NIXFLEX_API_KEY']}"},
)
with urlopen(request, timeout=20) as response:
result = json.load(response)
print(result["campaign"])
$base = 'https://api.nixflex.com'
$campaignId = [Uri]::EscapeDataString($env:NXF_CAMPAIGN_ID)
$result = Invoke-RestMethod -Method Get -Uri "$base/v1/campaigns/$campaignId" -Headers @{
Authorization = "Bearer $env:NIXFLEX_API_KEY"
}
$result.campaign
{
"campaign": {
"campaign_id": "campaign_example",
"agent_id": "agent_example",
"name": "Appointment reminders",
"prompt": null,
"from_number": "+12025550123",
"schedule_type": "schedule",
"scheduled_date": "2026-11-20",
"window_start_minutes": 540,
"window_end_minutes": 1020,
"window_days": [
"mon",
"tue",
"wed",
"thu",
"fri"
],
"timezone": "America/New_York",
"source": "api",
"status": "scheduled",
"total_count": 10,
"done_count": 0,
"failed_count": 0,
"voicemail_count": 0,
"started_at": null,
"completed_at": null,
"created_at": "2026-11-12T00:00:00Z",
"updated_at": "2026-11-12T00:00:00Z",
"allow_wider_hours": false
}
}
Voice campaigns
Get a voice campaign
Read one owned voice campaign, its saved schedule and current progress. Check wider-hours confirmation without retrieving recipients.
GET
/
campaigns
/
{id}
curl --request GET \
--url "https://api.nixflex.com/v1/campaigns/$NXF_CAMPAIGN_ID" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
const base = 'https://api.nixflex.com'.replace(/\/$/, '');
const id = encodeURIComponent(process.env.NXF_CAMPAIGN_ID);
const response = await fetch(`${base}/v1/campaigns/${id}`, {
headers: { Authorization: `Bearer ${process.env.NIXFLEX_API_KEY}` },
});
const result = await response.json();
if (!response.ok) throw new Error(result.error?.code ?? `HTTP ${response.status}`);
console.log(result.campaign);
import json
import os
from urllib.parse import quote
from urllib.request import Request, urlopen
base = "https://api.nixflex.com".rstrip("/")
campaign_id = quote(os.environ["NXF_CAMPAIGN_ID"], safe="")
request = Request(
f"{base}/v1/campaigns/{campaign_id}",
headers={"Authorization": f"Bearer {os.environ['NIXFLEX_API_KEY']}"},
)
with urlopen(request, timeout=20) as response:
result = json.load(response)
print(result["campaign"])
$base = 'https://api.nixflex.com'
$campaignId = [Uri]::EscapeDataString($env:NXF_CAMPAIGN_ID)
$result = Invoke-RestMethod -Method Get -Uri "$base/v1/campaigns/$campaignId" -Headers @{
Authorization = "Bearer $env:NIXFLEX_API_KEY"
}
$result.campaign
{
"campaign": {
"campaign_id": "campaign_example",
"agent_id": "agent_example",
"name": "Appointment reminders",
"prompt": null,
"from_number": "+12025550123",
"schedule_type": "schedule",
"scheduled_date": "2026-11-20",
"window_start_minutes": 540,
"window_end_minutes": 1020,
"window_days": [
"mon",
"tue",
"wed",
"thu",
"fri"
],
"timezone": "America/New_York",
"source": "api",
"status": "scheduled",
"total_count": 10,
"done_count": 0,
"failed_count": 0,
"voicemail_count": 0,
"started_at": null,
"completed_at": null,
"created_at": "2026-11-12T00:00:00Z",
"updated_at": "2026-11-12T00:00:00Z",
"allow_wider_hours": false
}
}
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
Do not send a request body. This endpoint has no pagination or recipient query fields.
The response sends
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
Read the saved schedule, progress and current wider-hours choice for one voice campaign.
Method: GET ·
Success: 200 ·
Scope: Owning account
The important part
- This read returns the same campaign fields as the list, without recipients.
- Wider-hours confirmation is checked against the current saved schedule.
- An unavailable result is an error, not an empty campaign or a false confirmation.
Authentication
SendAuthorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential. Owner, Admin and Member may read their account’s campaign in the signed-in dashboard. The public endpoint uses the existing API-key authentication and account scope.
Request fields
| Field | Type | Required | Limits and meaning |
|---|---|---|---|
id (path) | string | Yes | The exact saved campaign ID, 1–200 characters. Invalid, missing, foreign and deleted IDs share the same 404. |
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 | object | The owned campaign. |
campaign.campaign_id | string | Public campaign ID. |
campaign.agent_id | string | Owning agent ID. |
campaign.name | string or null | Saved campaign label. |
campaign.from_number | string or null | International number with + and digits; no spaces. Pattern: ^\+[1-9][0-9]{6,14}$. |
campaign.schedule_type | string | Saved now or schedule mode. |
campaign.scheduled_date | string or null | Saved scheduled date. |
campaign.window_start_minutes | integer or null | Configured start minute. |
campaign.window_end_minutes | integer or null | Configured end minute. |
campaign.window_days | array or null | Saved value. |
campaign.timezone | string or null | Saved campaign time zone. |
campaign.source | string | Saved origin label. |
campaign.status | string | Current state; for example scheduled, launching, running, done, failed or cancelled. Treat new states conservatively. |
campaign.total_count | integer | Count. Minimum 0. |
campaign.started_at | string or null | Saved timestamp, or null. Format: date-time. |
campaign.completed_at | string or null | Saved timestamp, or null. Format: date-time. |
campaign.created_at | string or null | Saved timestamp, or null. Format: date-time. |
campaign.updated_at | string or null | Saved timestamp, or null. Format: date-time. |
campaign.allow_wider_hours | boolean | True only with confirmation evidence for the current policy revision. |
campaign.prompt | string or null | Default voice instructions. |
campaign.done_count | integer | Count. Minimum 0. |
campaign.failed_count | integer | Count. Minimum 0. |
campaign.voicemail_count | integer | Count. Minimum 0. |
Cache-Control: no-store. Keep null values as null. allow_wider_hours is true only when the current saved hours and days have matching confirmation evidence. Missing or outdated evidence means false; a failed evidence read returns 503. Internal policy identifiers and account credentials are excluded.
Example request
These examples use HTTP directly. The SDK/CLI/MCP clients provide the campaign list; they do not add a dedicated detail method. SetNIXFLEX_API_KEY privately and NXF_CAMPAIGN_ID to an owned campaign. Raw HTTP base URL: https://api.nixflex.com/v1. Node and Python SDK base URL: https://api.nixflex.com. The SDK adds /v1.
curl --request GET \
--url "https://api.nixflex.com/v1/campaigns/$NXF_CAMPAIGN_ID" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
const base = 'https://api.nixflex.com'.replace(/\/$/, '');
const id = encodeURIComponent(process.env.NXF_CAMPAIGN_ID);
const response = await fetch(`${base}/v1/campaigns/${id}`, {
headers: { Authorization: `Bearer ${process.env.NIXFLEX_API_KEY}` },
});
const result = await response.json();
if (!response.ok) throw new Error(result.error?.code ?? `HTTP ${response.status}`);
console.log(result.campaign);
import json
import os
from urllib.parse import quote
from urllib.request import Request, urlopen
base = "https://api.nixflex.com".rstrip("/")
campaign_id = quote(os.environ["NXF_CAMPAIGN_ID"], safe="")
request = Request(
f"{base}/v1/campaigns/{campaign_id}",
headers={"Authorization": f"Bearer {os.environ['NIXFLEX_API_KEY']}"},
)
with urlopen(request, timeout=20) as response:
result = json.load(response)
print(result["campaign"])
$base = 'https://api.nixflex.com'
$campaignId = [Uri]::EscapeDataString($env:NXF_CAMPAIGN_ID)
$result = Invoke-RestMethod -Method Get -Uri "$base/v1/campaigns/$campaignId" -Headers @{
Authorization = "Bearer $env:NIXFLEX_API_KEY"
}
$result.campaign
Example response
Illustrative200 OK response with all campaign fields. Counters describe saved progress and do not guarantee that every recipient was reached.
{
"campaign": {
"campaign_id": "campaign_example",
"agent_id": "agent_example",
"name": "Appointment reminders",
"prompt": null,
"from_number": "+12025550123",
"schedule_type": "schedule",
"scheduled_date": "2026-11-20",
"window_start_minutes": 540,
"window_end_minutes": 1020,
"window_days": [
"mon",
"tue",
"wed",
"thu",
"fri"
],
"timezone": "America/New_York",
"source": "api",
"status": "scheduled",
"total_count": 10,
"done_count": 0,
"failed_count": 0,
"voicemail_count": 0,
"started_at": null,
"completed_at": null,
"created_at": "2026-11-12T00:00:00Z",
"updated_at": "2026-11-12T00:00:00Z",
"allow_wider_hours": false
}
}
Errors
Failures use the standard error envelope. Preserve the response status and code.| Status | Code | Meaning | What to do |
|---|---|---|---|
| 401 | unauthorized | The credential is missing or invalid. | Check the account and host. |
| 403 | permission_denied | The principal cannot access this account. | Check the account permission. |
| 404 | not_found | The ID is invalid, missing, foreign or deleted. | Check the owned ID; do not retry unchanged. |
| 429 | rate_limit_exceeded | The account request limit was reached. | Respect Retry-After. |
| 503 | campaign_unavailable | Campaign details or current confirmation evidence could not be checked. | Keep the previous view marked unavailable and retry the read with bounded backoff. |
Retry and idempotency
This request is read-only. Retry transient connection or server errors with bounded backoff. Do not turn 503 into an empty campaign, a false wider-hours choice or successful deletion. A later read can return newer progress. RespectCache-Control: no-store.