---
title: "Update Phone Number"
method: PATCH
path: "/v1/convai/phone-numbers/{phone_number_id}"
tags: ["Agents Platform"]
---

# Update Phone Number

`PATCH /v1/convai/phone-numbers/{phone_number_id}`

Update assigned agent of a phone number

## Path parameters

- `phone_number_id` string, required — The phone number ID. This is returned when a phone number is imported.

## Headers

- `xi-api-key` string, nullable — Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

## Request body

- UpdatePhoneNumberRequest
  - `agent_id` string, nullable
  - `label` string, nullable
  - `inbound_trunk_config` InboundSIPTrunkConfigRequestModel
    - `allowed_addresses` string[], nullable — List of IP addresses that are allowed to use the trunk. Each item in the list can be an individual IP address or a Classless Inter-Domain Routing notation representing a CIDR block.
    - `allowed_numbers` string[], nullable — List of phone numbers that are allowed to use the trunk.
    - `media_encryption` 'disabled' | 'allowed' | 'required'
    - `credentials` SIPTrunkCredentialsRequestModel
      - `username` string, required — SIP trunk username
      - `password` string, nullable — SIP trunk password - if not specified, then remain unchanged
    - `remote_domains` string[], nullable — Domains of remote SIP servers used to validate TLS certificates.
    - `attributes_to_headers` object — Map of dynamic variable name to header name for attributes_to_headers
  - `outbound_trunk_config` OutboundSIPTrunkConfigRequestModel
    - `address` string, required — Hostname or IP the SIP INVITE is sent to.
    - `transport` 'auto' | 'udp' | 'tcp' | 'tls'
    - `media_encryption` 'disabled' | 'allowed' | 'required'
    - `headers` object — SIP X-* headers for INVITE request. These headers are sent as-is and may help identify this call.
    - `attributes_to_headers` object — Map of dynamic variable name to header name for attributes_to_headers
    - `credentials` SIPTrunkCredentialsRequestModel
      - `username` string, required — SIP trunk username
      - `password` string, nullable — SIP trunk password - if not specified, then remain unchanged
    - `enabled_codecs` MediaCodec[] — Media codecs that should be offered in the SDP for outbound calls. If empty, all supported codecs are offered.
  - `livekit_stack` 'standard' | 'static'
  - `store_sip_messages` boolean, nullable
  - `environment` string, nullable — Environment to use for resolving environment variables on calls to this number.
  - `branch_id` string, nullable — Agent branch to use for calls to this number.

## Response `200`

Successful Response

- union
  - GetPhoneNumberTwilioResponseModel
    - `phone_number` string, required — Phone number
    - `label` string, required — Label for the phone number
    - `supports_inbound` boolean — This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls
    - `supports_outbound` boolean — This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls
    - `phone_number_id` string, required — The ID of the phone number
    - `assigned_agent` PhoneNumberAgentInfo
      - `agent_id` string, required — The ID of the agent
      - `agent_name` string, required — The name of the agent
      - `environment` string, nullable — Environment to use for resolving environment variables on calls to this number.
      - `branch_id` string, nullable — Agent branch to use for calls to this number.
    - `provider` 'twilio' — Phone provider
  - GetPhoneNumberExotelResponseModel
    - `phone_number` string, required — Phone number
    - `label` string, required — Label for the phone number
    - `supports_inbound` boolean — This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls
    - `supports_outbound` boolean — This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls
    - `phone_number_id` string, required — The ID of the phone number
    - `assigned_agent` PhoneNumberAgentInfo
      - `agent_id` string, required — The ID of the agent
      - `agent_name` string, required — The name of the agent
      - `environment` string, nullable — Environment to use for resolving environment variables on calls to this number.
      - `branch_id` string, nullable — Agent branch to use for calls to this number.
    - `provider` 'exotel' — Phone provider
  - GetPhoneNumberSIPTrunkResponseModel
    - `phone_number` string, required — Phone number
    - `label` string, required — Label for the phone number
    - `supports_inbound` boolean — This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls
    - `supports_outbound` boolean — This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls
    - `phone_number_id` string, required — The ID of the phone number
    - `assigned_agent` PhoneNumberAgentInfo
      - `agent_id` string, required — The ID of the agent
      - `agent_name` string, required — The name of the agent
      - `environment` string, nullable — Environment to use for resolving environment variables on calls to this number.
      - `branch_id` string, nullable — Agent branch to use for calls to this number.
    - `provider` 'sip_trunk' — Phone provider
    - `provider_config` GetPhoneNumberOutboundSIPTrunkConfigResponseModel — SIP Trunk configuration details for a phone number
      - `address` string, required — Hostname or IP the SIP INVITE is sent to
      - `transport` 'auto' | 'udp' | 'tcp' | 'tls', required
      - `media_encryption` 'disabled' | 'allowed' | 'required', required
      - `headers` object — SIP headers for INVITE request
      - `attributes_to_headers` object — Map of dynamic variable name to header name for attributes_to_headers
      - `has_auth_credentials` boolean, required — Whether authentication credentials are configured
      - `username` string, nullable — SIP trunk username (if available)
      - `has_outbound_trunk` boolean — Whether a LiveKit SIP outbound trunk is configured
      - `enabled_codecs` MediaCodec[] — Media codecs that are offered in the SDP for outbound calls. If empty, all supported codecs are offered.
    - `outbound_trunk` GetPhoneNumberOutboundSIPTrunkConfigResponseModel — SIP Trunk configuration details for a phone number
      - `address` string, required — Hostname or IP the SIP INVITE is sent to
      - `transport` 'auto' | 'udp' | 'tcp' | 'tls', required
      - `media_encryption` 'disabled' | 'allowed' | 'required', required
      - `headers` object — SIP headers for INVITE request
      - `attributes_to_headers` object — Map of dynamic variable name to header name for attributes_to_headers
      - `has_auth_credentials` boolean, required — Whether authentication credentials are configured
      - `username` string, nullable — SIP trunk username (if available)
      - `has_outbound_trunk` boolean — Whether a LiveKit SIP outbound trunk is configured
      - `enabled_codecs` MediaCodec[] — Media codecs that are offered in the SDP for outbound calls. If empty, all supported codecs are offered.
    - `inbound_trunk` GetPhoneNumberInboundSIPTrunkConfigResponseModel
      - `allowed_addresses` string[], required — List of IP addresses that are allowed to use the trunk. Each item in the list can be an individual IP address or a Classless Inter-Domain Routing notation representing a CIDR block.
      - `allowed_numbers` string[], nullable, required — List of phone numbers that are allowed to use the trunk.
      - `media_encryption` 'disabled' | 'allowed' | 'required', required
      - `has_auth_credentials` boolean, required — Whether authentication credentials are configured
      - `username` string, nullable — SIP trunk username (if available)
      - `remote_domains` string[], nullable — Domains of remote SIP servers used to validate TLS certificates.
      - `attributes_to_headers` object — Map of dynamic variable name to header name for attributes_to_headers
    - `livekit_stack` 'standard' | 'static', required
    - `store_sip_messages` boolean — Whether to store SIP messages for this phone number.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation.md) · [All operations](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elevenlabs/elevenlabs-api-documentation/revisions/d1a4847203ce/schema)
