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

# Update a SIP trunk

> Replaces the configuration of the SIP trunk identified by `id`. Omitted fields revert to their defaults.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml put /v1/trunks/{id}
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
paths:
  /v1/trunks/{id}:
    put:
      tags:
        - SIP trunks
      summary: Update a SIP trunk
      description: >-
        Replaces the configuration of the SIP trunk identified by `id`. Omitted
        fields revert to their defaults.
      operationId: sip_trunks_update
      parameters:
        - name: id
          in: path
          description: The unique ID of the SIP trunk.
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            example: 3107
      requestBody:
        description: >-
          Full replacement of the SIP trunk. Omitted fields revert to their
          defaults.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SIPTrunkCreateRequest'
        required: true
      responses:
        '200':
          description: Returns the updated SIP trunk.
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SIPTrunkResponse'
              examples:
                success:
                  summary: Successful response
                  value:
                    id: 293
                    name: '67758'
                    callerid: '12345678900'
                    label: My trunk
                    ip_restrict: false
                    allowed_ips:
                      - id: 6712
                        ip: 127.0.0.1
                    channels_restrict: false
                    max_channels: 2
                    cost_limit: true
                    max_call_cost: '0.18'
                    call_restrict: false
                    call_limit: 3600
                    didinfo_enabled: true
                    rewrite_enabled: true
                    rewrite_prefix: '1'
                    rewrite_cond: example
                    call_recording_enabled: true
                    machine_detection_enabled: true
                    transcription_enabled: false
                    transcription_threshold: 10
                    created_at: '2023-05-16T17:13:25.000Z'
                    host: dynamic
                    multiple_numbers: true
                    encrypted_media: true
                    access_token: 123easwqe321132
        '400':
          $ref: '#/components/responses/ValidationErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
      deprecated: false
      security:
        - bearerAuth:
            - trunks:write
components:
  schemas:
    SIPTrunkCreateRequest:
      title: SIPTrunkCreateRequest
      required:
        - label
        - password
        - callerid
        - ip_restrict
        - didinfo_enabled
        - call_restrict
        - cost_limit
        - channels_restrict
        - rewrite_enabled
        - transcription_enabled
        - transcription_threshold
      type: object
      additionalProperties: false
      properties:
        label:
          type: string
          description: User-defined name of the SIP trunk
          example: My trunk
        password:
          type: string
          description: >-
            Password set for the SIP trunk. A strong password helps keep the
            trunk secure.
          example: 4r=h;EaCB85QNtr2
        host_request:
          type: object
          description: >-
            For SIP trunks with IP authentication, includes the SIP endpoint
            public static IP address and the status of the authentication
            request. Wavix authenticates all SIP traffic originating from this
            IP address.
          additionalProperties: false
          required:
            - host
          properties:
            host:
              type: string
              description: SIP endpoint public static IP address
              example: 127.0.0.1
        callerid:
          type: string
          description: >-
            Caller ID associated with the SIP trunk. Must be an active or
            verified number on the account.
          example: '13132847320'
        multiple_numbers:
          type: boolean
          description: >-
            Indicates whether any active or verified phone number on the account
            can be used as the Caller ID for the SIP trunk.
        ip_restrict:
          type: boolean
          description: >-
            Indicates whether SIP trunk registration is allowed from only
            specific public static IP addresses. When set to `true`, the
            `allowed_ips` parameter must be provided.
          example: false
        allowed_ips:
          type:
            - array
            - 'null'
          description: >-
            A list of public static IP addresses allowed to register with the
            SIP trunk
          items:
            type: object
            additionalProperties: false
            required:
              - ip
            properties:
              ip:
                type: string
                description: >-
                  Public static IP address allowed to register with the SIP
                  trunk.
                example: 127.0.0.1
        didinfo_enabled:
          type: boolean
          description: >-
            Indicates whether inbound calls include dialed number information in
            the `To` header of SIP INVITE requests
          example: true
        call_restrict:
          type: boolean
          description: >-
            Indicates whether a maximum call duration limit is enforced for the
            SIP trunk
          example: true
        call_limit:
          type: integer
          description: >-
            Maximum call duration for the SIP trunk, in seconds. Must not exceed
            the maximum duration set for the account. Ignored when
            `call_restrict` is `false`.
          format: int32
          example: 3600
        cost_limit:
          type: boolean
          description: >-
            Indicates if the max cost limit for an outbound call limit is
            activated for the SIP trunk.
          default: false
          example: true
        max_call_cost:
          type: number
          format: decimal
          description: Maximum cost for an outbound call, in USD
          example: 0.18
        channels_restrict:
          type: boolean
          description: >-
            Indicates whether a limit on the number of concurrent outbound calls
            is enforced for the SIP trunk
          example: false
        max_channels:
          type: integer
          description: >-
            Maximum number of concurrent outbound calls for the SIP trunk. Must
            not exceed the outbound channel capacity set for the account.
            Ignored when `channels_restrict` is `false`.
          format: int32
          example: 2
        rewrite_enabled:
          type: boolean
          description: Indicates whether a custom dial plan is activated for the SIP trunk
          example: true
        rewrite_prefix:
          type: string
          description: Digits to automatically prepend to each dialed phone number
          example: '1'
        rewrite_cond:
          type: string
          description: >-
            Number of leading digits to automatically remove from each dialed
            phone number
        call_recording_enabled:
          type: boolean
          description: >-
            Indicates whether outbound call recording is enabled for the SIP
            trunk
          example: true
        transcription_enabled:
          type: boolean
          description: >-
            Indicates whether automatic call transcription is enabled for the
            SIP trunk.

            Available for `Flex Pro` customers only.
          example: true
        transcription_threshold:
          type: integer
          description: >-
            Transcriptions will be generated for calls that meet or exceed the
            specified minimal call duration threshold, in seconds.

            Available for `Flex Pro` customers only.
          format: int32
          example: 10
        machine_detection_enabled:
          type: boolean
          description: >-
            Indicates whether automatic voicemail detection is enabled for the
            SIP trunk.

            Available for `Flex Pro` customers only.
          example: true
        encrypted_media:
          type: boolean
          description: >-
            Indicates whether SRTP media encryption is enabled for the SIP
            trunk.
          example: true
    SIPTrunkResponse:
      title: SIPTrunkResponse
      required:
        - id
        - name
        - callerid
        - label
        - allowed_ips
        - created_at
      type: object
      additionalProperties: false
      properties:
        id:
          type: integer
          description: Unique identifier of the SIP trunk on the platform
          format: int32
          example: 293
        name:
          type: string
          description: System-generated login name of the SIP trunk
          example: '67758'
        callerid:
          type:
            - string
            - 'null'
          description: >-
            Caller ID configured on the SIP trunk. Contains `null` if no Caller
            ID is set, or an empty string if multiple Caller IDs are allowed.
          example: '12345678900'
        label:
          type: string
          description: User-defined name of the SIP trunk
          example: My trunk
        ip_restrict:
          type: boolean
          description: Indicates whether IP restriction must be enabled on the SIP trunk
          default: false
          example: false
        allowed_ips:
          $ref: '#/components/schemas/AllowedIPs'
        channels_restrict:
          type: boolean
          description: >-
            Indicates if the max number of concurrent outbound calls limit is
            activated for the SIP trunk.
          default: false
          example: false
        max_channels:
          type:
            - integer
            - 'null'
          description: >-
            A maximum number of concurrent outbound calls placed via the SIP
            trunk. Cannot be higher than the outbound channel capacity
            configured on the account.
          format: int32
          example: 2
        cost_limit:
          type: boolean
          description: >-
            Indicates if the max cost limit for an outbound call limit is
            activated for the SIP trunk.
          default: false
          example: true
        max_call_cost:
          type:
            - string
            - 'null'
          description: A maximum cost of an outbound call, in USD.
          example: '0.18'
        call_restrict:
          type:
            - boolean
            - 'null'
          description: >-
            Indicates if maximum call duration limit is activated for the SIP
            trunk.
          default: false
          example: false
        call_limit:
          type:
            - integer
            - 'null'
          description: >-
            A maximum call duration for the SIP trunk, in seconds. Cannot be
            higher than the max call duration set for the account.
          format: int32
          example: 3600
        didinfo_enabled:
          type: boolean
          description: >-
            Indicates if inbound calls carry dialed number information in the
            'To' header of SIP Invites
          default: true
          example: true
        rewrite_enabled:
          type: boolean
          description: Indicates if a custom dial plan is activated for the SIP trunk.
          default: false
          example: true
        rewrite_prefix:
          type: string
          description: Leading digits to be added before the dialed phone numbers.
          example: '1'
        rewrite_cond:
          type: string
          description: Leading digits to be deleted from the dialed phone numbers.
        call_recording_enabled:
          type: boolean
          description: >-
            Indicates if outbound call recording is enabled on the SIP trunk.
            Available for `Flex Pro` customers only.
          default: false
          example: true
        machine_detection_enabled:
          type: boolean
          description: >-
            Indicates if automatic voicemail detection is enabled on the SIP
            trunk. Available for `Flex Pro` customers only.
          default: false
          example: true
        transcription_enabled:
          type: boolean
          description: >-
            Indicates if automatic call transcription is enabled on the SIP
            trunk. Available for `Flex Pro` customers only.
          default: false
          example: false
        transcription_threshold:
          type: integer
          description: >-
            Transcriptions will be generated for calls that meet or exceed the
            specified minimal call duration threshold, in seconds
          format: int32
          default: 6
          example: 10
        created_at:
          type: string
          description: Date and time the SIP trunk was created
          format: date-time
          example: '2023-05-16T17:13:25.000Z'
        host:
          type: string
          description: >-
            Registration host for the SIP trunk. `dynamic` for credential-based
            registration, or a public static IP address for IP authentication.
          example: dynamic
        multiple_numbers:
          type: boolean
          description: >-
            Indicates whether any active or verified phone number on the account
            can be used as the Caller ID for the SIP trunk.
          example: true
        encrypted_media:
          type: boolean
          description: >-
            Indicates whether SRTP media encryption is enabled for the SIP
            trunk.
          example: true
        passthrough:
          type: boolean
          description: Indicates whether Caller ID passthrough is enabled.
          example: true
        access_token:
          type:
            - string
            - 'null'
          description: Static authentication token for the SIP trunk.
          example: 123easwqe321132
    AllowedIPs:
      title: AllowedIPs
      type: array
      items:
        type: object
        additionalProperties: false
        required:
          - id
          - ip
        properties:
          id:
            type: integer
            description: IP address ID.
            format: int32
            example: 6712
          ip:
            type: string
            description: Public static IP address.
            example: 127.0.0.1
    ValidationErrorResponse:
      title: ValidationErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description naming the missing or invalid request
            parameter.
          example: Missing or invalid parameter <param_name>
    UnauthorizedErrorResponse:
      title: UnauthorizedErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        error:
          type: boolean
          description: >-
            Indicates that the response represents an error. Always `true` for
            this error.
          example: true
        message:
          type: string
          description: >-
            Human-readable description stating that authentication is missing or
            invalid.
          example: Unauthorized
    ForbiddenErrorResponse:
      title: ForbiddenErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable description of why access is forbidden.
          example: The service is not provisioned for your account.
    NotFoundErrorResponse:
      title: NotFoundErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description stating that no resource matches the
            given ID.
          example: Record not found
  responses:
    ValidationErrorResponse:
      description: Validation error
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
    UnauthorizedErrorResponse:
      description: Unauthorized
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedErrorResponse'
    ForbiddenErrorResponse:
      description: Request failed. The feature is disabled for your account.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
    NotFoundErrorResponse:
      description: Request failed. An object with the specified ID is not found.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````