> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ringg.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To search or read these docs, connect the Ringg docs MCP server at https://docs.ringg.ai/mcp (no key needed; tools search_ringg_ai and query_docs_filesystem_ringg_ai) instead of browsing pages one by one. Setup for each client: https://docs.ringg.ai/resources/mcp-server/docs-mcp-server/mcp-for-ai-assistants.md
> The dashboard labels agents "Assistants"; these docs say "agent". Both mean the same object, identified by agent_id.
> API base URL: https://prod-api.ringg.ai/ca/api/v0. Send the workspace API key in the X-API-KEY header, from server-side code only.
> Placing a call dials a real phone number and spends credits. Confirm the number with the user before calling.
> To act on a Ringg workspace (place calls, edit agents, read transcripts), use the separate Ringg workspace MCP server at https://mcp.ringg.ai/mcp: https://docs.ringg.ai/resources/mcp-server/workspace-mcp-server/overview.md

# Terminate Calls by Campaign ID

> Stop a campaign by cancelling all of its queued and retry calls with PATCH /campaign/terminate; its status changes to terminated and no new calls go out.

export const RelatedTopics = ({items}) => <div className="not-prose mt-12">
    <div className="text-sm font-medium text-gray-500 dark:text-zinc-400 mb-3">Related topics</div>
    <div className="flex flex-col gap-2.5">
      {items.map(([title, href]) => <a key={href} href={href} className="flex items-center gap-2.5 text-sm text-gray-700 hover:text-gray-950 dark:text-zinc-300 dark:hover:text-white">
          <Icon icon="file-text" size={16} color="currentColor" />
          {title}
        </a>)}
    </div>
  </div>;

<ParamField header="X-API-KEY" type="string" required>
  Your Ringg AI API key.
</ParamField>

<ParamField body="campaign_id" type="string" required>
  The campaign's ID: `id` from [Get all campaigns](/api-reference/endpoint/campaign/get-all-campaigns), which is also the `list_id` or `bulk_list_id` returned when the list was uploaded. Example: `00000000-0000-4000-8000-000000000103`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH "https://prod-api.ringg.ai/ca/api/v0/campaign/terminate" \
    --header "X-API-KEY: $RINGG_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{ "campaign_id": "00000000-0000-4000-8000-000000000103" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  { "message": "Calls terminated successfully!" }
  ```
</ResponseExample>

## What happens

* Calls with status `registered` (queued) or `retry` are cancelled (`cancelled`, sub-status `USER_TERMINATED`); calls in other campaigns are not affected.
* A call already in progress is not hung up. It ends normally and is not retried afterwards.
* Completed calls are not affected.
* The campaign's status becomes `terminated`.
* To call the remaining contacts later, create a new campaign.

## Errors

* `200` is returned even when no call matched the ID; check the calls in [call history](/api-reference/endpoint/history/get-call-history).
* `401`: `X-API-KEY` is missing or invalid.
* `422`: no field, more than one way of choosing calls at once, or a field of the wrong type.

<RelatedTopics items={[["Terminate a campaign", "/documentation/deploy/campaigns/manage-a-campaign#terminate-a-campaign"], ["by campaign numbers", "/api-reference/endpoint/terminate/campaign-numbers"]]} />


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