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

# Update SIP integration configuration

> Updates trunk name and/or directions (inbound/outbound). Automatically manages attach/detach/update operations with cleartalk AI based on changes detected.



## OpenAPI

````yaml patch /sip/sip2
openapi: 3.0.0
info:
  title: ClearTalk API
  description: The ClearTalk API Documentation
  version: '1.0'
  contact:
    name: Developer Support
    email: devsupport@cleartalk.ai
servers:
  - url: https://api.cleartalk.ai
    description: ClearTalk AI API Server
security: []
tags: []
paths:
  /sip/sip2:
    patch:
      tags:
        - sip
      summary: Update SIP integration configuration
      description: >-
        Updates trunk name and/or directions (inbound/outbound). Automatically
        manages attach/detach/update operations with cleartalk AI based on
        changes detected.
      operationId: SIPController_updateSipIntegration
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSipIntegrationDto'
      responses:
        '200':
          description: SIP configuration updated successfully
          content:
            application/json:
              schema:
                example:
                  success: true
                  message: SIP configuration updated successfully
                  data:
                    config_id: uuid-here
                    trunk_name: TEST1
                    phone_number: '+12242880508'
                    directions_count: 2
                    cleartalk_response: {}
        '400':
          description: Bad request - uuid_config_id missing or invalid data
        '403':
          description: Forbidden - not owner of configuration
        '404':
          description: SipConfig not found
        '500':
          description: Failed to update SIP configuration
      security:
        - apiKey: []
components:
  schemas:
    CreateSipIntegrationDto:
      type: object
      properties:
        trunkName:
          type: string
          example: Head Office
          description: Internal name to identify the Trunk
        phone_number:
          type: string
          example: '+15550000000'
          description: Phone number assigned by cleartalk AI
        directions:
          type: array
          items:
            $ref: '#/components/schemas/DirectionConfig'
        uuid_config_id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: UUID of the configuration sip local
      required:
        - trunkName
        - phone_number
        - directions
    DirectionConfig:
      type: object
      properties:
        type:
          type: string
          example: outbound
          enum:
            - inbound
            - outbound
        headers:
          $ref: '#/components/schemas/HeaderConfig'
        sip_endpoint:
          type: string
          example: sip:192.168.1.100
        options:
          $ref: '#/components/schemas/SipOptions'
      required:
        - type
    HeaderConfig:
      type: object
      properties:
        direction:
          type: string
          example: outbound
        headers:
          type: array
          items:
            $ref: '#/components/schemas/SipHeaderItem'
      required:
        - direction
        - headers
    SipOptions:
      type: object
      properties:
        port:
          type: number
          example: 5060
        transport:
          type: string
          example: udp
          enum:
            - udp
            - tcp
            - tls
        secure_media:
          type: boolean
          example: false
        sip_username:
          type: string
        sip_password:
          type: string
    SipHeaderItem:
      type: object
      properties:
        type:
          type: string
          example: custom
          description: Header type (custom, uui)
        key:
          type: string
          example: X-Customer-ID
        value:
          type: string
          example: '12345'
        passthrough:
          type: boolean
          example: true
        target:
          type: string
          description: For UUI type only
        purpose:
          type: string
        encoding:
          type: string
        content:
          type: string
      required:
        - type
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````