---
title: "Cancel a campaign run"
method: POST
path: "/v1/campaigns/{id}/runs/{runId}/cancel"
tags: ["Campaigns"]
---

# Cancel a campaign run

`POST /v1/campaigns/{id}/runs/{runId}/cancel`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/campaigns/{id}/runs/{runId}/cancel`
- Auth: API key in header `x-api-key`

Best-effort cancellation: pending recipients are skipped, while deliveries already handed off for sending may finish. Returns the updated run.

## Path parameters

- `id` string, required
- `runId` string, required

## Response `200`

CampaignRunAction

- CampaignRunAction
  - `success` boolean, required
  - `item` CampaignRun, required
    - `id` string, required
    - `campaignId` string, required
    - `status` 'scheduled' | 'resolving' | 'dispatching' | 'paused' | 'completed' | 'cancelled' | 'failed', required
    - `scheduledFor` string, required
    - `idempotencyKey` string, nullable, required
    - `startedAt` string, nullable, required
    - `completedAt` string, nullable, required
    - `contentSnapshot` CampaignContent, required
      - `channel` 'email', required
      - `email` EmailContent, required
        - `subject` string, nullable
        - `html` string, nullable
        - `text` string, nullable
        - `attachments` EmailAttachment[], nullable
          - `filename` string, required
          - `content` string, nullable
          - `mediaId` string
          - `contentType` string, required
          - `size` integer, required
        - `publicationId` string
        - `inputContractId` string
        - `templateId` string
        - `templateSlug` string, nullable
        - `templateData` TemplateData
        - `locale` string
        - `timeZone` string
        - `inReplyToMessageId` string
        - `replyTo` string[], nullable
        - `unsubscribeGroupId` string
        - `tracking` EmailTrackingOverrideV1: Requested per-send engagement tracking policy. Recipient opt-out takes precedence, then explicit fields, organization defaults, and product defaults.
          - `opens` boolean: Override open tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking.
          - `clicks` boolean: Override click tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking.
        - `footer` EmailFooterOverride
          - `enabled` boolean, nullable
      - `conversationId` string
      - `metadata` CampaignContentMetadata, nullable
    - `audienceSnapshot` CampaignAudience, required
      - `includeTags` string[], nullable
      - `excludeTags` string[], nullable
      - `contactIds` ContactId[], nullable
      - `groupIds` ContactGroupId[], nullable
    - `policySnapshot` CampaignPolicy, required
      - `unsubscribeGroupId` string
      - `pageSize` integer, nullable
    - `totalRecipients` number, required
    - `dispatchedCount` number, required
    - `failedCount` number, required
    - `skippedCount` number, required
    - `pendingCount` number, required
    - `skippedReasons` CampaignRunSkippedReason[], required
      - `reason` 'unsubscribed' | 'blocked' | 'suppressed' | 'opted_out' | 'unreachable' | 'no_identity' | 'inactive' | 'run_cancelled' | 'run_failed', required
      - `count` number, required
    - `estimatedCompletionAt` string, nullable, required
    - `failureReason` string, nullable, required
    - `holdReason` string, nullable, required
    - `holdDomainId` string, required
    - `holdUntil` string, nullable, required
    - `capacityWarning` string, nullable, required
    - `lastContactId` string, nullable, required
    - `createdBy` string, nullable, required
    - `actorEmail` string, required
    - `memberRole` string, required
    - `createdAt` string, required
    - `updatedAt` string, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError
- `500`: InternalError
- `502`: ExternalServiceError
- `504`: GatewayTimeoutError

---

[API](https://skmtc.dev/samva/apis/samva-api.md) · [All operations](https://skmtc.dev/samva/apis/samva-api/llms.txt) · [OpenAPI document](https://skmtc.dev/samva/apis/samva-api/revisions/a99408542cc3?raw)
