API Reference · Phone numbers
Update a phone number
Changes which AI employee answers a number, its label, or the account it belongs to. Only the fields you send are changed.
PATCH
/phone-numbers/{id}https://calling.ubiqproject.com/api/v1/phone-numbers/{id} · Auth: API key (full access)
Request
Path parameters
idstring (UUID)requiredThe phone number's ID.
Body
agent_idstring (UUID) | nullThe AI employee that should answer this number. Send
null to unlink it, so no AI employee answers. Leave the field out to keep the current one.namestringA new label. Send
"" to clear it.locationstringA new region or office note. Send
"" to clear it.account_idstring (UUID)Move the number to another of your telephony accounts. It can't be
null — a number always stays linked to one of your accounts. A sip number can only move to another SIP trunk. When you send this field for a Twilio or Plivo number, Daffy Voice sets up its incoming calls again and reports the result in webhook_configured.The number itself and its provider can't be changed — remove the number and add it again instead.
Request
curl -X PATCH https://calling.ubiqproject.com/api/v1/phone-numbers/a71d9e04-2c3b-4f58-8e6a-1b9c0d2e3f47 \
-H "Authorization: Bearer vk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "agent_id": "3f8c2a1e-6b4d-4c7a-9e21-5d0f7b8a9c34", "name": "Collections line" }'Response
The updated phone number.
Response · 200
{
"id": "a71d9e04-2c3b-4f58-8e6a-1b9c0d2e3f47",
"number": "+918046801234",
"provider": "sip",
"name": "Collections line",
"location": "Bengaluru",
"agent_id": "3f8c2a1e-6b4d-4c7a-9e21-5d0f7b8a9c34",
"agent_name": "Priya",
"account_id": "c5e2b7a9-0d1f-4e36-b8c4-7a6f5e3d2c18",
"account_label": "Tata SIP trunk",
"webhook_configured": null,
"webhook_detail": null
}Response fields
idstring (UUID)The phone number's ID.
numberstringThe number as stored. SIP numbers are always stored in international format (+91…).
providerstringtwilio, plivo, exotel or sip.namestring | nullYour label for the number.
locationstring | nullYour note of the number's region or office.
agent_idstring | nullThe AI employee that answers calls to this number. null if none.
agent_namestring | nullThat AI employee's name.
account_idstring | nullThe telephony account or SIP trunk the number belongs to. null means Daffy Voice's own account.
account_labelstring | nullThat account's name.
webhook_configuredboolean | nullOnly set right after adding a number or changing its account: whether Daffy Voice pointed the provider's incoming calls at your AI employee. Always null in lists.
webhook_detailstring | nullA sentence explaining
webhook_configured.Errors
Responses
Phone number not found404No number with this ID exists.
Forbidden403The number belongs to another company.
Agent not found404The
agent_id isn't one of your AI employees.Invalid agent_id UUID422Also
"Invalid account_id UUID".A SIP number must be attached to a SIP trunk account422A
sip number was moved to an account that isn't a SIP trunk (or to null, which returns "Choose the SIP trunk this number belongs to (account_id)").Unlinking stops answering
A number with no AI employee no longer answers incoming calls. Make sure another number takes over first.