---
title: "Create campaign"
method: POST
path: "/campaign"
tags: ["Campaigns"]
---

# Create campaign

`POST /campaign`

## Request

- Base URL: `https://app.freyavoice.ai/api/v2`
- URL: `https://app.freyavoice.ai/api/v2/campaign`
- Auth: HTTP bearer

Creates an outbound voice campaign and schedules calls to the provided customers.

## Request body

- PostCampaignRequest
  - `name` string, required
  - `assistantId` string: ID of the AI assistant
  - `assistantName` string: Name of the AI assistant (alternative to assistantId)
  - `description` string
  - `startDate` string, date: When campaign starts (YYYY-MM-DD). Omit for immediate start.
  - `startTime` string: Time on start date (HH:MM). Also defines retry window start.
  - `timezone` string: IANA timezone for all times (e.g., Europe/Prague)
  - `endTime` string: Daily retry window end (HH:MM). Retries only happen between startTime-endTime.
  - `activeDays` integer[]: Days retries can happen (0=Monday, 6=Sunday)
  - `phoneNumber` string: Caller ID phone number
  - `callRetries` integer: Number of retry attempts (0-10)
  - `retryDelaySeconds` integer: Delay between retries in seconds (0-86400)
  - `retryDelayMode` 'fixed' | 'next_day'
  - `retryConditions` string[]: Array of call outcome values to retry on (SipCodeCategory + special endedReason values)
  - `webhookUrl` string
  - `customers` CampaignCustomer[]: List of customers to call
    - `phoneNumber` string, required
    - `properties` object, nullable: Custom properties to pass to the agent
  - `phoneList` string[]: Simple list of phone numbers (alternative to customers)
  - `workspaceId` string

## Response `200`

Campaign created

- object
  - `success` true, required
  - `data` object, required
    - `message` string, required
    - `result` CampaignResponse, required
      - `status` string, required
      - `isScheduled` boolean, required
      - `campaign` Campaign, required
        - `id` string, required
        - `assistantId` string, nullable
        - `phoneNumberId` string, nullable
        - `name` string, required
        - `description` string, nullable
        - `status` 'draft' | 'scheduled' | 'active' | 'completed' | 'partially_completed'
        - `startDate` string, date, nullable: When campaign starts (YYYY-MM-DD)
        - `startTime` string, nullable: Time on start date + retry window start (HH:MM)
        - `timezone` string: IANA timezone for all times
        - `endTime` string, nullable: Daily retry window end (HH:MM)
        - `activeDays` integer[]: Days retries can happen (0=Monday, 6=Sunday)
        - `phoneNumber` string, nullable
        - `callRetries` integer
        - `retryDelaySeconds` integer: Delay between retries in seconds
        - `retryDelayMode` 'fixed' | 'next_day'
        - `retryConditions` string[]: Array of call outcome values to retry on (SipCodeCategory + special endedReason values)
        - `endDate` string, date, nullable: @deprecated - No longer used
        - `schedulingMode` 'even' | 'fixed': @deprecated - No longer used
        - `callIntervalSeconds` integer: @deprecated - No longer used
        - `maxConcurrency` integer: Internal parameter (hardcoded to 5)
        - `webhookUrl` string, nullable
        - `customers` CampaignCustomer[]
          - `phoneNumber` string, required
          - `properties` object, nullable: Custom properties to pass to the agent
        - `callIds` string[]
        - `roomNames` string[]
        - `events` CampaignEvent[]
          - `event` string, required
          - `timestamp` string, date-time, required
          - `metadata` object, required
          - `message` string, required
          - `data` unknown
        - `version` 'v1' | 'v2'
        - `workspaceId` string, required
        - `createdAt` string, required
        - `updatedAt` string, required
      - `message` string, required

## Other responses

- `400`: Validation error
- `401`: Missing or invalid token
- `404`: Phone number or assistant not found
- `500`: Server error

---

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