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

# Stop Campaign

> Stop campaign execution permanently.

Stop (cancel) a campaign permanently. Use this to terminate a running, paused, or scheduled campaign.

<Callout type="warning">
  Stopping a campaign marks all remaining pending contacts as cancelled. Use pause if you plan to resume later.
</Callout>

### Path Parameters

* `campaign_id` (integer, required): The unique identifier of the campaign

### Behavior

When you stop a campaign:

* Campaign status changes to `cancelled`
* **In-progress calls** may complete (provider-dependent)
* **Pending contacts** are marked as cancelled
* **Completion timestamp** is recorded
* Campaign cannot be resumed (use re-execute for new run)

### Valid Starting Statuses

You can stop campaigns that are:

* `running` - Currently executing
* `paused` - Temporarily paused
* `scheduled` - Waiting to start

### Response

```json Response theme={null}
{
  "message": "Campaign stopped successfully"
}
```

### Example Code

```bash cURL theme={null}
curl -X POST "https://api.burki.dev/api/v1/campaigns/42/stop" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.burki.dev/api/v1/campaigns/42/stop",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

if response.status_code == 200:
    print("Campaign stopped successfully")
else:
    print(f"Error: {response.json()}")
```

```javascript JavaScript theme={null}
const response = await fetch("https://api.burki.dev/api/v1/campaigns/42/stop", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY"
  }
});

if (response.ok) {
  console.log("Campaign stopped successfully");
} else {
  const error = await response.json();
  console.error("Error:", error);
}
```

### Error Responses

| Status Code | Description                                 |
| ----------- | ------------------------------------------- |
| 400         | Campaign cannot be stopped (invalid status) |
| 404         | Campaign not found                          |

### Pause vs Stop

| Action    | Resume Possible | Status      | Use Case                          |
| --------- | --------------- | ----------- | --------------------------------- |
| **Pause** | Yes             | `paused`    | Temporary break, plan to continue |
| **Stop**  | No              | `cancelled` | Permanent termination             |

### Re-running a Stopped Campaign

To run a stopped campaign again, use the [Re-execute Campaign](/api-reference/campaigns/re-execute) endpoint to reset contacts and start fresh.


## OpenAPI

````yaml POST /api/v1/campaigns/{campaign_id}/stop
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/campaigns/{campaign_id}/stop:
    post:
      tags:
        - campaigns
      summary: Stop Campaign
      description: Stop campaign execution permanently.
      operationId: stop_campaign_api_v1_campaigns__campaign_id__stop_post
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
            title: Campaign Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````