Update a voice number
/v1/voice/numbers/{number_id}const number = await bird.voice.numbers.update("number-id", { name: "Support line" });
console.log(number.id, number.name);number = client.voice.numbers.update("number-id", name="Support line")
print(number.id, number.name)number, err := client.Voice.Numbers.Update(context.Background(), "number-id", bird.VoiceNumbersUpdateParams{
Name: bird.Value("Support line"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(number.Id, number.Name)$number = $bird->voice->numbers->update('number-id', (new VoiceNumberUpdate())->setName('Support line'));
echo $number->getId(), ' ', $number->getName() ?? '', "\n";bird voice numbers update <number-id> --body-file - <<'JSON'
{
"inbound_configuration": {
"route": {
"type": "trunk",
"trunk_id": "spt_01krdgeqcxet5s7t44vh8rt9mg"
}
}
}
JSONcurl -X PATCH "https://us1.platform.bird.com/v1/voice/numbers/{number_id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inbound_configuration": {
"route": {
"type": "trunk",
"trunk_id": "spt_01krdgeqcxet5s7t44vh8rt9mg"
}
}
}'{
"id": "vnu_01krdgeqcxet5s7t44vh8rt9mg",
"phone_number": "+14155551234",
"country_code": "US",
"name": "Support line",
"provider": {
"type": "allocation",
"number_id": "nda_01krdgeqcxet5s7t44vh8rt9mg"
},
"inbound_configuration": {
"route": {
"type": "reject"
},
"configuration_error": "unsupported_route_type",
"forward_as_options": [
"dialed_number",
"calling_number"
]
}
}
Changes what you have said about this number: the label you gave it, and what happens when a call arrives for it. Omit a field to leave it as it is.
The route replaces whatever was set before, because a number has exactly one answer at a time. A null route returns the number to your workspace's default inbound route, set with Update the voice settings. Type "reject" refuses calls whatever the default is. "trunk" needs a trunk_id: the trunk must be yours and must have inbound calling enabled. "forward" needs a forward_to, which has to be one of your verified caller IDs. That is checked when you set it, and again on every call it forwards, so a caller ID you later remove stops forwarding rather than carrying on.
Sequence management remains in the dashboard. A sequence route needs
sequence_id and entry_node_id from an existing active publication in your
workspace. Binding a sequence with recording commands or managed recording
transfers requires organization preview access. Sequence management endpoints
are not available through the public API; see the
call sequences guide.
Only a number whose calls arrive here can carry a route. A number from another carrier is somewhere calls can be sent to, and that carrier routes the calls made to it, so inbound_configuration is refused on it. The label can be set on either.
Parameters
number_idstringRequest Payload
nameYour own label for this number. Send null to remove the one it has. Omit the field to leave it alone.
inbound_configurationWhat should happen to calls arriving for this number. The route replaces whatever was set before, because a number has exactly one answer at a time. Type "reject" stops it answering, and a null route returns it to your workspace's default inbound route. Omit the field to leave the answer alone.
Only a number that can receive calls carries a route, so it is refused on one whose directions do not include inbound.
Show child parameters
inbound_configuration.routeThe number's own route, or null to have it follow your workspace's default inbound route from the voice settings.
Show child parameters
inbound_configuration.route.typeRefuses the call. Setting it is how you stop a number answering without giving it up. It is also the default inbound route of a new workspace.
Value: reject
inbound_configuration.route.typeDelivers the call to one of your SIP trunks.
Value: trunk
inbound_configuration.route.trunk_idThe SIP trunk that answers these calls. It must be one of yours and must have inbound calling enabled. Turning that trunk's inbound calling off, or deleting it, removes this route: a number returns to your workspace's default inbound route, and a workspace default becomes "reject".
inbound_configuration.route.typePlaces a call to another of your numbers and connects the two.
Value: forward
inbound_configuration.route.forward_toThe number calls are forwarded to, in E.164 format. It has to be one of your verified caller IDs. That is checked when you set it and again on every call it forwards, so a caller ID you later remove stops forwarding rather than carrying on.
inbound_configuration.route.forward_asWhich number the forwarded leg presents as its caller. Include the choice
on every write. Reads return the effective choice; older configurations
without a stored choice return dialed_number.
Possible values: dialed_number, calling_number
Response Payload
idIdentifier of this number, to pass to the operations that read and change it. A number you registered as a caller ID carries the same identifier there, with the caller-ID prefix.
phone_numberThe phone number in E.164 format.
country_codeCountry the number belongs to. Null when the number is not geographic or its country cannot be determined.
nameYour own label for this number, to tell several apart. Null when it has none. Only you see it, so it never affects what a caller sees.
providerWhere this number came from, and the facts that belong to that answer. The type selects the shape. allocation is a number we allocated to your workspace, and it carries that allocation's identifier. verified_number is a number from another carrier, and it carries how far proving control of it has got.
directionsWhich directions this number can carry. Both follow from the number itself, so neither is yours to change. On a SIP trunk each direction is a setting you turn on; here it is a fact about the number.
inbound_configurationWhat happens to a call arriving for this number.
created_atWhen this number became usable for voice: when it was allocated to you, or when you first registered it, whichever this number is.
Related resources
Continue with the documentation, guides and examples for this topic.