> ## Documentation Index
> Fetch the complete documentation index at: https://docs.verbex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update the configuration of an existing phone number

> Update the configuration of an existing phone number. This endpoint allows you to:

- Modify the AI agent association
- Update SIP trunk settings for Import Phone Numbers
- Adjust routing rules and call handling preferences
- Update metadata and labels



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/phone-numbers/{phone_number_id}
openapi: 3.1.0
info:
  title: Verbex Platform API
  description: API for managing AI agents, calls, phone numbers, and more.
  version: 1.0.0
servers: []
security: []
paths:
  /v1/phone-numbers/{phone_number_id}:
    patch:
      tags:
        - Phone Numbers
      summary: Update the configuration of an existing phone number
      description: >-
        Update the configuration of an existing phone number. This endpoint
        allows you to:


        - Modify the AI agent association

        - Update SIP trunk settings for Import Phone Numbers

        - Adjust routing rules and call handling preferences

        - Update metadata and labels
      operationId: update_phone_number_v1_phone_numbers__phone_number_id__patch
      parameters:
        - name: phone_number_id
          in: path
          required: true
          schema:
            type: string
            title: Phone Number Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/UpdateSIPPhoneNumberRequest'
                - $ref: '#/components/schemas/UpdatePiaPhoneNumberRequest'
                - $ref: '#/components/schemas/UpdateTwilioPhoneNumberRequest'
              title: Update Data
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/GetSIPPhoneNumberResponse'
                  - $ref: '#/components/schemas/GetPiaPhoneNumberResponse'
                  - $ref: '#/components/schemas/GetTwilioPhoneNumberResponse'
                title: >-
                  Response Update Phone Number V1 Phone Numbers  Phone Number
                  Id  Patch
        '404':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/app__phone_numbers__schemas__ErrorResponse
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/app__phone_numbers__schemas__ErrorResponse
          description: Internal Server Error
components:
  schemas:
    UpdateSIPPhoneNumberRequest:
      properties:
        friendly_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Friendly Name
          description: >-
            A human-readable label for this phone number to help identify its
            purpose
        inbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Inbound Agent Id
          description: ID of the AI agent that will handle incoming calls to this number
        outbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Outbound Agent Id
          description: >-
            ID of the AI agent that will be used when making outbound calls from
            this number
        sip_termination_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Termination Uri
          description: >-
            The SIP URI where calls to this Import Phone Number should be
            terminated
        sip_trunk_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Trunk Username
          description: Username for authenticating with the SIP trunk provider
        sip_trunk_password:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Trunk Password
          description: Password for authenticating with the SIP trunk provider
      type: object
      title: UpdateSIPPhoneNumberRequest
    UpdatePiaPhoneNumberRequest:
      properties:
        friendly_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Friendly Name
          description: >-
            A human-readable label for this phone number to help identify its
            purpose
        inbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Inbound Agent Id
          description: ID of the AI agent that will handle incoming calls to this number
        outbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Outbound Agent Id
          description: >-
            ID of the AI agent that will be used when making outbound calls from
            this number
      type: object
      title: UpdatePiaPhoneNumberRequest
    UpdateTwilioPhoneNumberRequest:
      properties:
        friendly_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Friendly Name
          description: >-
            A human-readable label for this phone number to help identify its
            purpose
        twilio_account_sid:
          anyOf:
            - type: string
            - type: 'null'
          title: Twilio Account Sid
          description: The Twilio Account SID for authenticating with Twilio's API
        twilio_auth_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Twilio Auth Token
          description: The Twilio Auth Token for authenticating with Twilio's API
        inbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Inbound Agent Id
          description: ID of the AI agent that will handle incoming calls to this number
        outbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Outbound Agent Id
          description: >-
            ID of the AI agent that will be used when making outbound calls from
            this number
      type: object
      title: UpdateTwilioPhoneNumberRequest
    GetSIPPhoneNumberResponse:
      properties:
        _id:
          type: string
          title: Id
          description: Unique identifier for this phone number record
        provider:
          type: string
          const: sip
          title: Provider
          description: Indicates this is an Import Phone Number (SIP provider)
          default: sip
        phone_number:
          type: string
          title: Phone Number
          description: >-
            The phone number in E.164 format, including country code (e.g.,
            +14155552671)
        friendly_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Friendly Name
          description: A human-readable label for this phone number
        sip_termination_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Termination Uri
          description: The SIP URI where calls are terminated
        sip_trunk_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Trunk Username
          description: Username for SIP trunk authentication
        sip_trunk_password:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Trunk Password
          description: Password for SIP trunk authentication
        inbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Inbound Agent Id
          description: ID of the AI agent handling incoming calls
        outbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Outbound Agent Id
          description: ID of the AI agent used for outbound calls
        sip_infra_region:
          type: string
          enum:
            - global
            - bd
            - bd_link3
          title: Sip Infra Region
          description: >-
            The infrastructure region for SIP routing: 'global' or 'bd'
            (Bangladesh)
          default: global
      type: object
      required:
        - phone_number
      title: GetSIPPhoneNumberResponse
    GetPiaPhoneNumberResponse:
      properties:
        _id:
          type: string
          title: Id
          description: Unique identifier for this phone number record
        provider:
          type: string
          const: pia
          title: Provider
          description: Indicates this is a Pia Platform managed phone number
          default: pia
        phone_number:
          type: string
          title: Phone Number
          description: The phone number in E.164 format (e.g., +14155552671)
        friendly_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Friendly Name
          description: A human-readable label for this phone number
        inbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Inbound Agent Id
          description: ID of the AI agent handling incoming calls
        outbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Outbound Agent Id
          description: ID of the AI agent used for outbound calls
      type: object
      required:
        - phone_number
      title: GetPiaPhoneNumberResponse
    GetTwilioPhoneNumberResponse:
      properties:
        _id:
          type: string
          title: Id
          description: Unique identifier for this phone number record
        provider:
          type: string
          const: twilio
          title: Provider
          description: Indicates this is a direct Twilio integration phone number
          default: twilio
        phone_number:
          type: string
          title: Phone Number
          description: >-
            The phone number in E.164 format, including country code (e.g.,
            +14155552671)
        friendly_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Friendly Name
          description: A human-readable label for this phone number
        twilio_account_sid:
          anyOf:
            - type: string
            - type: 'null'
          title: Twilio Account Sid
          description: The Twilio Account SID used for API authentication
        twilio_auth_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Twilio Auth Token
          description: The Twilio Auth Token used for API authentication
        inbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Inbound Agent Id
          description: ID of the AI agent handling incoming calls
        outbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Outbound Agent Id
          description: ID of the AI agent used for outbound calls
      type: object
      required:
        - phone_number
      title: GetTwilioPhoneNumberResponse
    app__phone_numbers__schemas__ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A short error code identifying the type of error that occurred
        message:
          type: string
          title: Message
          description: >-
            A detailed human-readable message explaining the error and possible
            solutions
      type: object
      required:
        - error
        - message
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````