> ## 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.

# Update SMS reply settings

> Update reply behaviour for an owned Nixflex SMS campaign. This request does not edit the campaign's recipients, schedule or outbound message.

**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](https://docs.nixflex.com/ai-rules.md#campaigns)

Update reply behaviour for one owned SMS campaign. This operation does not edit its recipients, schedule or message template, and it is not a cancellation control.

Method: **PATCH** · Success: **200** · Scope: **Owning account**

**The important part**

* These settings control replies associated with the campaign.
* A saved reply setting does not launch or resend campaign messages.

[Business guide](https://docs.nixflex.com/guides/business/sms-campaigns.md) · [Developer guide](https://docs.nixflex.com/sms/sms-campaigns.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Authentication

Send `Authorization: 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 | Exact saved campaign\_id owned by this account. This operation does not declare a route-level length or character validator. |

Send at least one supported field. Omitted fields stay unchanged; unknown fields are ignored. Database constraints still apply.

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `is_active` | boolean | No | Omitted | Enable or disable reply behaviour; does not stop dispatch. |
| `reply_context_prompt` | string or null | No | Omitted | Replace reply instructions; null clears. |
| `reply_window_hours` | integer | No | Omitted | Saved reply association window in hours. Use a positive integer; no route-level range validator is declared. Minimum 1. |

The response is the campaign object directly, with no campaign wrapper. It contains saved counters, rather than the recomputed totals returned by list/detail. This route currently has no strict type/length validation before the database; empty updates, missing campaigns and database failures may return 500 server\_error. Read detail after an uncertain save.

## 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 | Public campaign ID. |
| `agent_id` | string | Owning agent ID. |
| `name` | string or null | Saved campaign label. |
| `from_number` | string or null | International number with + and digits; no spaces. Pattern: `^\+[1-9][0-9]{6,14}$`. |
| `schedule_type` | string | Saved now or schedule mode. |
| `scheduled_date` | string or null | Saved scheduled date. |
| `window_start_minutes` | integer or null | Configured start minute. |
| `window_end_minutes` | integer or null | Configured end minute. |
| `window_days` | array or null | Saved value. |
| `timezone` | string or null | Saved campaign time zone. |
| `source` | string | Saved origin label. |
| `status` | string | Current state; for example scheduled, launching, running, done, failed or cancelled. Treat new states conservatively. |
| `total_count` | integer | Count. Minimum 0. |
| `started_at` | string or null | Saved timestamp, or null. Format: date-time. |
| `completed_at` | string or null | Saved timestamp, or null. Format: date-time. |
| `created_at` | string or null | Saved timestamp, or null. Format: date-time. |
| `updated_at` | string or null | Saved timestamp, or null. Format: date-time. |
| `allow_wider_hours` | boolean | True only with confirmation evidence for the current policy revision. |
| `id` | string | Row ID of this campaign record (UUID); the opaque list cursor includes it. Use `campaign_id` in requests. Format: uuid. |
| `api_key_id` | string | Owning account ID, not its secret. |
| `message_template` | string | Saved text template. |
| `reply_context_prompt` | string or null | Saved reply instructions. |
| `reply_window_hours` | integer | Reply association window in hours. |
| `is_active` | boolean | Reply behaviour enabled flag; not a dispatch cancellation control. |
| `claimed_at` | string or null | Saved timestamp, or null. Format: date-time. |
| `sent_count` | integer | Rows accepted for sending, including delivered or replied rows. Can overlap with later failures. |
| `delivered_count` | integer | Delivered or replied rows. |
| `failed_count` | integer | Failed or undelivered rows. |
| `reply_count` | integer | Recipients marked replied. |
| `total_segments` | integer | Estimated sum of recipient segments. |

## 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.

```bash cURL theme={"dark"}
curl --request PATCH \
  --url "https://api.nixflex.com/v1/sms/campaigns/campaign_fixture" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"is_active":false,"reply_context_prompt":null,"reply_window_hours":1}'
```

```javascript Node theme={"dark"}
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.update("campaign_fixture", {"is_active": false, "reply_context_prompt": null, "reply_window_hours": 1});
```

```python Python theme={"dark"}
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.update('campaign_fixture', is_active=False, reply_context_prompt=None, reply_window_hours=1)
```

```powershell CLI (PowerShell) theme={"dark"}
$body = @'
{
  "is_active": false,
  "reply_context_prompt": null,
  "reply_window_hours": 1
}
'@
[IO.File]::WriteAllText('request-179.json', $body, (New-Object Text.UTF8Encoding $false))
nixflex sms campaigns update campaign_fixture --body '@request-179.json' --confirm --json --base-url "https://api.nixflex.com"
```

```json MCP theme={"dark"}
{
  "name": "update_sms_campaign",
  "arguments": {
    "id": "campaign_fixture",
    "body": {
      "is_active": false,
      "reply_context_prompt": null,
      "reply_window_hours": 1
    },
    "confirm": true
  }
}
```

## Example response

Illustrative `200` response. Identifiers and values are examples; some optional or compatibility fields are omitted.

```json Response theme={"dark"}
{
  "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": "Answer questions about this requested appointment reminder.",
  "reply_window_hours": 24,
  "is_active": true,
  "claimed_at": null,
  "sent_count": 0,
  "delivered_count": 0,
  "failed_count": 0,
  "reply_count": 0,
  "total_segments": 0
}
```

## 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.

| Status | Code | Meaning | What to do |
| - | - | - | - |
| 500 | [`server_error`](https://docs.nixflex.com/api-reference/errors#server_error) | The result could not be confirmed. | Read the current state before repeating a write. |
| 400 | [`invalid_json`](https://docs.nixflex.com/api-reference/errors#invalid_json) | Invalid JSON body. | Correct JSON syntax. |
| 413 | [`payload_too_large`](https://docs.nixflex.com/api-reference/errors#payload_too_large) | The request exceeds the JSON body limit. | Send a smaller request. |
| 401 | [`unauthorized`](https://docs.nixflex.com/api-reference/errors#unauthorized) | The credential is missing or invalid. | Check the full account credential. |
| 429 | [`rate_limit_exceeded`](https://docs.nixflex.com/api-reference/errors#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.

## Related endpoints

* [List SMS campaigns](https://docs.nixflex.com/api-reference/sms/campaigns-list.md)
* [Create an SMS campaign](https://docs.nixflex.com/api-reference/sms/campaigns-create.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json PATCH /sms/campaigns/{id}
openapi: 3.1.0
info:
  title: Nixflex public API
  version: 1.0.0
  description: >-
    Nixflex API reference for agents, calls, messaging, knowledge, organisations
    and integrations. Authenticate with the owning account and follow each
    operation’s permissions, response and retry contract.
servers:
  - url: https://api.nixflex.com/v1
security:
  - bearerAuth: []
paths:
  /sms/campaigns/{id}:
    patch:
      tags:
        - SMS campaigns
      summary: Update SMS reply settings
      description: >-
        Update reply behaviour for one owned SMS campaign. This operation does
        not edit its recipients, schedule or message template, and it is not a
        cancellation control. The response is the campaign object directly, with
        no campaign wrapper. It contains saved counters, rather than the
        recomputed totals returned by list/detail. This route currently has no
        strict type/length validation before the database; empty updates,
        missing campaigns and database failures may return 500 server_error.
        Read detail after an uncertain save.
      operationId: updateSmsCampaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: >-
              Exact saved campaign_id owned by this account. This operation does
              not declare a route-level length or character validator.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_active:
                  type: boolean
                  description: Enable or disable reply behaviour; does not stop dispatch.
                reply_context_prompt:
                  type:
                    - string
                    - 'null'
                  description: Replace reply instructions; null clears.
                reply_window_hours:
                  type: integer
                  description: >-
                    Saved reply association window in hours. Use a positive
                    integer; no route-level range validator is declared.
                  minimum: 1
              description: >-
                Send at least one supported field. Omitted fields stay
                unchanged; unknown fields are ignored. Database constraints
                still apply.
              additionalProperties: false
              minProperties: 1
            example:
              reply_context_prompt: Answer questions about this requested appointment reminder.
              reply_window_hours: 24
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign_id:
                    type: string
                    description: Public campaign ID.
                  agent_id:
                    type: string
                    description: Owning agent ID.
                  name:
                    type:
                      - string
                      - 'null'
                    description: Saved campaign label.
                  from_number:
                    type:
                      - string
                      - 'null'
                    description: International number with + and digits; no spaces.
                    pattern: ^\+[1-9][0-9]{6,14}$
                  schedule_type:
                    type: string
                    description: Saved now or schedule mode.
                  scheduled_date:
                    type:
                      - string
                      - 'null'
                    description: Saved scheduled date.
                  window_start_minutes:
                    type:
                      - integer
                      - 'null'
                    description: Configured start minute.
                  window_end_minutes:
                    type:
                      - integer
                      - 'null'
                    description: Configured end minute.
                  window_days:
                    type:
                      - array
                      - 'null'
                    items:
                      type: string
                      description: Weekday.
                    description: ''
                  timezone:
                    type:
                      - string
                      - 'null'
                    description: Saved campaign time zone.
                  source:
                    type: string
                    description: Saved origin label.
                  status:
                    type: string
                    description: >-
                      Current state; for example scheduled, launching, running,
                      done, failed or cancelled. Treat new states
                      conservatively.
                  total_count:
                    type: integer
                    description: Count.
                    minimum: 0
                  started_at:
                    type:
                      - string
                      - 'null'
                    description: Saved timestamp, or null.
                    format: date-time
                  completed_at:
                    type:
                      - string
                      - 'null'
                    description: Saved timestamp, or null.
                    format: date-time
                  created_at:
                    type:
                      - string
                      - 'null'
                    description: Saved timestamp, or null.
                    format: date-time
                  updated_at:
                    type:
                      - string
                      - 'null'
                    description: Saved timestamp, or null.
                    format: date-time
                  allow_wider_hours:
                    type: boolean
                    description: >-
                      True only with confirmation evidence for the current
                      policy revision.
                  id:
                    type: string
                    description: >-
                      Row ID of this campaign record (UUID); the opaque list
                      cursor includes it. Use `campaign_id` in requests.
                    format: uuid
                  api_key_id:
                    type: string
                    description: Owning account ID, not its secret.
                  message_template:
                    type: string
                    description: Saved text template.
                  reply_context_prompt:
                    type:
                      - string
                      - 'null'
                    description: Saved reply instructions.
                  reply_window_hours:
                    type: integer
                    description: Reply association window in hours.
                  is_active:
                    type: boolean
                    description: >-
                      Reply behaviour enabled flag; not a dispatch cancellation
                      control.
                  claimed_at:
                    type:
                      - string
                      - 'null'
                    description: Saved timestamp, or null.
                    format: date-time
                  sent_count:
                    type: integer
                    description: >-
                      Rows accepted for sending, including delivered or replied
                      rows. Can overlap with later failures.
                  delivered_count:
                    type: integer
                    description: Delivered or replied rows.
                  failed_count:
                    type: integer
                    description: Failed or undelivered rows.
                  reply_count:
                    type: integer
                    description: Recipients marked replied.
                  total_segments:
                    type: integer
                    description: Estimated sum of recipient segments.
                required:
                  - campaign_id
                  - agent_id
                  - name
                  - from_number
                  - schedule_type
                  - scheduled_date
                  - window_start_minutes
                  - window_end_minutes
                  - window_days
                  - timezone
                  - source
                  - status
                  - total_count
                  - started_at
                  - completed_at
                  - created_at
                  - updated_at
                  - allow_wider_hours
                  - id
                  - api_key_id
                  - message_template
                  - reply_context_prompt
                  - reply_window_hours
                  - is_active
                  - claimed_at
                  - sent_count
                  - delivered_count
                  - failed_count
                  - reply_count
                  - total_segments
                description: ''
                additionalProperties: false
              example:
                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: Answer questions about this requested appointment reminder.
                reply_window_hours: 24
                is_active: true
                claimed_at: null
                sent_count: 0
                delivered_count: 0
                failed_count: 0
                reply_count: 0
                total_segments: 0
        '400':
          description: 'invalid_json: Invalid JSON body.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '401':
          description: 'unauthorized: The credential is missing or invalid.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '413':
          description: 'payload_too_large: The request exceeds the JSON body limit.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '429':
          description: 'rate_limit_exceeded: The account request limit was reached.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '500':
          description: 'server_error: The result could not be confirmed.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.