> ## 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.

# Sync or manually add DIDs

> Imports DIDs into Vocobase for inbound routing. For Plivo, Vocobase pulls the inventory from Plivo REST using the selected connection's credentials. For Vobiz and MCube, pass an explicit `numbers` array because Vocobase does not pull DID inventory from those providers. MCube numbers must all be valid E.164 DIDs, and `connection_id` is required so the account-routing boundary is explicit. The operation is idempotent: existing DIDs and repeated request values are skipped. For other providers, `connection_id` is required whenever more than one active connection exists.



## OpenAPI

````yaml /openapi.json post /phone-numbers/sync
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:
  /phone-numbers/sync:
    post:
      tags:
        - Phone Numbers
      summary: Sync or manually add DIDs
      description: >-
        Imports DIDs into Vocobase for inbound routing. For Plivo, Vocobase
        pulls the inventory from Plivo REST using the selected connection's
        credentials. For Vobiz and MCube, pass an explicit `numbers` array
        because Vocobase does not pull DID inventory from those providers. MCube
        numbers must all be valid E.164 DIDs, and `connection_id` is required so
        the account-routing boundary is explicit. The operation is idempotent:
        existing DIDs and repeated request values are skipped. For other
        providers, `connection_id` is required whenever more than one active
        connection exists.
      operationId: syncPhoneNumbers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  required:
                    - provider
                  properties:
                    provider:
                      type: string
                      const: PLIVO
                    connection_id:
                      type: string
                      format: uuid
                      description: Optional unless multiple active Plivo connections exist.
                - type: object
                  required:
                    - provider
                    - numbers
                  properties:
                    provider:
                      type: string
                      const: VOBIZ
                    connection_id:
                      type: string
                      format: uuid
                      description: Optional unless multiple active Vobiz connections exist.
                    numbers:
                      type: array
                      items:
                        type: string
                        pattern: ^\+[1-9]\d{6,14}$
                      minItems: 1
                      description: >-
                        Vobiz DIDs in E.164 format. This field is named
                        `numbers`.
                - type: object
                  required:
                    - provider
                    - connection_id
                    - numbers
                  properties:
                    provider:
                      type: string
                      const: MCUBE
                    connection_id:
                      type: string
                      format: uuid
                      description: Active MCube telephony connection that owns these DIDs.
                    numbers:
                      type: array
                      items:
                        type: string
                        pattern: ^\+[1-9]\d{6,14}$
                      minItems: 1
                      description: >-
                        MCube inbound DIDs in E.164 format. The connection's
                        exeNumber is separate and must not be repeated here
                        unless it is also a dialed DID.
            examples:
              plivo:
                summary: Plivo inventory pull
                value:
                  provider: PLIVO
                  connection_id: 9b7f1c44-c87f-4f0c-9124-3c802a9c1a20
              vobiz:
                summary: Vobiz explicit DID list
                value:
                  provider: VOBIZ
                  connection_id: 9b7f1c44-c87f-4f0c-9124-3c802a9c1a20
                  numbers:
                    - '+918065480085'
                    - '+919109518550'
              mcube:
                summary: MCube manual DID list
                value:
                  provider: MCUBE
                  connection_id: 9b7f1c44-c87f-4f0c-9124-3c802a9c1a20
                  numbers:
                    - '+918071844607'
                    - '+918071844608'
      responses:
        '200':
          description: >-
            Sync completed. Manual Vobiz and MCube imports report added and
            skipped values; repeated or existing DIDs are skipped.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    oneOf:
                      - type: object
                        properties:
                          imported:
                            type: integer
                          skipped:
                            type: integer
                          total_remote:
                            type: integer
                      - type: object
                        properties:
                          added:
                            type: integer
                          skipped:
                            type: integer
                          updated:
                            type: integer
                          removed:
                            type: integer
              examples:
                plivo:
                  value:
                    success: true
                    data:
                      imported: 2
                      skipped: 1
                      total_remote: 3
                vobiz:
                  value:
                    success: true
                    data:
                      added: 2
                      skipped: 0
                      updated: 0
                      removed: 0
                mcube:
                  value:
                    success: true
                    data:
                      added: 1
                      skipped: 1
                      updated: 0
                      removed: 0
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  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
  schemas:
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in format: `rg_live_xxxx`. Pass as a Bearer token in the
        Authorization header.

````