---
title: "Receive legacy inbound Twilio SMS"
description: "Legacy Twilio inbound webhook that resolves the workspace from the destination phone number and delegates to the shared inbound SMS orchestrator."
---

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

Legacy Twilio inbound webhook that resolves the workspace from the destination phone number and delegates to the shared inbound SMS orchestrator.

## Request body

_Required._

- `MessageSid` (`post/twilio.MessageSid`; string, optional)
- `From` (`post/twilio.From`; string, optional)
- `To` (`post/twilio.To`; string, optional)
- `Body` (`post/twilio.Body`; string, optional)
- `NumMedia` (`post/twilio.NumMedia`; string, optional)

## Example request

```text
{
  "MessageSid": "string",
  "From": "string",
  "To": "string",
  "Body": "string",
  "NumMedia": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/twilio \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode MessageSid=string \
  --data-urlencode From=string \
  --data-urlencode To=string \
  --data-urlencode Body=string \
  --data-urlencode NumMedia=string
```

### TypeScript

```typescript
const encodedParams = new URLSearchParams();
encodedParams.append('MessageSid', 'string');
encodedParams.append('From', 'string');
encodedParams.append('To', 'string');
encodedParams.append('Body', 'string');
encodedParams.append('NumMedia', 'string');

const url = 'https://api.channelautomation.com/twilio';
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/twilio"

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

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

print(response.text)
```

## Responses

### 200

Inbound SMS accepted.

### 400

Missing required Twilio fields.

### 404

No workspace found for the destination phone number.

### 500

Internal server error

#### Example

```json
{
  "error": "Internal server error",
  "details": "string",
  "success": false
}
```

- `error` (`post/twilio.response.500.error`; string, optional)
  - example `"Internal server error"`
- `details` (`post/twilio.response.500.details`; string, optional)
- `success` (`post/twilio.response.500.success`; boolean, optional)
  - example `false`


Source: https://developer.channelautomations.com/api/twilio/create/index.md
