---
title: "Route a Twilio voice call to the configured workspace destination"
description: "Twilio form webhook. Workspaces with VOICE_AI_TELEPHONY_TURN_CONTROL_V2 require X-Twilio-Signature validation before call routing; the new AI path emits a short-lived signed stream permission. Uses the exact public webhook URL including query parameters. New outbound callbacks with voiceLease also require the Twilio signature and bind the pre-dial capacity lease atomically. Legacy inbound routing is unchanged."
---

> 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 › Twilio

`POST /api/workspaces/{workspaceId}/voice`

Twilio form webhook. Workspaces with VOICE_AI_TELEPHONY_TURN_CONTROL_V2 require X-Twilio-Signature validation before call routing; the new AI path emits a short-lived signed stream permission. Uses the exact public webhook URL including query parameters. New outbound callbacks with voiceLease also require the Twilio signature and bind the pre-dial capacity lease atomically. Legacy inbound routing is unchanged.

## Path parameters

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

## Query parameters

- `voiceLease` (`post/api/workspaces/workspaceId/voice.query.voiceLease`; string, optional) — Internal provisional outbound capacity lease; requires a valid Twilio signature.

## Header parameters

- `X-Twilio-Signature` (`post/api/workspaces/workspaceId/voice.header.X-Twilio-Signature`; string, optional) — Required for the new voice path; Twilio signs the URL and form body.
  - format `uuid`

## Request body

_Required._

- `CallSid` (`post/api/workspaces/workspaceId/voice.CallSid`; string, optional)
- `Direction` (`post/api/workspaces/workspaceId/voice.Direction`; string, optional)
- `From` (`post/api/workspaces/workspaceId/voice.From`; string, optional)
- `To` (`post/api/workspaces/workspaceId/voice.To`; string, optional)

## Example request

```text
{
  "CallSid": "string",
  "Direction": "string",
  "From": "string",
  "To": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode CallSid=string \
  --data-urlencode Direction=string \
  --data-urlencode From=string \
  --data-urlencode To=string
```

### TypeScript

```typescript
const encodedParams = new URLSearchParams();
encodedParams.append('CallSid', 'string');
encodedParams.append('Direction', 'string');
encodedParams.append('From', 'string');
encodedParams.append('To', 'string');

const url = 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: encodedParams
};

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"

payload = {
    "CallSid": "string",
    "Direction": "string",
    "From": "string",
    "To": "string"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}

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

print(response.text)
```

## Responses

### 200

TwiML routing instructions

### 400

Invalid workspace or request

### 401

Workspace configuration unavailable

### 403

Invalid Twilio signature

### 404

Workspace not found

### 500

Routing failed


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