---
title: "Assign or clear the inbound voice agent for an owned number"
description: "Does not redirect the number or change Twilio settings. Consumer readiness is required before assigning. Clears use null and preserve default routing. Takes effect within the five-second runtime memo window."
---

> 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

`PUT /api/workspaces/{workspaceId}/voice-ai/numbers/{phone}`

Does not redirect the number or change Twilio settings. Consumer readiness is required before assigning. Clears use null and preserve default routing. Takes effect within the five-second runtime memo window.

## Authentication

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

## Path parameters

- `workspaceId` (`put/api/workspaces/workspaceId/voice-ai/numbers/phone.path.workspaceId`; string, required)
- `phone` (`put/api/workspaces/workspaceId/voice-ai/numbers/phone.path.phone`; string, required) — URL-encoded E.164 or formatted phone number

## Request body

_Required._

- `agent_id` (`put/api/workspaces/workspaceId/voice-ai/numbers/phone.agent_id`; string, required, nullable)
  - format `uuid`

## Example request

```json
{
  "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978"
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/numbers/<phone>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/numbers/<phone>';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({agent_id: '2b1e3b65-2c04-4fa2-a2d7-467901e98978'})
};

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/numbers/<phone>"

payload = { "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Assignment saved or cleared

### 400

Invalid phone or agent

### 401

Authentication required

### 403

Admin or manager role required

### 409

Agent disabled or not set up

### 503

Migration or consumers not ready; assignment unchanged


Source: https://developer.channelautomations.com/api/put-api-workspaces-workspace-id-voice-ai-numbers-phone/index.md
