Docs
Open dashboard

Terminate SMS campaign

POST/sms-campaigns/{id}/terminate

Stops the campaign permanently and marks the queued contacts as cancelled. Returns 409 if already terminal.

Requires Authorization: Bearer <api_key>. Create a key in the Inspra dashboard under Workspace Settings → API Keys.

Path parameters

  • idstringrequired
    UUID of the resource.

Response 200 OK

Termination result.

  • successbooleanrequired
    Always true when the API returned 200.
  • providerstringnullableoptional
    Underlying telephony/agent provider that processed the termination, if applicable.
  • messagestringnullableoptional
    Human-readable note about the termination (e.g. how many in-flight calls were drained).
  • campaignobjectrequired
    Campaign resource. Fields mirror serializeCampaign in lib/campaigns/campaign-serializer.ts. effective_status is derived at read time (see lib/campaigns/effective-status.ts).
    40 fields
    • idstringoptional
      Stable UUID of the campaign.
    • workspace_idstringoptional
      UUID of the owning workspace.
    • agent_idstringnullableoptional
      UUID of the agent that places calls for this campaign.
    • namestringoptional
      Human-readable campaign name. 1-255 chars.
    • descriptionstringnullableoptional
      Optional free-form notes.
    • statusstringnullableoptional
      Raw DB status. One of draft, ready, scheduled, active, paused, completed, cancelled, expired. Prefer effective_status for UI display.
    • effective_statusstringnullableoptional
      User-visible status. Equals status except when the campaign has a non-terminal status and scheduled_expires_at has passed — then expired is returned. Possible values: draft, ready, scheduled, active, paused, completed, cancelled, expired.
    • schedule_typestringnullableoptional
      One of immediate (start when activated) or scheduled (wait for scheduled_start_at).
    • scheduled_start_atstringnullableoptional
      ISO 8601 UTC timestamp the campaign is scheduled to start. Null for immediate campaigns.
    • scheduled_expires_atstringnullableoptional
      ISO 8601 UTC timestamp after which the campaign is considered expired. Null = no expiry.
    • business_hours_onlybooleannullableoptional
      When true, calls only place within business_hours_config. See CampaignCreate for the config shape.
    • timezonestringnullableoptional
      IANA Time Zone for business-hours evaluation (e.g. America/New_York, Australia/Melbourne).
    • total_recipientsintegernullableoptional
      Count of recipients loaded into the campaign.
    • pending_callsintegernullableoptional
      Recipients not yet called.
    • completed_callsintegernullableoptional
      Recipients whose call lifecycle finished (any outcome).
    • successful_callsintegernullableoptional
      Calls where the recipient answered and the analyser marked a positive outcome.
    • failed_callsintegernullableoptional
      Calls that exhausted retries without a positive outcome (busy, no-answer, declined, etc.).
    • created_atstringnullableoptional
      ISO 8601 UTC timestamp when the campaign was created.
    • updated_atstringnullableoptional
      ISO 8601 UTC timestamp of the last update.
    • started_atstringnullableoptional
      ISO 8601 UTC timestamp the campaign first transitioned to active.
    • completed_atstringnullableoptional
      ISO 8601 UTC timestamp the campaign reached a terminal state. Null while in progress.
    • channelstringnullableoptional
      call (default) or sms. Determines which engine runs the campaign; SMS campaigns carry the sms_* fields below.
    • business_hours_configobjectnullableoptional
      Resolved business-hours config as stored — always in the {enabled, timezone, schedule, batchConcurrency} form, with schedule keyed by full day names holding arrays of windows. A days-shaped request body is normalised into this on write.
    • holidays_configobjectnullableoptional
      Holiday calendar ({country, holidays[]}) — dialling is skipped on enabled dates.
    • batch_concurrencyintegernullableoptional
      Recipients dispatched per batch wave (1-40).
    • sip_trunk_idstringnullableoptional
      UUID of the SIP trunk this campaign dials over. Null = provider default routing.
    • cli_modestringnullableoptional
      default (single agent-derived caller ID) or group (rotate across the numbers in cli_group_config).
    • cli_group_configobject[]nullableoptional
      Caller-ID rotation spec used when cli_mode=group. Each entry allocates count recipients to one number on the trunk.
      3 fields
      • phoneNumberIdstringoptional
      • phoneE164stringoptional
      • countintegeroptional
    • ivr_enabledbooleannullableoptional
      When true, outbound calls carry IVR-navigation metadata to the provider.
    • call_screen_enabledbooleannullableoptional
      When true, outbound calls are sent with call-screening handling enabled.
    • double_dialbooleannullableoptional
      When true, an unanswered number is dialled a second time immediately.
    • csv_column_headersstring[]nullableoptional
      Column headers of the source import, retained for display and mapping.
    • sms_modestringnullableoptional
      SMS campaigns only. one_way or conversational.
    • sms_message_sourcestringnullableoptional
      SMS campaigns only. custom (uses sms_message_body) or flow (uses sms_flow_id).
    • sms_message_bodystringnullableoptional
      SMS campaigns only. The composed message template.
    • sms_flow_idstringnullableoptional
      SMS campaigns only. UUID of the Automations flow that drives the campaign.
    • sms_carrierstringnullableoptional
      SMS campaigns only. twilio, atmic or touchsms.
    • sms_from_numberstringnullableoptional
      SMS campaigns only. Sending number.
    • sms_rate_per_minuteintegernullableoptional
      SMS campaigns only. Send throttle, 1-600 messages per minute.
    • agentobjectoptional
      Compact snapshot of the assigned agent (id, name, provider, is_active). Read-only.
      4 fields
      • idstringoptional
      • namestringoptional
      • providerstringoptional
      • is_activebooleanoptional

Errors

  • 401Unauthorized
    Missing, malformed, or invalid API key.
  • 403Forbidden
    Workspace unavailable, suspended, or paywalled.
  • 404Not Found
    Resource not found in this workspace.
  • 409Conflict
    Request conflicts with current resource state.
  • 429Too Many Requests
    Workspace request limit exceeded; shared across all its API keys.