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

# Create Outbound Trunk

> ⚠️ **DEPRECATED ENDPOINT** - This endpoint is no longer supported.

**Use Instead:** `POST /agents/{agent_id}/phone-numbers`

**Why Deprecated:**
- This endpoint used an incorrect SIP architecture
- It doesn't properly integrate with LiveKit dispatch rules
- Phone numbers should be registered at agent level, not tenant level

**Migration Guide:**
1. Use `POST /agents/{agent_id}/phone-numbers` to register phone numbers
2. See `CORRECT_PHONE_NUMBER_SETUP.md` for complete setup instructions
3. See `MULTI_AGENT_ARCHITECTURE_PLAN.md` for migration details

**Correct Endpoint:**
```
POST /agents/{agent_id}/phone-numbers
{
    "phone_number": "+15551234567",
    "provider": "twilio",
    "enable_outbound": true,
    "outbound_address": "sip.twilio.com"
}
```



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json post /sip/tenants/{tenant_id}/sip-trunks/outbound
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /sip/tenants/{tenant_id}/sip-trunks/outbound:
    post:
      tags:
        - sip
      summary: Create Outbound Trunk
      description: |-
        ⚠️ **DEPRECATED ENDPOINT** - This endpoint is no longer supported.

        **Use Instead:** `POST /agents/{agent_id}/phone-numbers`

        **Why Deprecated:**
        - This endpoint used an incorrect SIP architecture
        - It doesn't properly integrate with LiveKit dispatch rules
        - Phone numbers should be registered at agent level, not tenant level

        **Migration Guide:**
        1. Use `POST /agents/{agent_id}/phone-numbers` to register phone numbers
        2. See `CORRECT_PHONE_NUMBER_SETUP.md` for complete setup instructions
        3. See `MULTI_AGENT_ARCHITECTURE_PLAN.md` for migration details

        **Correct Endpoint:**
        ```
        POST /agents/{agent_id}/phone-numbers
        {
            "phone_number": "+15551234567",
            "provider": "twilio",
            "enable_outbound": true,
            "outbound_address": "sip.twilio.com"
        }
        ```
      operationId: create_outbound_trunk_sip_tenants__tenant_id__sip_trunks_outbound_post
      parameters:
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Tenant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SIPTrunkCreate'
      responses:
        '410':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SIPTrunkCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        trunk_type:
          type: string
          pattern: ^(inbound|outbound)$
          title: Trunk Type
        phone_numbers:
          items:
            type: string
          type: array
          title: Phone Numbers
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        sip_uri:
          type: string
          minLength: 1
          title: Sip Uri
        auth_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Auth Username
        auth_password:
          anyOf:
            - type: string
            - type: 'null'
          title: Auth Password
        provider_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Provider Config
      type: object
      required:
        - name
        - trunk_type
        - sip_uri
      title: SIPTrunkCreate
      description: SIP trunk creation model.
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````