> ## 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 agent assignment on SIP trunk

> Maps an org agent to this trunk. Use `number` when inbound auth is digest (unique on this trunk). Use `alternate_number` when inbound auth is ACL (globally unique alternate dial target). Same rules as the dashboard integrations UI.



## OpenAPI

````yaml post /v1/sip-trunks/{id}/assignments
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/{id}/assignments:
    post:
      tags:
        - sip-trunks
      summary: Create agent assignment on SIP trunk
      description: >-
        Maps an org agent to this trunk. Use `number` when inbound auth is
        digest (unique on this trunk). Use `alternate_number` when inbound auth
        is ACL (globally unique alternate dial target). Same rules as the
        dashboard integrations UI.
      operationId: createSipTrunkAgentAssignment
      parameters:
        - name: id
          in: path
          required: true
          description: SIP trunk id
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SipTrunkAgentAssignmentCreateInput'
      responses:
        '201':
          description: Created assignment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipTrunkAgentAssignment'
        '400':
          description: Validation error or agent not in organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
        '404':
          description: SIP trunk or agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Number or alternate number already in use
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SipTrunkAgentAssignmentCreateInput:
      type: object
      description: >-
        Create assignment. Use `number` for digest-auth trunks (unique on this
        trunk). Use `alternate_number` for ACL trunks (globally unique). Both
        may be set if you use both routing styles.
      required:
        - agent_id
      properties:
        agent_id:
          type: string
          format: uuid
        number:
          type: string
          description: >-
            Target number to dial for digest inbound auth; unique among
            assignments on this SIP trunk.
        alternate_number:
          type: string
          description: >-
            Globally unique alternate number to dial when the trunk uses ACL
            inbound auth.
    SipTrunkAgentAssignment:
      type: object
      description: >-
        Binds an org agent to a SIP trunk. With digest inbound auth, routing
        uses `number`. With ACL inbound auth, routing uses `alternate_number`
        (globally unique).
      properties:
        id:
          type: string
          format: uuid
        agent_id:
          type: string
          format: uuid
        sip_trunk_id:
          type: string
          format: uuid
        number:
          type: string
          description: >-
            Number to dial for this agent when the trunk uses digest inbound
            auth; must be unique among assignments on this trunk.
        alternate_number:
          type: string
          description: >-
            Globally unique alternate dial string when the trunk uses ACL
            inbound auth; used instead of per-trunk `number` routing in that
            mode.
        created_at:
          type: string
          format: date-time
    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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Send your organization API key as `Authorization: Bearer <key>`.'

````