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

# Create a batch of calls

POST https://api.hollr.ai/v1/call/create-batch
Content-Type: application/json

Create a batch of contacts to call under a campaign, either immediately or at a scheduled UTC time. The batch record is created in HollrAI first and kept (as `failed`) even if enqueueing on the call server fails, so it can be inspected or retried.

Reference: https://docs.hollr.ai/api-reference/hollr-ai-api/batches/create-batch

## Authentication

- `hollr-api-key` header (required) — API key issued for your account. Every request is logged and rate-limited against this key.

## Request

### Body (application/json)

- `campaign_id` (string, required) — UUID of the campaign to place the calls under. Campaigns are created in the HollrAI platform.
- `name` (string, required)
- `contacts` (list of object, required)
  - `name` (string, required)
  - `phone_number` (string, required)
  - `other_details` (map from string to any, optional)
- `run_now` (boolean, optional, default: false) — If true, the batch is started immediately. Wins over scheduled_for if both are present.
- `scheduled_for` (datetime, optional) — ISO 8601 timestamp with an explicit UTC offset (e.g. trailing Z or +05:30). Required unless run_now is true or omitted. Must be in the future. A bare timestamp without a timezone designator is rejected rather than guessed — convert local time to UTC before sending.

## Response

### 200

Batch created and successfully scheduled on the call server.

- `status` (string, optional)
- `batch_id` (string, optional)
- `name` (string, optional)
- `batch_status` (enum, optional) — Current lifecycle status of the batch, kept in sync with the call server.
  - Allowed values: `pending`, `scheduled`, `in_progress`, `paused`, `completed`, `failed`
- `run_now` (boolean, optional)
- `scheduled_for` (datetime, optional, nullable)
- `contacts_count` (integer, optional)
- `call_server_response` (map from string to any, optional) — Response is passed through verbatim from the internal call server. Update this schema once the call server's response contract is documented.

## Examples

**Request**

```json
{
  "campaign_id": "string",
  "name": "Monday Morning Calls",
  "contacts": [
    {
      "name": "Jane Doe",
      "phone_number": "+15551234567"
    }
  ]
}
```

**Response**

```json
{
  "status": "success",
  "batch_id": "string",
  "name": "string",
  "batch_status": "pending",
  "run_now": true,
  "scheduled_for": "2024-01-15T09:30:00Z",
  "contacts_count": 1,
  "call_server_response": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.hollr.ai/v1/call/create-batch"

payload = {
    "campaign_id": "string",
    "name": "Monday Morning Calls",
    "contacts": [
        {
            "name": "Jane Doe",
            "phone_number": "+15551234567"
        }
    ]
}
headers = {
    "hollr-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.hollr.ai/v1/call/create-batch';
const options = {
  method: 'POST',
  headers: {'hollr-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"campaign_id":"string","name":"Monday Morning Calls","contacts":[{"name":"Jane Doe","phone_number":"+15551234567"}]}'
};

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.hollr.ai/v1/call/create-batch"

	payload := strings.NewReader("{\n  \"campaign_id\": \"string\",\n  \"name\": \"Monday Morning Calls\",\n  \"contacts\": [\n    {\n      \"name\": \"Jane Doe\",\n      \"phone_number\": \"+15551234567\"\n    }\n  ]\n}")

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

	req.Header.Add("hollr-api-key", "<apiKey>")
	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.hollr.ai/v1/call/create-batch")

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

request = Net::HTTP::Post.new(url)
request["hollr-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"campaign_id\": \"string\",\n  \"name\": \"Monday Morning Calls\",\n  \"contacts\": [\n    {\n      \"name\": \"Jane Doe\",\n      \"phone_number\": \"+15551234567\"\n    }\n  ]\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.hollr.ai/v1/call/create-batch")
  .header("hollr-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"campaign_id\": \"string\",\n  \"name\": \"Monday Morning Calls\",\n  \"contacts\": [\n    {\n      \"name\": \"Jane Doe\",\n      \"phone_number\": \"+15551234567\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hollr.ai/v1/call/create-batch', [
  'body' => '{
  "campaign_id": "string",
  "name": "Monday Morning Calls",
  "contacts": [
    {
      "name": "Jane Doe",
      "phone_number": "+15551234567"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'hollr-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.hollr.ai/v1/call/create-batch");
var request = new RestRequest(Method.POST);
request.AddHeader("hollr-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"campaign_id\": \"string\",\n  \"name\": \"Monday Morning Calls\",\n  \"contacts\": [\n    {\n      \"name\": \"Jane Doe\",\n      \"phone_number\": \"+15551234567\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "hollr-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "campaign_id": "string",
  "name": "Monday Morning Calls",
  "contacts": [
    [
      "name": "Jane Doe",
      "phone_number": "+15551234567"
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hollr.ai/v1/call/create-batch")! 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()
```