Delete an outbound SIP trunk
curl --request DELETE \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/telephony/outbound-trunks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/telephony/outbound-trunks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/telephony/outbound-trunks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "Invalid or revoked token"
}{
"error": "publish_capability_required",
"code": "PUBLISH_CAPABILITY_REQUIRED"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Outbound trunk is referenced by one or more phone numbers; detach it first",
"referenced_by": [
"7b0e2c4a-1f3d-4e8a-9c21-5d6f7a8b9c01"
]
}Outbound SIP trunks
Delete an outbound SIP trunk
Deletes the trunk. A trunk still listed in a phone number’s outbound_trunk_ids cannot be deleted: remove it from those numbers first (409, with their ids in referenced_by). Needs the publish permission, which organization API keys carry.
DELETE
/
v1
/
projects
/
{projectId}
/
telephony
/
outbound-trunks
/
{id}
Delete an outbound SIP trunk
curl --request DELETE \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/telephony/outbound-trunks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/telephony/outbound-trunks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/telephony/outbound-trunks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "Invalid or revoked token"
}{
"error": "publish_capability_required",
"code": "PUBLISH_CAPABILITY_REQUIRED"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Outbound trunk is referenced by one or more phone numbers; detach it first",
"referenced_by": [
"7b0e2c4a-1f3d-4e8a-9c21-5d6f7a8b9c01"
]
}Authorizations
Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.
Response
The trunk was deleted.