Skip to main content
POST
/
v1
/
sms
/
campaigns
Create SMS campaign
curl --request POST \
  --url https://api.nixflex.com/v1/sms/campaigns

Documentation Index

Fetch the complete documentation index at: https://docs.nixflex.com/llms.txt

Use this file to discover all available pages before exploring further.

Creates an SMS campaign. Optionally launches it immediately.

Request

curl -X POST https://api.nixflex.com/v1/sms/campaigns \
  -H "Authorization: Bearer KEY_ID:KEY_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agent_125207e452f8714a",
    "from_number": "+447446466847",
    "name": "March promotion",
    "body": "Hi! 20% off cleanings this month at Acme Dental. Reply YES to book.",
    "recipients": [
      { "phone_number": "+447111000001" },
      { "phone_number": "+447111000002" }
    ],
    "context_prompt": "If they reply YES, offer any weekday next week 9am-5pm. If NO or STOP, just thank them.",
    "schedule_type": "now"
  }'

Body parameters

FieldTypeRequiredNotes
agent_idstringYesAgent handling replies
from_numberstringYesYour imported Twilio number
namestringYesDisplay name in dashboard
bodystringYesMessage text sent to every recipient
recipientsarrayYesUp to 10,000
context_promptstringNoReply guidance for the agent
schedule_typeenumYesnow or schedule
scheduled_atISO dateIf scheduleWhen to launch
reply_window_hoursintNoHours to listen for replies (default 24, max 720)

Response

201 Created:
{
  "campaign_id": "smsc_a1b2c3d4",
  "agent_id": "agent_125207e452f8714a",
  "name": "March promotion",
  "status": "running",
  "recipients_count": 2,
  "created_at": "2026-05-17T03:45:12Z"
}
When schedule_type is now, returns status: running and sends immediately. With schedule, returns status: scheduled — launch later with Launch SMS campaign.

Errors

See Errors. Common: agent_not_owned, from_number_not_owned, too_many_recipients, invalid_schedule.