---
title: "Generate a voice preview"
description: "Served by the standalone Voice API. Requires a Bearer session for a workspace owner/admin/manager when VOICE_AI_TELEPHONY_TURN_CONTROL_V2 is enabled. Legacy flag-off access is preserved. Existing route-specific validation still applies."
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Workspaces

`POST /api/workspaces/{workspaceId}/voice-ai/preview/tts`

Served by the standalone Voice API. Requires a Bearer session for a workspace owner/admin/manager when VOICE_AI_TELEPHONY_TURN_CONTROL_V2 is enabled. Legacy flag-off access is preserved. Existing route-specific validation still applies.

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Path parameters

- `workspaceId` (`post/api/workspaces/workspaceId/voice-ai/preview/tts.path.workspaceId`; string, required)

## Request body

- `text` (`post/api/workspaces/workspaceId/voice-ai/preview/tts.text`; string, optional) — Text to speak; required.
- `voice` (`post/api/workspaces/workspaceId/voice-ai/preview/tts.voice`; string, optional) — Supported voice identifier.

## Example request

```json
{
  "text": "string",
  "voice": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/preview/tts' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "string",
  "voice": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/preview/tts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({text: 'string', voice: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/preview/tts"

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

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

print(response.text)
```

## Responses

### 200

Audio preview

#### Example

```text
string
```

### 400

Invalid call or preview parameters

### 401

Missing or invalid session

### 403

Workspace owner/admin/manager required

### 404

Requested resource not found

### 409

Call is not in a state permitting this operation

### 500

Operation failed

### 503

Access verification or service unavailable


Source: https://developer.channelautomations.com/api/post-api-workspaces-workspace-id-voice-ai-preview-tts/index.md
