---
title: "Release an owned Twilio phone number"
---

> 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/twilio/release-number`

## Authentication

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

## Header parameters

- `x-workspace-id` (`post/api/twilio/release-number.header.x-workspace-id`; string, required)

## Request body

_Required._

- `workspaceId` (`post/api/twilio/release-number.workspaceId`; string, required)
- `sid` (`post/api/twilio/release-number.sid`; string, optional) — Phone number SID; required for add and release
- `messagingServiceSid` (`post/api/twilio/release-number.messagingServiceSid`; string, optional) — Required for add

## Example request

```json
{
  "workspaceId": "string",
  "sid": "string",
  "messagingServiceSid": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/twilio/release-number \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-workspace-id: string' \
  --data '
{
  "workspaceId": "string",
  "sid": "string",
  "messagingServiceSid": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/twilio/release-number';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-workspace-id': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({workspaceId: 'string', sid: 'string', messagingServiceSid: '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/twilio/release-number"

payload = {
    "workspaceId": "string",
    "sid": "string",
    "messagingServiceSid": "string"
}
headers = {
    "Content-Type": "application/json",
    "x-workspace-id": "string",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Action completed

### 400

Invalid input

### 401

Authentication required

### 403

Workspace mismatch

### 404

Configuration missing

### 502

Provider action not confirmed


Source: https://developer.channelautomations.com/api/post-api-twilio-release-number/index.md
