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

# Update SIP trunk



## OpenAPI

````yaml patch /v1/sip-trunks/{id}
openapi: 3.0.3
info:
  title: Vatel AI REST API
  description: >-
    Programmatic access for agents, telephony, and session tokens. Send
    `Authorization: Bearer <organization API key>` on all requests unless noted.
    Most error responses return JSON with an `error` string message.
  version: 0.2.4
servers:
  - url: https://api.vatel.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: organization
    description: Organization tied to your API key
  - name: llms
    description: LLM model identifiers
  - name: voices
    description: TTS voice catalog
  - name: agents
    description: Agents, outbound dial, agent versions
  - name: twilio
    description: Imported Twilio phone numbers
  - name: sip-trunks
    description: SIP trunk configuration
  - name: session
    description: Session tokens and voice WebSocket connections.
  - name: calls
    description: Call history, recordings, and live eavesdrop for your organization
  - name: eavesdrop
    description: Listen to live calls and send supervisor commands over WebSocket.
paths:
  /v1/sip-trunks/{id}:
    patch:
      tags:
        - sip-trunks
      summary: Update SIP trunk
      operationId: patchSipTrunk
      parameters:
        - name: id
          in: path
          required: true
          description: SIP trunk id
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SipTrunkUpdateInput'
      responses:
        '200':
          description: Updated trunk
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipTrunk'
        '400':
          description: Validation error or no fields to update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Inbound SIP username already in use
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SipTrunkUpdateInput:
      type: object
      description: >-
        Patch only fields you need; empty string clears optional text fields per
        server rules.
      properties:
        pbx:
          type: string
          enum:
            - 3cx
            - yeastar
            - webex
            - generic
          description: Vendor preset or `generic` for other/custom PBX.
        caller_id_transforms:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/SipTrunkCallerIDTransform'
          description: Replace transforms; empty array clears.
        inbound_host:
          type: string
          nullable: true
          description: Inbound host; with `acl` auth, must match the ACL-validated host.
        inbound_auth_type:
          $ref: '#/components/schemas/SIPTrunkAuthType'
          nullable: true
        inbound_sip_username:
          type: string
          nullable: true
        inbound_sip_password:
          type: string
          nullable: true
          description: Set to rotate inbound secret.
        outbound_host:
          type: string
          nullable: true
          description: Outbound dial host for calls, on-call, and transfers.
        outbound_sip_username:
          type: string
          nullable: true
        outbound_sip_password:
          type: string
          nullable: true
        register:
          type: boolean
          nullable: true
        remain_in_dialog:
          type: boolean
          nullable: true
    SipTrunk:
      type: object
      description: SIP connectivity profile for a supported PBX integration.
      properties:
        id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        pbx:
          type: string
          description: >-
            PBX vendor preset (`3cx`, `yeastar`, `webex`) applying default trunk
            behavior, or `generic` for other / custom PBX setups where you
            supply hosts and credentials explicitly.
          enum:
            - 3cx
            - yeastar
            - webex
            - generic
        caller_id_transforms:
          type: array
          items:
            $ref: '#/components/schemas/SipTrunkCallerIDTransform'
          description: Ordered transforms applied to caller id.
        inbound_host:
          type: string
          description: >-
            Inbound SIP host or domain. When `inbound_auth_type` is `acl`, this
            is the host validated against the ACL (allowed source for inbound
            calls).
        inbound_auth_type:
          $ref: '#/components/schemas/SIPTrunkAuthType'
        inbound_sip_username:
          type: string
          description: SIP user for inbound registration if used.
        inbound_registration_status:
          $ref: '#/components/schemas/RegistrationStatus'
        outbound_host:
          type: string
          description: >-
            SIP host used for outbound legs: platform-initiated calls, on-call
            flows, and transfers dial out via this host (your carrier or SBC).
        outbound_sip_username:
          type: string
          description: Credentials username for outbound, if any.
        register:
          type: boolean
          description: Whether the platform registers this trunk with the carrier.
        outbound_registration_status:
          $ref: '#/components/schemas/RegistrationStatus'
        remain_in_dialog:
          type: boolean
          description: Keeping SIP dialog routing behavior when true.
    ErrorResponse:
      type: object
      description: Standard error body for most non-2xx JSON responses on this API.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message; may include validation detail.
    SipTrunkCallerIDTransform:
      type: object
      description: Rule applied to caller id on this trunk.
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/CallerTransformType'
        value:
          type: string
          description: Primary operand (e.g. prefix string).
        value2:
          type: string
          description: Secondary operand when the transform requires it.
        number:
          type: integer
          description: Numeric parameter (e.g. digit count) when applicable.
    SIPTrunkAuthType:
      type: string
      description: >-
        How inbound SIP is authenticated. `acl`: carrier traffic must match the
        ACL; `inbound_host` is the ACL-validated host. `digest`: SIP digest
        authentication. `none`: no inbound auth configured.
      enum:
        - digest
        - acl
        - none
    RegistrationStatus:
      type: string
      description: Last known SIP registration outcome for the trunk leg.
      enum:
        - not_registered
        - pending
        - registered
        - failed
        - auth_failed
    CallerTransformType:
      type: string
      description: How to adjust caller id before routing.
      enum:
        - add_prefix
        - add_suffix
        - replace
        - strip_digits_end
        - strip_digits_start
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Send your organization API key as `Authorization: Bearer <key>`.'

````