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

# Replace the agent's attached dictionaries

> Idempotent set-replace: overwrites the agent's entire dictionary set with `dictionary_ids`. Duplicate ids are deduped silently. Every id must exist and belong to the calling partner, else the whole request fails with `VALIDATION_ERROR`. The combined `char_count` across the resulting set must be at most 10,000 characters; otherwise the request fails with `DICTIONARY_CHAR_LIMIT_EXCEEDED`. Pass `[]` to detach all dictionaries. The swap is wrapped in a transaction -- the attached set is never briefly partial.



## OpenAPI

````yaml /openapi.json put /agent/{id}/dictionaries
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:
  /agent/{id}/dictionaries:
    put:
      tags:
        - Agents
        - Dictionaries
      summary: Replace the agent's attached dictionaries
      description: >-
        Idempotent set-replace: overwrites the agent's entire dictionary set
        with `dictionary_ids`. Duplicate ids are deduped silently. Every id must
        exist and belong to the calling partner, else the whole request fails
        with `VALIDATION_ERROR`. The combined `char_count` across the resulting
        set must be at most 10,000 characters; otherwise the request fails with
        `DICTIONARY_CHAR_LIMIT_EXCEEDED`. Pass `[]` to detach all dictionaries.
        The swap is wrapped in a transaction -- the attached set is never
        briefly partial.
      operationId: setAgentDictionaries
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Agent ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - dictionary_ids
              properties:
                dictionary_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: >-
                    Full replacement set of dictionary IDs. Pass [] to detach
                    all.
            example:
              dictionary_ids:
                - d1234567-abcd-1234-abcd-123456789012
      responses:
        '200':
          description: Agent's attached dictionaries after the swap.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    type: object
                    properties:
                      dictionaries:
                        type: array
                        items:
                          $ref: '#/components/schemas/AttachedDictionarySummary'
              example:
                success: true
                data:
                  dictionaries:
                    - id: d1234567-abcd-1234-abcd-123456789012
                      name: Vocobase Product Catalog
                      term_count: 5
                      char_count: 52
                      attached_agent_count: 1
                      created_at: '2026-04-24T10:30:00.000Z'
                      updated_at: '2026-04-24T10:30:00.000Z'
        '400':
          description: Validation error or character limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validation:
                  summary: Unknown or unowned dictionary id
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: >-
                        One or more dictionary_ids do not exist or are not owned
                        by you
                charLimit:
                  summary: Combined set exceeds 10,000 chars
                  value:
                    success: false
                    error:
                      code: DICTIONARY_CHAR_LIMIT_EXCEEDED
                      message: >-
                        Attaching these dictionaries would exceed the
                        10,000-character limit for this agent.
                      details:
                        current_chars: 11240
                        limit_chars: 10000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    AttachedDictionarySummary:
      type: object
      description: >-
        Compact dictionary view used when listing an agent's attached
        dictionaries. Omits `description` and `terms`.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        term_count:
          type: integer
        char_count:
          type: integer
        attached_agent_count:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    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
  responses:
    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.

````