Update a phone number
curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/phone-numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_outbound": true,
"outbound_trunk_ids": [
"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e"
]
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/phone-numbers/{id}"
payload = {
"voice_outbound": True,
"outbound_trunk_ids": ["9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d", "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
voice_outbound: true,
outbound_trunk_ids: ['9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d', '0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e']
})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/phone-numbers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"phone_number": {
"id": "7b0e2c4a-1f3d-4e8a-9c21-5d6f7a8b9c01",
"project_id": "3f6c1a52-8d0e-4b8f-9a51-2c7d4e0b9f13",
"e164": "14155550123",
"provider": null,
"voice_inbound": true,
"voice_outbound": true,
"sip_trunk_id": "2d4f6a8c-0e1b-4c3d-8e5f-7a9b1c2d3e4f",
"outbound_trunk_ids": [
"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e"
],
"outbound_agents": [],
"outbound_agents_inherited": [],
"max_calls_per_second": 1,
"abuse_protection_exempt": false,
"max_calls_per_second_updated_by": null,
"max_calls_per_second_updated_at": null,
"created_at": "Mon Nov 09 2026 14:02:11 GMT+0000 (Coordinated Universal Time)",
"updated_at": "Wed Nov 11 2026 09:31:12 GMT+0000 (Coordinated Universal Time)"
}
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Outbound trunks require voice_outbound=true"
}{
"error": "<string>",
"code": "<string>"
}Phone numbers
Update a phone number
Changes the fields you send and keeps the others; send at least one. Moving a number between inbound SIP trunks updates both trunks, and when it was the last number of an active trunk, that trunk is deactivated. Setting both provider and sip_trunk_id to null leaves the number unassigned. Needs the publish permission, which organization API keys carry.
PUT
/
v1
/
projects
/
{projectId}
/
phone-numbers
/
{id}
Update a phone number
curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/phone-numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_outbound": true,
"outbound_trunk_ids": [
"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e"
]
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/phone-numbers/{id}"
payload = {
"voice_outbound": True,
"outbound_trunk_ids": ["9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d", "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
voice_outbound: true,
outbound_trunk_ids: ['9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d', '0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e']
})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/phone-numbers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"phone_number": {
"id": "7b0e2c4a-1f3d-4e8a-9c21-5d6f7a8b9c01",
"project_id": "3f6c1a52-8d0e-4b8f-9a51-2c7d4e0b9f13",
"e164": "14155550123",
"provider": null,
"voice_inbound": true,
"voice_outbound": true,
"sip_trunk_id": "2d4f6a8c-0e1b-4c3d-8e5f-7a9b1c2d3e4f",
"outbound_trunk_ids": [
"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e"
],
"outbound_agents": [],
"outbound_agents_inherited": [],
"max_calls_per_second": 1,
"abuse_protection_exempt": false,
"max_calls_per_second_updated_by": null,
"max_calls_per_second_updated_at": null,
"created_at": "Mon Nov 09 2026 14:02:11 GMT+0000 (Coordinated Universal Time)",
"updated_at": "Wed Nov 11 2026 09:31:12 GMT+0000 (Coordinated Universal Time)"
}
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Outbound trunks require voice_outbound=true"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.
Body
application/json
Send at least one field; the others keep their value. The number (e164) cannot be changed and is ignored if sent. provider and sip_trunk_id cannot both be set after the update; set both to null to leave the number unassigned.
Response
The updated phone number.