> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.levrage.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.levrage.ai/_mcp/server.

# Create campaign

POST https://api.levrage.ai/v1/campaigns
Content-Type: application/json

Create a new campaign to call multiple contacts.

Supports scheduling, retry configuration, and blackout periods.

Reference: https://docs.levrage.ai/api-reference/campaigns/create-campaign

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects a CreateCampaignRequest.

- `name` (string, required) — Campaign name
- `agent_id` (string, required) — Voice agent UUID
- `phone_number` (string, required) — Source phone number
- `phone_column` (string, optional, nullable) — Field containing phone numbers: 'phone' for contacts if left out; for contacts_upload_id, the column Levrage found to hold phone numbers
- `contacts` (list of CreateCampaignRequestContactsItems, optional, nullable) — Contacts array (max 2000). For a bigger list use contacts_upload_id.
- `contacts_upload_id` (string, optional, nullable) — A sheet you uploaded (GET /v1/uploads) instead of contacts: every row with a phone number, up to 10,000 from first_row. Rows without a number are left out and counted.
- `first_row` (integer, optional, default: 1) — With contacts_upload_id: the first row to call (1 = the first under the header)
- `max_concurrent_calls` (integer, optional, default: 1) — Parallel calls (1-50)
- `schedule_time` (datetime, optional, nullable) — Schedule for future (ISO 8601)
- `timezone` (string, optional, nullable) — Timezone e.g. 'Asia/Kolkata'
- `start_time` (datetime, optional, nullable) — Campaign start time
- `end_time` (datetime, optional, nullable) — Campaign end time
- `daily_start_time` (string, optional, nullable) — Daily calling start HH:MM
- `daily_end_time` (string, optional, nullable) — Daily calling end HH:MM
- `retry_config` (RetryConfig, optional, nullable) — Retry settings for failed calls
- `blackout_periods` (list of BlackoutPeriod, optional, nullable) — No-call time windows

## Response

### 200

Successful Response

- `data` (CampaignData, required) — Campaign data inside response envelope.
- `request_id` (string, required)
- `timestamp` (datetime, required)
- `success` (boolean, optional, default: true)
- `from_file` (CampaignResponseFromFile, optional, nullable) — With contacts_upload_id: the file, the rows called (first_row–last_row), rows left out for having no phone number, and rows with a number left for another campaign (over 10,000)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### CreateCampaignRequestContactsItems

### RetryConfig

Retry configuration for failed/unanswered calls.

- `enabled` (boolean, optional, default: false) — Enable automatic retries
- `on_statuses` (list of string, optional) — Statuses to retry
- `interval_value` (integer, optional, default: 30) — Retry interval value
- `interval_unit` (string, optional, default: minutes) — Retry interval unit: minutes, hours, days
- `max_retries` (integer, optional, default: 3) — Maximum retry attempts
- `respect_calling_hours` (boolean, optional, default: true) — Only retry within daily calling hours

### BlackoutPeriod

Time period when no calls should be made.

- `start` (string, required) — Start time HH:MM (e.g. '21:00')
- `end` (string, required) — End time HH:MM (e.g. '09:00')

### CampaignData

Campaign data inside response envelope.

- `id` (string, required) — Campaign ID
- `name` (string, required) — Campaign name
- `status` (string, required) — pending, in_progress, completed, stopped, paused
- `description` (string, optional, nullable) — Campaign description
- `total_contacts` (integer, optional, default: 0) — Total calls in campaign
- `valid_contacts` (integer, optional, default: 0) — Valid contacts processed
- `skipped_contacts` (integer, optional, default: 0) — Skipped contacts
- `completed` (integer, optional, default: 0) — Completed calls
- `failed` (integer, optional, default: 0) — Failed calls
- `no_answer` (integer, optional, default: 0) — No answer calls
- `voicemail` (integer, optional, default: 0) — Voicemail calls
- `start_time` (datetime, optional, nullable) — Campaign start time
- `end_time` (datetime, optional, nullable) — Campaign end time
- `daily_start_time` (string, optional, nullable) — Daily calling start HH:MM
- `daily_end_time` (string, optional, nullable) — Daily calling end HH:MM
- `retry_enabled` (boolean, optional, default: false) — Whether retries are enabled
- `max_retries` (integer, optional, nullable) — Max retry attempts
- `pending_retries` (integer, optional, default: 0) — Calls pending retry
- `max_concurrent_calls` (integer, optional, default: 1) — Parallel calls
- `pickup_rate` (double, optional, nullable) — Pickup rate %
- `collection_rate` (double, optional, nullable) — Data collection rate %
- `created_at` (datetime, optional, nullable) — Creation timestamp
- `updated_at` (datetime, optional, nullable) — Last update timestamp

### CampaignResponseFromFile

With contacts_upload_id: the file, the rows called (first_row–last_row), rows left out for having no phone number, and rows with a number left for another campaign (over 10,000)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
{
  "name": "January Sales Outreach",
  "agent_id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "+919240018601",
  "phone_column": "phone",
  "contacts": [
    {
      "phone": "+919876543210",
      "name": "Rahul Sharma",
      "company": "TechCo"
    },
    {
      "phone": "+919876543211",
      "name": "Priya Patel",
      "company": "FinCo"
    }
  ],
  "max_concurrent_calls": 3
}
```

**Response**

```json
{
  "data": {
    "id": "c9f0c9e2-4d3a-4b7a-9f1e-2a3b4c5d6e7f",
    "name": "January Sales Outreach",
    "status": "pending",
    "description": null,
    "total_contacts": 2,
    "valid_contacts": 2,
    "skipped_contacts": 0,
    "completed": 0,
    "failed": 0,
    "no_answer": 0,
    "voicemail": 0,
    "start_time": null,
    "end_time": null,
    "daily_start_time": null,
    "daily_end_time": null,
    "retry_enabled": false,
    "max_retries": null,
    "pending_retries": 0,
    "max_concurrent_calls": 3,
    "pickup_rate": null,
    "collection_rate": null,
    "created_at": "2026-01-15T09:30:00+05:30",
    "updated_at": "2026-01-15T09:30:00+05:30"
  },
  "request_id": "req_a1b2c3d4e5f6",
  "timestamp": "2026-01-15T09:30:00+05:30",
  "success": true
}
```

**SDK Code**

```python
import requests

url = "https://api.levrage.ai/v1/campaigns"

payload = {
    "name": "January Sales Outreach",
    "agent_id": "550e8400-e29b-41d4-a716-446655440000",
    "phone_number": "+919240018601",
    "phone_column": "phone",
    "contacts": [
        {
            "phone": "+919876543210",
            "name": "Rahul Sharma",
            "company": "TechCo"
        },
        {
            "phone": "+919876543211",
            "name": "Priya Patel",
            "company": "FinCo"
        }
    ],
    "max_concurrent_calls": 3
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.levrage.ai/v1/campaigns';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"January Sales Outreach","agent_id":"550e8400-e29b-41d4-a716-446655440000","phone_number":"+919240018601","phone_column":"phone","contacts":[{"phone":"+919876543210","name":"Rahul Sharma","company":"TechCo"},{"phone":"+919876543211","name":"Priya Patel","company":"FinCo"}],"max_concurrent_calls":3}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.levrage.ai/v1/campaigns"

	payload := strings.NewReader("{\n  \"name\": \"January Sales Outreach\",\n  \"agent_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"phone_number\": \"+919240018601\",\n  \"phone_column\": \"phone\",\n  \"contacts\": [\n    {\n      \"phone\": \"+919876543210\",\n      \"name\": \"Rahul Sharma\",\n      \"company\": \"TechCo\"\n    },\n    {\n      \"phone\": \"+919876543211\",\n      \"name\": \"Priya Patel\",\n      \"company\": \"FinCo\"\n    }\n  ],\n  \"max_concurrent_calls\": 3\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.levrage.ai/v1/campaigns")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"January Sales Outreach\",\n  \"agent_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"phone_number\": \"+919240018601\",\n  \"phone_column\": \"phone\",\n  \"contacts\": [\n    {\n      \"phone\": \"+919876543210\",\n      \"name\": \"Rahul Sharma\",\n      \"company\": \"TechCo\"\n    },\n    {\n      \"phone\": \"+919876543211\",\n      \"name\": \"Priya Patel\",\n      \"company\": \"FinCo\"\n    }\n  ],\n  \"max_concurrent_calls\": 3\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.levrage.ai/v1/campaigns")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"January Sales Outreach\",\n  \"agent_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"phone_number\": \"+919240018601\",\n  \"phone_column\": \"phone\",\n  \"contacts\": [\n    {\n      \"phone\": \"+919876543210\",\n      \"name\": \"Rahul Sharma\",\n      \"company\": \"TechCo\"\n    },\n    {\n      \"phone\": \"+919876543211\",\n      \"name\": \"Priya Patel\",\n      \"company\": \"FinCo\"\n    }\n  ],\n  \"max_concurrent_calls\": 3\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.levrage.ai/v1/campaigns', [
  'body' => '{
  "name": "January Sales Outreach",
  "agent_id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "+919240018601",
  "phone_column": "phone",
  "contacts": [
    {
      "phone": "+919876543210",
      "name": "Rahul Sharma",
      "company": "TechCo"
    },
    {
      "phone": "+919876543211",
      "name": "Priya Patel",
      "company": "FinCo"
    }
  ],
  "max_concurrent_calls": 3
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.levrage.ai/v1/campaigns");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"January Sales Outreach\",\n  \"agent_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"phone_number\": \"+919240018601\",\n  \"phone_column\": \"phone\",\n  \"contacts\": [\n    {\n      \"phone\": \"+919876543210\",\n      \"name\": \"Rahul Sharma\",\n      \"company\": \"TechCo\"\n    },\n    {\n      \"phone\": \"+919876543211\",\n      \"name\": \"Priya Patel\",\n      \"company\": \"FinCo\"\n    }\n  ],\n  \"max_concurrent_calls\": 3\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "January Sales Outreach",
  "agent_id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "+919240018601",
  "phone_column": "phone",
  "contacts": [
    [
      "phone": "+919876543210",
      "name": "Rahul Sharma",
      "company": "TechCo"
    ],
    [
      "phone": "+919876543211",
      "name": "Priya Patel",
      "company": "FinCo"
    ]
  ],
  "max_concurrent_calls": 3
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.levrage.ai/v1/campaigns")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```