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

# Make a VoiceLink DID inbound-ready

> Runs the secure, idempotent inbound setup workflow for one purchased VoiceLink DID. The deployment must enable the inbound runtime and configure a public WSS URL plus signing secret. Vocobase imports and enables the local number, optionally maps a currently-unmapped DID to an explicit client, creates or updates the client bot with a signed connection-scoped endpoint, points inbound routing to that bot, preserves every existing outbound routing field, and assigns the local number to the requested agent. The request cannot override the WebSocket URL.



## OpenAPI

````yaml /openapi.json post /voicelink/inbound-ready
openapi: 3.1.0
info:
  title: Vocobase Partner API
  version: '2.0'
  description: >-
    API for managing voice AI agents, documents, and calls on the Vocobase
    platform.
servers:
  - url: https://api.vocobase.com/api/v2
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Config
    description: >-
      Read and update partner configuration, webhook settings, and telephony
      credentials.
  - name: Agents
    description: Create, read, update, and delete voice AI agents.
  - name: Voices
    description: >-
      List voice tiers, available voices, and stream preview audio for agent
      configuration.
  - name: Documents
    description: Upload, manage, and delete knowledge base documents.
  - name: Agent Documents
    description: Link and unlink documents to agents for knowledge base integration.
  - name: Calls
    description: Initiate outbound calls and view call history.
  - name: Phone Numbers
    description: >-
      Import DIDs, assign agents for inbound routing, and re-sync carrier
      Application bindings.
  - name: Inbound Routing Policies
    description: >-
      Define pre-answer routing decisions for inbound calls before AI sessions
      are created.
  - name: Telephony Connections
    description: Create, list, rename, and disconnect named V2 telephony connections.
  - name: VoiceLink Management
    description: Manage VoiceLink reseller clients, DID mapping, and readiness sync.
  - name: Projects
    description: Organize agents into projects. Every agent belongs to exactly one project.
  - name: Dictionaries
    description: Speech-recognition dictionary CRUD and agent attachment.
  - name: Sessions
    description: Browser-initiated WebRTC voice sessions for in-app voice agents.
paths:
  /voicelink/inbound-ready:
    post:
      tags:
        - VoiceLink Management
      summary: Make a VoiceLink DID inbound-ready
      description: >-
        Runs the secure, idempotent inbound setup workflow for one purchased
        VoiceLink DID. The deployment must enable the inbound runtime and
        configure a public WSS URL plus signing secret. Vocobase imports and
        enables the local number, optionally maps a currently-unmapped DID to an
        explicit client, creates or updates the client bot with a signed
        connection-scoped endpoint, points inbound routing to that bot,
        preserves every existing outbound routing field, and assigns the local
        number to the requested agent. The request cannot override the WebSocket
        URL.
      operationId: makeVoiceLinkDidInboundReady
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceLinkInboundReadyRequest'
            example:
              connection_id: 9b7f1c44-c87f-4f0c-9124-3c802a9c1a20
              did_id: 812
              client_id: 415
              agent_id: f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55
              bot_name: Vocobase inbound +918011223344
      responses:
        '200':
          description: >-
            Inbound-ready workflow result. `data.ready` follows inbound
            readiness for this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceLinkCallReadyResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    VoiceLinkInboundReadyRequest:
      type: object
      description: >-
        Request for secure inbound setup. Provide either `did_id` or
        `did_number`. Unlike outbound call-ready, this request cannot override
        the deployment-controlled signed WebSocket URL.
      anyOf:
        - required:
            - did_id
        - required:
            - did_number
      properties:
        connection_id:
          type: string
          format: uuid
          description: Optional unless multiple active VoiceLink connections exist.
        did_id:
          type: integer
          minimum: 1
          description: VoiceLink DID ID from `/voicelink/dids/purchased`.
        did_number:
          type: string
          description: Purchased DID number. Used when `did_id` is not available.
        client_id:
          type: integer
          minimum: 1
          description: >-
            Maps the DID only when it is currently unmapped. Existing mappings
            are never replaced.
        agent_id:
          type: string
          format: uuid
          description: >-
            Vocobase agent ID assigned to inbound calls on this DID. Ownership
            is enforced.
        bot_name:
          type: string
          description: Optional bot name used when a bot must be created.
    VoiceLinkCallReadyResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        data:
          $ref: '#/components/schemas/VoiceLinkCallReadyResult'
      required:
        - success
        - data
    VoiceLinkCallReadyResult:
      type: object
      properties:
        phone_number:
          type:
            - string
            - 'null'
          description: >-
            Resolved normalized phone number, or null when the DID could not be
            resolved.
        key:
          type:
            - string
            - 'null'
          description: Digit-only matching key used by readiness comparison.
        ready:
          type: boolean
          description: '`true` only when recomputed readiness is `READY` after all steps.'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/VoiceLinkCallReadyStep'
        readiness_before:
          oneOf:
            - $ref: '#/components/schemas/VoiceLinkReadinessItem'
            - type: 'null'
          description: >-
            Readiness snapshot captured before provisioning ran; null when the
            DID could not be resolved.
        readiness:
          oneOf:
            - $ref: '#/components/schemas/VoiceLinkReadinessItem'
            - type: 'null'
          description: >-
            Recomputed readiness after provisioning and optional agent
            assignment.
      required:
        - phone_number
        - key
        - ready
        - steps
        - readiness_before
        - readiness
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - success
        - error
    VoiceLinkCallReadyStep:
      type: object
      properties:
        step:
          $ref: '#/components/schemas/VoiceLinkCallReadyStepName'
        status:
          $ref: '#/components/schemas/VoiceLinkCallReadyStepStatus'
        detail:
          type: string
        data:
          type: object
          additionalProperties: true
      required:
        - step
        - status
        - detail
    VoiceLinkReadinessItem:
      type: object
      properties:
        key:
          type: string
          description: >-
            Stable digit-only join key (no `+`) linking the remote DID, routing,
            and local PhoneNumber rows for this number.
        phone_number:
          type: string
        state:
          $ref: '#/components/schemas/VoiceLinkReadinessState'
        issues:
          type: array
          items:
            $ref: '#/components/schemas/VoiceLinkReadinessState'
        remote_did:
          oneOf:
            - $ref: '#/components/schemas/VoiceLinkNormalizedDid'
            - type: 'null'
        local_phone_number:
          oneOf:
            - $ref: '#/components/schemas/VoiceLinkLocalPhoneNumber'
            - type: 'null'
        routing:
          oneOf:
            - $ref: '#/components/schemas/VoiceLinkNormalizedRouting'
            - type: 'null'
        bot:
          oneOf:
            - $ref: '#/components/schemas/VoiceLinkNormalizedRow'
            - type: 'null'
        actions:
          type: array
          items:
            type: string
          description: Human-readable remediation strings (one per issue).
        action_items:
          type: array
          items:
            $ref: '#/components/schemas/VoiceLinkActionItem'
          description: >-
            Same remediation steps as `{ code, label }` objects for programmatic
            use.
        inbound:
          type: object
          description: Direction-specific readiness for DID-to-agent inbound calling.
          properties:
            state:
              $ref: '#/components/schemas/VoiceLinkInboundReadinessState'
            ready:
              type: boolean
            issues:
              type: array
              items:
                $ref: '#/components/schemas/VoiceLinkInboundReadinessState'
            actions:
              type: array
              items:
                type: string
            bot:
              oneOf:
                - $ref: '#/components/schemas/VoiceLinkNormalizedRow'
                - type: 'null'
            runtime:
              type: object
              properties:
                enabled:
                  type: boolean
                configured:
                  type: boolean
                issues:
                  type: array
                  items:
                    type: string
                    enum:
                      - RUNTIME_DISABLED
                      - SIGNING_SECRET_MISSING
                      - INBOUND_WSS_URL_MISSING
              required:
                - enabled
                - configured
                - issues
          required:
            - state
            - ready
            - issues
            - actions
            - bot
            - runtime
      required:
        - key
        - phone_number
        - state
        - issues
        - remote_did
        - local_phone_number
        - routing
        - bot
        - actions
        - action_items
        - inbound
    VoiceLinkCallReadyStepName:
      type: string
      enum:
        - resolve_did
        - verify_inbound_runtime
        - import_did
        - enable_inbound
        - assign_agent
        - client_mapping
        - ensure_bot
        - ensure_routing
    VoiceLinkCallReadyStepStatus:
      type: string
      enum:
        - done
        - already
        - skipped
        - failed
    VoiceLinkReadinessState:
      type: string
      enum:
        - READY
        - NOT_IMPORTED
        - NO_CLIENT_MAPPING
        - NO_BOT
        - ROUTING_MISSING
        - ROUTING_CHANGED
        - NO_VOCOBASE_AGENT
        - REMOTE_DID_EXPIRED
        - REMOTE_DID_RELEASED
        - REMOTE_DID_DELETED
    VoiceLinkNormalizedDid:
      allOf:
        - $ref: '#/components/schemas/VoiceLinkNormalizedRow'
        - type: object
          properties:
            did_id:
              type: integer
            did_number:
              type: string
            phone_number:
              type:
                - string
                - 'null'
              description: Normalized E.164 DID when Vocobase can infer it.
            is_expired:
              type: boolean
            is_released:
              type: boolean
          required:
            - phone_number
            - is_expired
            - is_released
    VoiceLinkLocalPhoneNumber:
      type: object
      properties:
        id:
          type: string
          format: uuid
        phone_number:
          type: string
        friendly_name:
          type:
            - string
            - 'null'
        status:
          type: string
        is_default:
          type: boolean
        inbound_enabled:
          type: boolean
        agent:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - phone_number
        - status
        - is_default
        - inbound_enabled
        - agent
    VoiceLinkNormalizedRouting:
      allOf:
        - $ref: '#/components/schemas/VoiceLinkNormalizedRow'
        - type: object
          properties:
            did_id:
              type: integer
            did_number:
              type: string
            phone_number:
              type:
                - string
                - 'null'
            for_inbound_call:
              type: integer
              description: 'VoiceLink mode: 1 mobile, 2 SIP, 3 WebSocket bot.'
            for_outbound_call:
              type: integer
              description: 'VoiceLink mode: 2 SIP, 3 WebSocket bot, 4 only-answer.'
            inbound_websocket_bot_id:
              type: integer
            inbound_sip_trunk_id:
              type: integer
            outbound_websocket_bot_id:
              type: integer
            outbound_sip_trunk_id:
              type: integer
          required:
            - phone_number
    VoiceLinkNormalizedRow:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        status:
          oneOf:
            - type: string
            - type: integer
        client_id:
          type: integer
        websocket_url:
          type: string
          format: uri
          description: >-
            Present for ordinary bot rows. Omitted when the URL contains the
            signed inbound token.
        websocket_configured:
          type: boolean
          description: >-
            True when a signed inbound bot URL is configured but redacted from
            the response.
        raw:
          type: object
          additionalProperties: true
          description: >-
            Original VoiceLink row. Omitted for bot rows containing a signed
            inbound URL.
    VoiceLinkActionItem:
      type: object
      description: >-
        A machine code plus human label for one remediation step. `code` is the
        readiness issue the step resolves.
      properties:
        code:
          $ref: '#/components/schemas/VoiceLinkReadinessState'
        label:
          type: string
      required:
        - code
        - label
    VoiceLinkInboundReadinessState:
      type: string
      enum:
        - READY
        - NOT_IMPORTED
        - NO_CLIENT_MAPPING
        - NO_BOT
        - ROUTING_MISSING
        - ROUTING_CHANGED
        - NO_VOCOBASE_AGENT
        - REMOTE_DID_EXPIRED
        - REMOTE_DID_RELEASED
        - REMOTE_DID_DELETED
        - INBOUND_RUNTIME_DISABLED
        - INBOUND_ORIGIN_AUTH_NOT_CONFIGURED
        - INBOUND_NOT_ENABLED_LOCALLY
        - INBOUND_BOT_URL_CHANGED
  responses:
    ValidationError:
      description: Validation error in request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: VALIDATION_ERROR
              message: agent_name is required and must be max 50 characters
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: UNAUTHORIZED
              message: Invalid or missing API key
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: NOT_FOUND
              message: Resource not found
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in format: `rg_live_xxxx`. Pass as a Bearer token in the
        Authorization header.

````