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

# Schedule a campaign run

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

## Request

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

Schedules an email campaign run at the absolute ISO-8601 instant in scheduledFor, or immediately when omitted. The optional idempotencyKey is scoped to the organization and replays return the original run. An email campaign must carry the brand footer: it is refused with CampaignFooterRequiredError when its footer is off and its template renders no BrandFooter, and with BrandAddressRequiredError when a brand that signs it off has no postal address.

## Path parameters

- `id` string, required

## Request body

- object
  - `scheduledFor` string, nullable
  - `idempotencyKey` string, nullable

## Response `201`

Success

- CampaignRun
  - `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`: FlagDisabledError | ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError | BrandAddressRequiredError | CampaignFooterRequiredError
- `500`: InternalError
- `502`: ExternalServiceError
- `503`: SenderNotReadyError
- `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)
