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

# Create SIP trunk



## OpenAPI

````yaml post /v1/sip-trunks
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:
    post:
      tags:
        - sip-trunks
      summary: Create SIP trunk
      operationId: createSipTrunk
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SipTrunkCreateInput'
      responses:
        '201':
          description: Created trunk
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipTrunk'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
        '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'
        '503':
          description: SIP connectivity is not available in this environment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SipTrunkCreateInput:
      type: object
      description: Create a SIP trunk; passwords are write-only on the wire.
      required:
        - pbx
      properties:
        pbx:
          type: string
          description: PBX vendor preset or `generic` for other/custom PBX configurations.
          enum:
            - 3cx
            - yeastar
            - webex
            - generic
        caller_id_transforms:
          type: array
          items:
            $ref: '#/components/schemas/SipTrunkCallerIDTransform'
        inbound_host:
          type: string
          nullable: true
          description: >-
            Inbound SIP host or domain; when inbound auth is `acl`, this host is
            ACL-validated for inbound traffic.
        inbound_auth_type:
          $ref: '#/components/schemas/SIPTrunkAuthType'
          nullable: true
        inbound_sip_username:
          type: string
          nullable: true
        inbound_sip_password:
          type: string
          nullable: true
          description: Inbound SIP secret if required.
        outbound_host:
          type: string
          nullable: true
          description: Host to dial for outbound calls, on-call, and transfers.
        outbound_sip_username:
          type: string
          nullable: true
        outbound_sip_password:
          type: string
          nullable: true
          description: Outbound SIP secret if required.
        register:
          type: boolean
          nullable: true
          description: Enable outbound registration when 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>`.'

````