---
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}`

## Request

- Base URL: `https://api.elevenlabs.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.elevenlabs.io/v1/convai/phone-numbers/{phone_number_id}`
- Auth: none declared

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

## Changes

- **2026-07-13** `009bd651509a`: 3 info
  - added the new optional request property `outbound_trunk_config/anyOf[subschema #1: OutboundSIPTrunkConfigRequestModel]/enabled_codecs`
  - added the optional property `oneOf[subschema #3: GetPhoneNumberSIPTrunkResponseModel]/outbound_trunk/anyOf[subschema #1: GetPhoneNumberOutboundSIPTrunkConfigResponseModel]/enabled_codecs` to the response with the `200` status
  - added the optional property `oneOf[subschema #3: GetPhoneNumberSIPTrunkResponseModel]/provider_config/anyOf[subschema #1: GetPhoneNumberOutboundSIPTrunkConfigResponseModel]/enabled_codecs` to the response with the `200` status
- **2026-06-08** `37fac3c5a2d7`: 1 breaking, 14 info
  - added `#/components/schemas/GetPhoneNumberExotelResponseModel` to the response body `oneOf` list for the response status `200`
  - added the new optional request property `branch_id`
  - added the new optional request property `environment`
  - added the new optional request property `inbound_trunk_config/anyOf[subschema #1: InboundSIPTrunkConfigRequestModel]/attributes_to_headers`
  - …11 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/changes/v1/convai/phone-numbers/:phone_number_id/patch.md)

---

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