Reference
Error Codes Reference
Error Code | HTTP Status | Message | Description |
|---|---|---|---|
1000 | 404 | Not Found | Resource not found (invalid trunk_sid, phone_number_id, etc.) |
1001 | 400 | Mandatory Parameter missing | Required parameter not provided |
1002 | 400 | Invalid parameter | Parameter value is invalid or malformed |
1007 | 400 | Invalid request body | JSON parsing error or malformed request body |
1008 | 409 | Duplicate resource | Resource already exists (duplicate trunk name, IP already whitelisted, etc.) |
1011 | 415 | Unsupported content type | Wrong Content-Type header. Use application/json |
Quick Reference
API Endpoints Summary
API | Method | Endpoint |
|---|---|---|
Create Trunk | POST | /v2/accounts/{sid}/trunks |
List Trunks | GET | /v2/accounts/{sid}/trunks |
Update Trunk | PUT | /v2/accounts/{sid}/trunks/{trunk_sid} |
Delete Trunk | DELETE | /v2/accounts/{sid}/trunks?trunk_sid={trunk_sid} |
Trunk Map Lookup | GET | /v2/accounts/{sid}/trunk-maps?exophone={number} |
Map Phone Number | POST | /v2/accounts/{sid}/trunks/{trunk_sid}/phone-numbers |
Get Phone Numbers | GET | /v2/accounts/{sid}/trunks/{trunk_sid}/phone-numbers |
Update Phone Number Mode | PUT | /v2/accounts/{sid}/trunks/{trunk_sid}/phone-numbers/{id} |
Delete Phone Number Mapping | DELETE | /v2/accounts/{sid}/trunks/{trunk_sid}/phone-numbers?id={id} |
Map ACL | POST | /v2/accounts/{sid}/trunks/{trunk_sid}/whitelisted-ips |
Get ACLs | GET | /v2/accounts/{sid}/trunks/{trunk_sid}/whitelisted-ips |
Update Whitelisted IP | PUT | /v2/accounts/{sid}/trunks/{trunk_sid}/whitelisted-ips/{id} |
Delete Whitelisted IP | DELETE | /v2/accounts/{sid}/trunks/{trunk_sid}/whitelisted-ips?id={id} |
Create Credentials | POST | /v2/accounts/{sid}/trunks/{trunk_sid}/credentials |
List Credentials | GET | /v2/accounts/{sid}/trunks/{trunk_sid}/credentials |
Update Credentials | PUT | /v2/accounts/{sid}/trunks/{trunk_sid}/credentials/{id} |
Delete Credentials | DELETE | /v2/accounts/{sid}/trunks/{trunk_sid}/credentials?id={id} |
Map Destination URI | POST | /v2/accounts/{sid}/trunks/{trunk_sid}/destination-uris |
Get Destination URIs | GET | /v2/accounts/{sid}/trunks/{trunk_sid}/destination-uris |
Update Destination URI | PUT | /v2/accounts/{sid}/trunks/{trunk_sid}/destination-uris/{id} |
Delete Destination URI | DELETE | /v2/accounts/{sid}/trunks/{trunk_sid}/destination-uris?id={id} |
Set Trunk Alias | POST | /v2/accounts/{sid}/trunks/{trunk_sid}/settings |
List Trunk Settings | GET | /v2/accounts/{sid}/trunks/{trunk_sid}/settings |
Delete Trunk Setting | DELETE | /v2/accounts/{sid}/trunks/{trunk_sid}/settings?name={name} |
Mode Options
Mode | Description | Use Case |
|---|---|---|
pstn | Routes calls to telephone network | Standard PBX/Contact Center integration |
flow | Routes calls to Voice AI bot | StreamKit/Voice AI integration |
Notes
- Duplicate resource errors (1008) are safe and can be ignored if the configuration already exists
- Destination URI must always be configured, even when using Exotel Flows
- flow mode is required only for Voicebot or non-Connect applets