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

# 배치 일시정지 · 재개 · 취소

POST https://api.claw-ops.com/v1/accounts/{accountId}/call-batches/{batchId}/actions
Content-Type: application/json

- `pause`: 신규 발신만 중단합니다. **진행 중인 통화는 그대로 유지**됩니다.
- `resume`: 다시 발신을 시작합니다.
- `cancel`: 남은 대상을 모두 취소합니다. 이미 걸린 통화는 유지되며, 개별 종료가
  필요하면 통화 제어 API를 사용하세요.

Reference: https://docs.claw-ops.com/api-레퍼런스/claw-ops-api/call-batches/control-call-batch

## Authentication

- `Authorization` header (bearer token, required) — API Key를 Bearer 토큰으로 전달

## Request

### Path parameters

- `accountId` (string, required)
- `batchId` (string, required)

### Body (application/json)

- `Action` (enum, required)
  - Allowed values: `pause`, `resume`, `cancel`

## Response

### 200

상태 변경 성공

- `batchId` (string, optional)
- `name` (string, optional)
- `status` (enum, optional) — running=발신 중 · paused=일시정지(진행 중 통화는 유지) · canceled=취소 · completed=완료 · expired=EndAt 경과로 종료
  - Allowed values: `draft`, `scheduled`, `running`, `paused`, `completed`, `canceled`, `expired`
- `from` (string, optional)
- `callFlowId` (string, optional)
- `agentId` (string, optional)
- `url` (string, optional)
- `maxConcurrency` (integer, optional)
- `pacingPerMinute` (integer, optional)
- `timezone` (string, optional)
- `startAt` (datetime, optional, nullable)
- `endAt` (datetime, optional, nullable)
- `machineDetection` (enum, optional, nullable) — 자동응답기 감지 모드. 사용하지 않는 배치는 null 입니다.
  - Allowed values: `Enable`, `Hangup`
- `rounds` (list of object, optional) — 발신 차수. 배열 인덱스가 곧 차수이고 rounds[0] 이 1차 발신입니다. 길이 1 = 한 번 걸고 끝. 각 차수가 자기 시간창(windows)을 가집니다.
  - `after` (integer, optional) — 직전 차수를 마무리한 뒤 기다릴 시간(분). 1차에는 없습니다.
  - `on` (list of string, optional) — 직전 통화가 이 결과일 때만 진행. 1차에는 없습니다.
  - `windows` (list of object, optional) — 이 차수의 발신 가능 시간대. 없으면 법정 허용 시간 전체입니다.
    - `days` (list of integer, optional)
    - `start` (string, optional)
    - `end` (string, optional)
- `messagePolicy` (object, optional, nullable) — 끝내 통화가 안 된 분께 보낼 문자. null 이면 보내지 않습니다.
  - `onFirstFail` (object, optional)
    - `body` (string, optional)
  - `onFinalFail` (object, optional)
    - `body` (string, optional)
- `warnings` (list of string, optional) — **생성 응답에만** 포함됩니다. 거절할 정도는 아니지만 알아야 하는 것들 — 발신번호에 문자 전송 이력이 없거나(문자 발신번호 미등록 가능성), 남은 문자 한도가 수신자 수보다 적은 경우입니다.
- `dateCreated` (datetime, optional)
- `dateUpdated` (datetime, optional)
- `counts` (map from string to integer, optional) — 상태별 수신자 수 (pending·dialing·done·failed·canceled·expired)

## Examples

**Request**

```json
{
  "Action": "pause"
}
```

**Response**

```json
{
  "batchId": "clx1a2b3c4d5e",
  "name": "7월 예약 확인",
  "status": "draft",
  "from": "07052358010",
  "callFlowId": "string",
  "agentId": "string",
  "url": "string",
  "maxConcurrency": 1,
  "pacingPerMinute": 1,
  "timezone": "string",
  "startAt": "2024-01-15T09:30:00Z",
  "endAt": "2024-01-15T09:30:00Z",
  "machineDetection": "Enable",
  "rounds": [
    {
      "after": 1,
      "on": [
        "string"
      ],
      "windows": [
        {
          "days": [
            1
          ],
          "start": "string",
          "end": "string"
        }
      ]
    }
  ],
  "messagePolicy": {
    "onFirstFail": {
      "body": "string"
    },
    "onFinalFail": {
      "body": "string"
    }
  },
  "warnings": [
    "07052358010 번호로 문자가 전송된 이력이 없습니다. 문자 발신번호 등록은 음성과 별개 절차라, 등록되지 않은 번호는 발송 요청은 성공해도 통신사에서 전량 거절될 수 있습니다."
  ],
  "dateCreated": "2024-01-15T09:30:00Z",
  "dateUpdated": "2024-01-15T09:30:00Z",
  "counts": {
    "dialing": 3,
    "done": 77,
    "pending": 120
  }
}
```

**SDK Code**

```python CallBatches_controlCallBatch_example
import requests

url = "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions"

payload = { "Action": "pause" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript CallBatches_controlCallBatch_example
const url = 'https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"Action":"pause"}'
};

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

```go CallBatches_controlCallBatch_example
package main

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

func main() {

	url := "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions"

	payload := strings.NewReader("{\n  \"Action\": \"pause\"\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 CallBatches_controlCallBatch_example
require 'uri'
require 'net/http'

url = URI("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions")

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  \"Action\": \"pause\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Action\": \"pause\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions', [
  'body' => '{
  "Action": "pause"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp CallBatches_controlCallBatch_example
using RestSharp;

var client = new RestClient("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Action\": \"pause\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift CallBatches_controlCallBatch_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["Action": "pause"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-batches/clx1a2b3c4d5e/actions")! 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()
```