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

# Create a campaign

`POST /campaign`

Create a campaign

## Request body

- object
  - `name` string, required — The name of the campaign
  - `description` string — The description of the campaign
  - `audienceId` string, required — The ID of the audience
  - `agentId` string, required — The ID of the agent
  - `phoneNumberIds` string[] — Optional list of caller-ID phone number IDs to rotate across when placing outbound calls for this campaign. If omitted, the agent's default phone number is used.
  - `scheduledAt` string, date-time — Optional ISO-8601 timestamp for when the campaign should start dialing. Must be in the future. If provided, the campaign is created in `scheduled` status; otherwise it starts in `draft` status and must be started manually.
  - `maxRetries` integer — Maximum number of times a failed call is retried before the participant is marked as failed. `0` disables retries.
  - `retryDelay` integer — Delay in minutes between retry attempts for a failed call.

## Response `201`

Campaign created successfully. Note: the response is the raw Mongoose document — `agentId`
and `audienceId` are plain ObjectId strings here, not nested objects as returned by GET endpoints.

- object
  - `status` boolean
  - `data` object
    - `_id` string — The unique identifier for the campaign
    - `name` string — The name of the campaign
    - `description` string — The description of the campaign
    - `organization` string — The ID of the organization
    - `agentId` string — Raw ObjectId of the agent (not a nested object)
    - `createdBy` string — The ID of the user who created the campaign
    - `audienceId` string — Raw ObjectId of the audience (not a nested object)
    - `participantsCount` integer — The number of participants in the campaign
    - `scheduledAt` string, date-time — The scheduled start time, if provided at creation.
    - `maxRetries` integer — Maximum retries per failed call (echoes request).
    - `retryDelay` integer — Delay in minutes between retry attempts (echoes request).
    - `retryAttempts` integer — Number of retries attempted so far across the campaign.
    - `status` 'draft' | 'scheduled' | 'processing' | 'running' | 'paused' | 'completed' | 'failed' — Current campaign status.
    - `createdAt` string, date-time — The date and time when the campaign was created
    - `updatedAt` string, date-time — The date and time when the campaign was last updated

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `403` — Forbidden access
- `500` — Internal server error

---

[API](https://skmtc.net/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.net/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/c2d0eb64b01a/schema)
