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

# Provision Sip Trunk

> Add a SIP trunk line from any carrier with its numbers in one request and build its call route. Numbers are checked before anything is created; if a number is still refused while numbers are added, the new line is removed again and the original error is returned. The organization's default outbound line changes only after everything succeeds. The first number is the default caller ID. Returns the line's readiness. `400`: invalid trunk settings or numbers, or a number listed twice (nothing created). `409`: the name is already used, or a number belongs to another line in the organization.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/organizations/sip-trunks/provision
openapi: 3.1.0
info:
  title: Athena API
  version: 1.0.0
  description: >-
    Hosted Athena customer API. Authenticate backend management and call-trigger
    requests with X-API-Key. Website embeds and artifact playback use their own
    scoped tokens. Provider availability, feature settings, and verification
    limits are described in the guides.
servers:
  - url: https://athena.tryopencomputer.com
    description: Hosted Athena API
security: []
paths:
  /api/v1/organizations/sip-trunks/provision:
    post:
      tags:
        - Organizations
      summary: Provision Sip Trunk
      description: >-
        Add a SIP trunk line from any carrier with its numbers in one request
        and build its call route. Numbers are checked before anything is
        created; if a number is still refused while numbers are added, the new
        line is removed again and the original error is returned. The
        organization's default outbound line changes only after everything
        succeeds. The first number is the default caller ID. Returns the line's
        readiness. `400`: invalid trunk settings or numbers, or a number listed
        twice (nothing created). `409`: the name is already used, or a number
        belongs to another line in the organization.
      operationId: provision_sip_trunk_api_v1_organizations_sip_trunks_provision_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SipTrunkProvisionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipLineReadiness'
        '400':
          description: Invalid trunk settings or numbers. Nothing was created.
        '401':
          description: Authentication is missing or invalid.
        '404':
          description: Not found
        '409':
          description: Name already used, or a number is on another line.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    SipTrunkProvisionRequest:
      properties:
        name:
          type: string
          maxLength: 64
          minLength: 1
          title: Name
        address:
          type: string
          title: Address
          description: SIP trunk host your carrier gave you, e.g. trunk.example.com
        username:
          anyOf:
            - type: string
            - type: 'null'
          title: Username
          description: SIP login (blank if the carrier authorises by IP)
        password:
          anyOf:
            - type: string
            - type: 'null'
          title: Password
          description: SIP password
        transport:
          anyOf:
            - type: string
            - type: 'null'
          title: Transport
          description: tcp (recommended), tls or udp
          default: tcp
        numbers:
          items:
            type: string
          type: array
          maxItems: 50
          minItems: 1
          title: Numbers
          description: E.164 numbers on this trunk; the first is the caller ID
        country_code:
          anyOf:
            - type: string
              maxLength: 2
              minLength: 2
            - type: 'null'
          title: Country Code
        is_default_outbound:
          type: boolean
          title: Is Default Outbound
          default: false
      type: object
      required:
        - name
        - address
        - numbers
      title: SipTrunkProvisionRequest
      description: >-
        Body for ``POST /sip-trunks/provision``: a SIP trunk from any carrier
        plus the numbers on it.
    SipLineReadiness:
      properties:
        configuration_id:
          type: integer
          title: Configuration Id
        ready:
          type: boolean
          title: Ready
        route_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Route Id
        route_state:
          anyOf:
            - type: string
            - type: 'null'
          title: Route State
        numbers:
          items:
            type: string
          type: array
          title: Numbers
          default: []
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      type: object
      required:
        - configuration_id
        - ready
      title: SipLineReadiness
      description: >-
        Whether a line can place calls now; ``reason`` is written for the
        customer and never carries carrier text.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.