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

# Get a SIP Trunk



## OpenAPI

````yaml GET /v1/accounts/{account_id}/telephony/sip-trunks/{trunk_id}
openapi: 3.0.3
info:
  title: PolyAI SIP Trunking API
  version: 1.0.0
  description: Management API for PolyAI SIP Trunks and their Extensions.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
security:
  - polyApiKey: []
tags:
  - name: SIP Trunks
    description: >-
      A SIP Trunk is a virtual connection between your telephony platform and
      PolyAI. It authenticates callers, accepts inbound calls, and holds the
      list of Extensions that map a dialed number to a PolyAI agent.
  - name: SIP Trunk Extensions
    description: >-
      An Extension binds a dialed number on a trunk to a PolyAI agent. When a
      call reaches a trunk, the dialed user part is matched against that trunk's
      extensions to pick the agent.
  - name: Outbound Calls
    description: Place and query outbound calls that route over a SIP Trunk.
paths:
  /v1/accounts/{account_id}/telephony/sip-trunks/{trunk_id}:
    parameters:
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/trunk_id'
    get:
      tags:
        - SIP Trunks
      summary: Get a SIP Trunk
      operationId: getSipTrunk
      responses:
        '200':
          description: The SIP Trunk.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipTrunk'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    account_id:
      name: account_id
      in: path
      required: true
      description: ID of the account that owns the SIP Trunk.
      schema:
        type: string
    trunk_id:
      name: trunk_id
      in: path
      required: true
      description: The SIP Trunk ID.
      schema:
        type: string
  schemas:
    SipTrunk:
      type: object
      description: A SIP Trunk.
      properties:
        id:
          type: string
          description: PolyAI-generated SIP Trunk ID, e.g. `tr-0123456789abcdefghijklmn`.
        account_id:
          type: string
          description: The PolyAI account that owns the SIP Trunk.
        sip_cidr:
          type: array
          description: The IPv4 CIDR blocks of your SIP servers.
          items:
            type: string
        rtp_cidr:
          type: array
          description: The IPv4 CIDR blocks of your RTP / media servers.
          items:
            type: string
        name:
          type: string
          description: A friendly name to help identify your SIP Trunk.
        encrypted:
          type: boolean
          description: >-
            Whether this SIP Trunk will handle encrypted (true; SIP over
            TCP/TLS, media over UDP/SRTP) or unencrypted (false; SIP over UDP,
            media over UDP/RTP) calls.
        inbound:
          $ref: '#/components/schemas/SipTrunkInbound'
        outbound:
          $ref: '#/components/schemas/SipTrunkOutbound'
        created_at:
          type: string
          format: date-time
          description: RFC 3339 timestamp of when the SIP Trunk was created.
        updated_at:
          type: string
          format: date-time
          description: RFC 3339 timestamp of when the SIP Trunk was last updated.
      required:
        - id
        - account_id
        - sip_cidr
        - rtp_cidr
        - name
        - encrypted
        - inbound
        - created_at
        - updated_at
    SipTrunkInbound:
      type: object
      description: Configuration for inbound calls.
      properties:
        hostname:
          type: string
          description: Hostname that uniquely identifies this SIP Trunk.
        sip_auth:
          $ref: '#/components/schemas/SipAuth'
        sip_token_auth:
          $ref: '#/components/schemas/SipTokenAuth'
        default_route:
          $ref: '#/components/schemas/DefaultRoute'
      required:
        - hostname
        - sip_auth
        - sip_token_auth
    SipTrunkOutbound:
      type: object
      description: Configuration for outbound calls leaving PolyAI.
      properties:
        sip_addresses:
          type: array
          description: The SIP addresses of your SIP servers to send outbound calls to.
          example:
            - sip:my-sbc.example.com:5060
            - sip:my-sbc.example.com:5061;transport=tls
          items:
            type: string
        default_caller_id:
          type: string
          description: Default caller ID to use on outbound calls.
    Error:
      type: object
      description: Error response body.
      properties:
        success:
          type: boolean
        error:
          type: string
        message:
          type: string
      required:
        - success
        - error
        - message
    SipAuth:
      type: object
      description: SIP digest auth state.
      properties:
        enabled:
          type: boolean
          description: Whether SIP digest auth is enabled for this SIP Trunk.
        username:
          type: string
          description: SIP digest auth username. Present when enabled.
        realm:
          type: string
          description: SIP digest auth realm. Present when enabled.
      required:
        - enabled
    SipTokenAuth:
      type: object
      description: SIP token auth state.
      properties:
        enabled:
          type: boolean
          description: Whether SIP token auth is enabled for this SIP Trunk.
      required:
        - enabled
    DefaultRoute:
      type: object
      description: >-
        The agent that receives inbound calls whose dialed number has no
        extension on the trunk. Omitted when the trunk has no default route, in
        which case such calls are rejected.
      properties:
        agent:
          $ref: '#/components/schemas/Agent'
      required:
        - agent
    Agent:
      type: object
      description: The PolyAI agent an extension routes calls to.
      properties:
        agent_id:
          type: string
          description: PolyAI Agent / Project ID to route to.
        client_env:
          type: string
          description: One of sandbox, pre-release, live.
          enum:
            - sandbox
            - pre-release
            - live
        variant_id:
          type: string
          description: Agent variant to route to.
      required:
        - agent_id
        - client_env
        - variant_id
  responses:
    Unauthorized:
      description: Missing or invalid credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Caller is not a telephony admin on the account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-Key

````