> 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}/calls/{callId}/actions/play
Content-Type: application/json

진행 중인 통화에 안내 음성을 넣습니다. `<Dial>` 로 **연결된 통화**에만 사용할 수 있으며, 통화를 끊지 않고 오디오만 얹습니다.

`text` 를 주면 그 문장을 읽어 주고, `url` 을 주면 그 오디오 파일을 재생합니다 (둘 중 하나만 지정). 재생 대상은 `target` 으로 고릅니다 — 기본값은 양쪽 모두입니다.

**접수만 하고 즉시 202 로 응답합니다.** 재생이 끝날 때까지 기다리지 않습니다.

아직 연결되지 않았거나(벨 울리는 중) 이미 끝난 통화, 앞선 안내가 재생 중인 통화는 409 로 거절됩니다.

Reference: https://docs.claw-ops.com/api-레퍼런스/claw-ops-api/calls/play-into-call

## Authentication

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

## Request

### Path parameters

- `accountId` (string, required) — 계정 ID
- `callId` (string, required) — 통화 ID

### Body (application/json)

- `text` (string, optional) — 읽어 줄 문장. `url` 과 함께 쓸 수 없습니다.
- `url` (string, optional) — 재생할 오디오 파일 URL (mp3/wav). `text` 와 함께 쓸 수 없습니다.
- `language` (enum, optional, default: ko) — `text` 를 읽을 언어. 기본값: ko
  - Allowed values: `ko`, `en`, `ja`
- `voice` (string, optional) — `text` 를 읽을 음성. VoiceML `<Say>` 의 `voice` 와 같은 형식입니다 — 생략하면 무료 기본 음성으로 읽고(요금 없음), `cartesia` 또는 `cartesia:<음성 ID>` 를 지정하면 고품질 음성으로 읽으며 읽은 글자 수만큼 과금됩니다. 통화 중 다른 안내와 음색을 맞추려면 `<Say>` 에 쓴 값과 같은 값을 주세요.
- `target` (enum, optional, default: both) — 재생 대상. both=양쪽 모두 / caller=발신자만 / callee=연결된 상대만. 기본값: both
  - Allowed values: `both`, `caller`, `callee`

## Response

### 202

재생 접수됨

- `callId` (string, optional) — 대상 통화 ID
- `playbackId` (string, optional, nullable) — 재생 식별자
- `status` (string, optional) — 처리 상태

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "callId": "CA1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6",
  "playbackId": "b8f1c2d3-4e5f-6789-abcd-ef0123456789",
  "status": "playing"
}
```

**SDK Code**

```python
import requests

url = "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/calls/CA1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6/actions/play"

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

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

print(response.json())
```

```javascript
const url = 'https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/calls/CA1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6/actions/play';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.claw-ops.com/v1/accounts/AC1a2b3c4d/calls/CA1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6/actions/play"

	payload := strings.NewReader("{}")

	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.claw-ops.com/v1/accounts/AC1a2b3c4d/calls/CA1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6/actions/play")

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 = "{}"

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.claw-ops.com/v1/accounts/AC1a2b3c4d/calls/CA1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6/actions/play")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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

```swift
import Foundation

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

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

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