Link a resource to a phone number
Links a resource to an unassigned channel of a phone number you own, so inbound calls or messages to that number reach the resource. Reference the number by phone_number_id or by its E.164 number, and pick the channel with handler_type. The address for that channel already exists, so this operation sets its resource rather than creating a new address, and it never purchases a number. Assign Resource to phone route does the same from the resource's side.
A 422 response names the problem in its code:
- missing_required_parameter: resource_id or handler_type is blank, or neither phone_number_id nor number was provided.
- invalid_parameter: handler_type is not calling or messaging.
- provided_id_is_unrecognized: the number is not owned by your project, or resource_id is not a resource in it.
- invalid_resource_type: the resource can't handle the chosen channel.
- already_assigned: the channel already has a resource. Use Update the resource for a phone number to re-point it instead.
<Warning title="Beta">This API is in beta and may change.</Warning>
Permissions
The API token used to authenticate must have the following scope(s) enabled to make a successful request: Calling, Fax, Messaging, or Video.
Learn more about API scopes.
Request body
Example request
{
"number": "+13105550100"
}Response
The request has succeeded and a new resource has been created as a result.
Example response
{
"type": "phone",
"name": "main-support-number",
"phone_number": "+13105550100",
"created_at": "2024-05-06T12:20:00Z",
"updated_at": "2024-05-06T12:20:00Z"
}Changes
Changed in 4 of the 161 revisions of this API.113
- ○
endpoint added
endpoint-added
- ○
- ▲
api path removed without deprecation
api-path-removed-without-deprecation
This revision also has 9 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ●
added the new
phoneenum value to theresponse property for the response statusresponse-property-enum-value-added
- ○
removed the
phone_number_addressenum value from theresponse property for the response statusresponse-property-enum-value-removed
- ●
- ○
endpoint added
endpoint-added
- ○
Of the 161 revisions, 3 have a changelog that could not be searched.