---
title: "Update destination of telephone number"
method: PUT
path: "/v2/partition/{partitionId}/account/{accountId}/telephonenumber/{tn}/destination"
tags: ["Telephone Number"]
---

# Update destination of telephone number

`PUT /v2/partition/{partitionId}/account/{accountId}/telephonenumber/{tn}/destination`

## Request

- Base URL: `https://api.alianza.com`
- URL: `https://api.alianza.com/v2/partition/{partitionId}/account/{accountId}/telephonenumber/{tn}/destination`
- Auth: API key in header `X-AUTH-TOKEN`

Update the destination that gets calls from this telephone number.<br/><br/> One example destination is an END_USER, which results in the user's devices ringing and potentially connecting a call. Another potential destination is one of our automated systems handling the incoming call.<br/><br/> If an END_USER is the destination, and the assignAsCallerId value is "true", this call also updates the enduser calleridConfig with the phone number and sets the visibility to true.<br/><br/> This is just a convenience method, the same thing can be accomplished using <a href="#/~operation/Telephone%20Number/updateTelephoneNumberOnAccount">updateTelephoneNumberOnAccount</a>, but which requires the full telephone number account object.

## Path parameters

- `accountId` string, required
- `partitionId` string, required
- `tn` string, required

## Request body

- TelephoneNumberDestinationX
  - `partitionId` string
  - `accountId` string
  - `telephoneNumber` string
  - `referenceId` string: The id of the destination which gets calls from this number. You can think of this as a variable refkey; what it points to depends on the referenceType.
  - `referenceType` 'SIP_TRUNK' | 'END_USER' | 'IVR' | 'LINE_APPEARANCE' | 'LINE_HUNTGROUP' | 'TELEPHONE' | 'VFAX' | 'BUSINESS_LINE' | 'BUSINESS_LINE_HUNT_GROUP' | 'CALL_GROUP' | 'CALL_QUEUE' | 'AUTO_ATTENDANT' | 'SPECIALTY_LINE' | 'CONTACT_CENTER': What kind of destination gets calls from this number.
  - `ringType` 'StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7'
  - `assignAsCallerId` boolean
  - `id` string

## Response `200`

Successful operation

- TelephoneNumberDestinationX
  - `partitionId` string
  - `accountId` string
  - `telephoneNumber` string
  - `referenceId` string: The id of the destination which gets calls from this number. You can think of this as a variable refkey; what it points to depends on the referenceType.
  - `referenceType` 'SIP_TRUNK' | 'END_USER' | 'IVR' | 'LINE_APPEARANCE' | 'LINE_HUNTGROUP' | 'TELEPHONE' | 'VFAX' | 'BUSINESS_LINE' | 'BUSINESS_LINE_HUNT_GROUP' | 'CALL_GROUP' | 'CALL_QUEUE' | 'AUTO_ATTENDANT' | 'SPECIALTY_LINE' | 'CONTACT_CENTER': What kind of destination gets calls from this number.
  - `ringType` 'StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7'
  - `assignAsCallerId` boolean
  - `id` string

## Other responses

- `400`: Invalid request parameters
- `401`: Unauthorized
- `404`: Not found

---

[API](https://skmtc.dev/alianza/apis/alianza-public-api.md) - [All operations](https://skmtc.dev/alianza/apis/alianza-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/alianza/apis/alianza-public-api/revisions/cb514a0728ed?raw)
