> ## 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.

# Create new SIP integration

> Saves the settings to the local database and sends them to cleartalk AI



## OpenAPI

````yaml post /sip/attach2
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/attach2:
    post:
      tags:
        - sip
      summary: Create new SIP integration
      description: Saves the settings to the local database and sends them to cleartalk AI
      operationId: SIPController_createSipIntegration
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSipIntegrationDto'
      responses:
        '201':
          description: Integration created successfully.
        '400':
          description: Invalid or missing data.
        '500':
          description: Internal error or failure in cleartalk AI.
      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

````