Terminate campaign
POST/campaigns/{id}/terminate
Stops the campaign permanently. Drains in-flight calls and marks pending recipients 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
- idstringrequiredUUID of the resource.
Response 200 OK
Termination result.
- successbooleanrequiredAlways
truewhen the API returned 200. - providerstringnullableoptionalUnderlying telephony/agent provider that processed the termination, if applicable.
- messagestringnullableoptionalHuman-readable note about the termination (e.g. how many in-flight calls were drained).
- campaignobjectrequiredCampaign resource. Fields mirror
serializeCampaigninlib/campaigns/campaign-serializer.ts.effective_statusis derived at read time (seelib/campaigns/effective-status.ts).40 fields
- idstringoptionalStable UUID of the campaign.
- workspace_idstringoptionalUUID of the owning workspace.
- agent_idstringnullableoptionalUUID of the agent that places calls for this campaign.
- namestringoptionalHuman-readable campaign name. 1-255 chars.
- descriptionstringnullableoptionalOptional free-form notes.
- statusstringnullableoptionalRaw DB status. One of
draft,ready,scheduled,active,paused,completed,cancelled,expired. Prefereffective_statusfor UI display. - effective_statusstringnullableoptionalUser-visible status. Equals
statusexcept when the campaign has a non-terminal status andscheduled_expires_athas passed — thenexpiredis returned. Possible values:draft,ready,scheduled,active,paused,completed,cancelled,expired. - schedule_typestringnullableoptionalOne of
immediate(start when activated) orscheduled(wait forscheduled_start_at). - scheduled_start_atstringnullableoptionalISO 8601 UTC timestamp the campaign is scheduled to start. Null for immediate campaigns.
- scheduled_expires_atstringnullableoptionalISO 8601 UTC timestamp after which the campaign is considered
expired. Null = no expiry. - business_hours_onlybooleannullableoptionalWhen true, calls only place within
business_hours_config. See CampaignCreate for the config shape. - timezonestringnullableoptionalIANA Time Zone for business-hours evaluation (e.g.
America/New_York,Australia/Melbourne). - total_recipientsintegernullableoptionalCount of recipients loaded into the campaign.
- pending_callsintegernullableoptionalRecipients not yet called.
- completed_callsintegernullableoptionalRecipients whose call lifecycle finished (any outcome).
- successful_callsintegernullableoptionalCalls where the recipient answered and the analyser marked a positive outcome.
- failed_callsintegernullableoptionalCalls that exhausted retries without a positive outcome (busy, no-answer, declined, etc.).
- created_atstringnullableoptionalISO 8601 UTC timestamp when the campaign was created.
- updated_atstringnullableoptionalISO 8601 UTC timestamp of the last update.
- started_atstringnullableoptionalISO 8601 UTC timestamp the campaign first transitioned to
active. - completed_atstringnullableoptionalISO 8601 UTC timestamp the campaign reached a terminal state. Null while in progress.
- channelstringnullableoptional
call(default) orsms. Determines which engine runs the campaign; SMS campaigns carry thesms_*fields below. - business_hours_configobjectnullableoptionalResolved business-hours config as stored — always in the
{enabled, timezone, schedule, batchConcurrency}form, withschedulekeyed by full day names holding arrays of windows. Adays-shaped request body is normalised into this on write. - holidays_configobjectnullableoptionalHoliday calendar (
{country, holidays[]}) — dialling is skipped on enabled dates. - batch_concurrencyintegernullableoptionalRecipients dispatched per batch wave (1-40).
- sip_trunk_idstringnullableoptionalUUID of the SIP trunk this campaign dials over. Null = provider default routing.
- cli_modestringnullableoptional
default(single agent-derived caller ID) orgroup(rotate across the numbers incli_group_config). - cli_group_configobject[]nullableoptionalCaller-ID rotation spec used when
cli_mode=group. Each entry allocatescountrecipients to one number on the trunk.3 fields
- phoneNumberIdstringoptional
- phoneE164stringoptional
- countintegeroptional
- ivr_enabledbooleannullableoptionalWhen true, outbound calls carry IVR-navigation metadata to the provider.
- call_screen_enabledbooleannullableoptionalWhen true, outbound calls are sent with call-screening handling enabled.
- double_dialbooleannullableoptionalWhen true, an unanswered number is dialled a second time immediately.
- csv_column_headersstring[]nullableoptionalColumn headers of the source import, retained for display and mapping.
- sms_modestringnullableoptionalSMS campaigns only.
one_wayorconversational. - sms_message_sourcestringnullableoptionalSMS campaigns only.
custom(usessms_message_body) orflow(usessms_flow_id). - sms_message_bodystringnullableoptionalSMS campaigns only. The composed message template.
- sms_flow_idstringnullableoptionalSMS campaigns only. UUID of the Automations flow that drives the campaign.
- sms_carrierstringnullableoptionalSMS campaigns only.
twilio,atmicortouchsms. - sms_from_numberstringnullableoptionalSMS campaigns only. Sending number.
- sms_rate_per_minuteintegernullableoptionalSMS campaigns only. Send throttle, 1-600 messages per minute.
- agentobjectoptionalCompact snapshot of the assigned agent (id, name, provider, is_active). Read-only.
4 fields
- idstringoptional
- namestringoptional
- providerstringoptional
- is_activebooleanoptional
Errors
- 401UnauthorizedMissing, malformed, or invalid API key.
- 403ForbiddenWorkspace unavailable, suspended, or paywalled.
- 404Not FoundResource not found in this workspace.
- 409ConflictRequest conflicts with current resource state.
- 429Too Many RequestsWorkspace request limit exceeded; shared across all its API keys.