curl --request GET \
--url "https://api.nixflex.com/v1/sms/campaigns/campaign_fixture?limit=2" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.sms.campaigns.get("campaign_fixture", {"limit": 2});
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.sms.campaigns.get('campaign_fixture', limit=2)
nixflex sms campaigns get campaign_fixture --limit 2 --json --base-url "https://api.nixflex.com"
{
"name": "get_sms_campaign",
"arguments": {
"limit": 2,
"campaign_id": "campaign_fixture"
}
}
{
"campaign": {
"campaign_id": "campaign_example",
"agent_id": "agent_example",
"name": "Example SMS campaign",
"from_number": "+12025550101",
"schedule_type": "schedule",
"scheduled_date": "2030-11-04",
"window_start_minutes": null,
"window_end_minutes": null,
"window_days": null,
"timezone": null,
"source": "api",
"status": "scheduled",
"total_count": 1,
"started_at": null,
"completed_at": null,
"created_at": "2026-11-01T12:00:00Z",
"updated_at": "2026-11-01T12:00:00Z",
"allow_wider_hours": false,
"id": "00000000-0000-4000-8000-000000000001",
"api_key_id": "nxf_example",
"message_template": "Your requested reminder.",
"reply_context_prompt": null,
"reply_window_hours": 168,
"is_active": true,
"claimed_at": null,
"sent_count": 0,
"delivered_count": 0,
"failed_count": 0,
"reply_count": 0,
"total_segments": 0,
"pending_count": 1,
"segments_estimated": true
},
"recipients": [],
"messages": [],
"pagination": {
"recipient_cursor": null,
"message_cursor": null,
"limit": 1,
"paged": true
}
}
SMS campaigns
Get an SMS campaign
Read one owned SMS campaign with recipient and message history. The campaign counters cover the whole campaign; the two history lists have independent cursors.
GET
/
sms
/
campaigns
/
{id}
curl --request GET \
--url "https://api.nixflex.com/v1/sms/campaigns/campaign_fixture?limit=2" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.sms.campaigns.get("campaign_fixture", {"limit": 2});
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.sms.campaigns.get('campaign_fixture', limit=2)
nixflex sms campaigns get campaign_fixture --limit 2 --json --base-url "https://api.nixflex.com"
{
"name": "get_sms_campaign",
"arguments": {
"limit": 2,
"campaign_id": "campaign_fixture"
}
}
{
"campaign": {
"campaign_id": "campaign_example",
"agent_id": "agent_example",
"name": "Example SMS campaign",
"from_number": "+12025550101",
"schedule_type": "schedule",
"scheduled_date": "2030-11-04",
"window_start_minutes": null,
"window_end_minutes": null,
"window_days": null,
"timezone": null,
"source": "api",
"status": "scheduled",
"total_count": 1,
"started_at": null,
"completed_at": null,
"created_at": "2026-11-01T12:00:00Z",
"updated_at": "2026-11-01T12:00:00Z",
"allow_wider_hours": false,
"id": "00000000-0000-4000-8000-000000000001",
"api_key_id": "nxf_example",
"message_template": "Your requested reminder.",
"reply_context_prompt": null,
"reply_window_hours": 168,
"is_active": true,
"claimed_at": null,
"sent_count": 0,
"delivered_count": 0,
"failed_count": 0,
"reply_count": 0,
"total_segments": 0,
"pending_count": 1,
"segments_estimated": true
},
"recipients": [],
"messages": [],
"pagination": {
"recipient_cursor": null,
"message_cursor": null,
"limit": 1,
"paged": 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
Do not send a request body.
Provide limit to request bounded pages. Each list is ordered by id ascending and advances independently. Keep an exhausted list finished in your client; omitting its cursor restarts that list. A full page can return a cursor even at the end, so another empty read may be needed.
Without limit or cursors, the server collects history in 200-row chunks, with a 100,000-row ceiling per list, then sorts by created_at ascending with missing timestamps last. This compatibility mode is not a snapshot. Invalid limits or malformed UUID cursors currently return 500 server_error; a missing campaign or failed initial lookup returns 404 not_found. Retention can remove content between reads.
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 one owned SMS campaign with recipient and message history. The campaign counters cover the whole campaign; the two history lists have independent cursors.
Method: GET ·
Success: 200 ·
Scope: Owning account
The important part
- Read this campaign before changing its state.
- Keep accepted, pending, failed and uncertain recipient results distinct.
Authentication
SendAuthorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential.
Request fields
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
id (path) | string | Yes | None | Exact saved campaign_id owned by this account. This operation does not declare a route-level length or character validator. |
limit (query) | integer | No | Omitted | Supplying this enables paging; page default 200, maximum 500. Minimum 1. Maximum 500. |
recipient_cursor (query) | string | No | Omitted | Last recipient UUID from pagination.recipient_cursor. Format: uuid. |
message_cursor (query) | string | No | Omitted | Last message UUID from pagination.message_cursor. Format: uuid. |
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 | Saved value. |
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.id | string | Row ID of this campaign record (UUID); the opaque list cursor includes it. Use campaign_id in requests. Format: uuid. |
campaign.api_key_id | string | Owning account ID, not its secret. |
campaign.message_template | string | Saved text template. |
campaign.reply_context_prompt | string or null | Saved reply instructions. |
campaign.reply_window_hours | integer | Reply association window in hours. |
campaign.is_active | boolean | Reply behaviour enabled flag; not a dispatch cancellation control. |
campaign.claimed_at | string or null | Saved timestamp, or null. Format: date-time. |
campaign.sent_count | integer | Rows accepted for sending, including delivered or replied rows. Can overlap with later failures. |
campaign.delivered_count | integer | Delivered or replied rows. |
campaign.failed_count | integer | Failed or undelivered rows. |
campaign.reply_count | integer | Recipients marked replied. |
campaign.total_segments | integer | Estimated sum of recipient segments. |
campaign.pending_count | integer | Rows pending or queued. |
campaign.segments_estimated | boolean | Reported segments are estimates. Value: true. |
recipients | array of object | Saved value. |
recipients[].id | string | Recipient row ID. Format: uuid. |
recipients[].campaign_id | string | Campaign ID. |
recipients[].api_key_id | string | Owner account ID. |
recipients[].phone_number | string | International number with + and digits; no spaces. Pattern: ^\+[1-9][0-9]{6,14}$. |
recipients[].variables | object | Saved template variables. |
recipients[].rendered_message | string or null | Rendered outgoing message. |
recipients[].status | string | Recipient state. |
recipients[].segments_count | integer or null | Estimated segment count. |
recipients[].sent_at | string or null | Saved timestamp, or null. Format: date-time. |
recipients[].delivered_at | string or null | Saved timestamp, or null. Format: date-time. |
recipients[].replied_at | string or null | Saved timestamp, or null. Format: date-time. |
recipients[].error_message | string or null | Saved failure explanation. |
recipients[].created_at | string or null | Saved timestamp, or null. Format: date-time. |
recipients[].updated_at | string or null | Saved timestamp, or null. Format: date-time. |
recipients[].timezone | string or null | Recipient time zone. |
recipients[].country | string or null | Recipient country. |
recipients[].timezone_source | string or null | Location evidence source. |
recipients[].hold_reason | string or null | Current contact hold. |
recipients[].next_eligible_at | string or null | Saved timestamp, or null. Format: date-time. |
messages | array of object | Saved value. |
messages[].id | string | Message row ID. Format: uuid. |
messages[].agent_id | string | Agent ID. |
messages[].api_key_id | string | Owner account ID. |
messages[].phone_number | string or null | International number with + and digits; no spaces. Pattern: ^\+[1-9][0-9]{6,14}$. |
messages[].from_number | string or null | International number with + and digits; no spaces. Pattern: ^\+[1-9][0-9]{6,14}$. |
messages[].to_number | string or null | International number with + and digits; no spaces. Pattern: ^\+[1-9][0-9]{6,14}$. |
messages[].direction | string | Message direction. |
messages[].message | string or null | Message text. |
messages[].campaign_id | string or null | Associated campaign ID. |
messages[].segments_count | integer or null | Estimated segments. |
messages[].sent_at | string or null | Saved timestamp, or null. Format: date-time. |
messages[].delivered_at | string or null | Saved timestamp, or null. Format: date-time. |
messages[].created_at | string or null | Saved timestamp, or null. Format: date-time. |
messages[].context_type | string or null | Reply context type. |
messages[].context_prompt | string or null | Reply instructions. |
messages[].context_data | object or null | Associated context. |
messages[].linked_call_id | string or null | Linked call if present. |
messages[].delivery_status | string or null | Saved delivery status. |
messages[].reply_to_sms_id | string or null | Linked original message ID. |
pagination | object | Saved value. |
pagination.recipient_cursor | string or null | Next recipient cursor. |
pagination.message_cursor | string or null | Next message cursor. |
pagination.limit | integer | Effective per-list page size. |
pagination.paged | boolean | Whether explicit pagination was requested. |
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 is the first page; use only cursors returned by the API for subsequent pages.
curl --request GET \
--url "https://api.nixflex.com/v1/sms/campaigns/campaign_fixture?limit=2" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.sms.campaigns.get("campaign_fixture", {"limit": 2});
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.sms.campaigns.get('campaign_fixture', limit=2)
nixflex sms campaigns get campaign_fixture --limit 2 --json --base-url "https://api.nixflex.com"
{
"name": "get_sms_campaign",
"arguments": {
"limit": 2,
"campaign_id": "campaign_fixture"
}
}
Example response
Illustrative200 response. Identifiers and values are examples; some optional or compatibility fields are omitted.
{
"campaign": {
"campaign_id": "campaign_example",
"agent_id": "agent_example",
"name": "Example SMS campaign",
"from_number": "+12025550101",
"schedule_type": "schedule",
"scheduled_date": "2030-11-04",
"window_start_minutes": null,
"window_end_minutes": null,
"window_days": null,
"timezone": null,
"source": "api",
"status": "scheduled",
"total_count": 1,
"started_at": null,
"completed_at": null,
"created_at": "2026-11-01T12:00:00Z",
"updated_at": "2026-11-01T12:00:00Z",
"allow_wider_hours": false,
"id": "00000000-0000-4000-8000-000000000001",
"api_key_id": "nxf_example",
"message_template": "Your requested reminder.",
"reply_context_prompt": null,
"reply_window_hours": 168,
"is_active": true,
"claimed_at": null,
"sent_count": 0,
"delivered_count": 0,
"failed_count": 0,
"reply_count": 0,
"total_segments": 0,
"pending_count": 1,
"segments_estimated": true
},
"recipients": [],
"messages": [],
"pagination": {
"recipient_cursor": null,
"message_cursor": null,
"limit": 1,
"paged": 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 |
|---|---|---|---|
| 404 | not_found | No matching object belongs to this account. | Check the account and identifier. |
| 500 | server_error | The result could not be confirmed. | Read the current state before repeating a write. |
| 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. |