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

# Update collection

> Update parameters of an existing collection, such as optimizer configuration and HNSW search settings. Vector dimension and distance metric cannot be changed after creation.



## OpenAPI

````yaml patch /collections/{collection_name}
openapi: 3.0.3
info:
  title: Actian VectorAI DB - Collections API
  description: Collection management API for Actian VectorAI DB.
  version: 1.0.0
  contact:
    name: Actian Corporation
    url: https://www.actian.com
servers:
  - url: http://localhost:6573
    description: Local development server (REST API)
  - url: https://api.vectorai.actian.com
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Collections
    description: Collection lifecycle management operations
paths:
  /collections/{collection_name}:
    patch:
      tags:
        - Collections
      summary: Update collection
      description: >-
        Update parameters of an existing collection, such as optimizer
        configuration and HNSW search settings. Vector dimension and distance
        metric cannot be changed after creation.
      operationId: update_collection
      parameters:
        - name: collection_name
          in: path
          required: true
          description: The name of the collection to update.
          schema:
            type: string
            example: my_collection
        - name: timeout
          in: query
          required: false
          description: The maximum time to wait for the operation to complete, in seconds.
          schema:
            type: integer
            example: 30
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                optimizers_config:
                  type: object
                  description: >-
                    Optimizer settings for indexing thresholds and vacuum
                    behavior.
                  properties:
                    indexing_threshold:
                      type: integer
                      description: >-
                        The minimum number of vectors before indexing is
                        triggered.
                      example: 20000
                hnsw_config:
                  type: object
                  description: HNSW index parameters that can be updated after creation.
                  properties:
                    ef_search:
                      type: integer
                      description: The size of the dynamic candidate list during search.
                      example: 100
            examples:
              update_optimizers:
                summary: Update optimizer settings
                value:
                  optimizers_config:
                    indexing_threshold: 50000
      responses:
        '200':
          description: Collection updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  usage:
                    type: object
                    properties:
                      hardware:
                        type: object
                        nullable: true
                        description: >-
                          Hardware resource counters for the operation,
                          including CPU, payload I/O, payload index I/O, and
                          vector I/O metrics.
                  time:
                    type: number
                    format: double
                    example: 0.000588548
                    description: Time spent to process this request, in seconds.
                  status:
                    type: string
                    example: ok
                    description: Operation status.
                  result:
                    type: boolean
                    example: true
                    description: Whether the operation completed successfully.
              examples:
                success:
                  value:
                    usage:
                      hardware: null
                    time: 0.000588548
                    status: ok
                    result: true
      x-codeSamples:
        - lang: Python
          label: Update collection
          source: >
            from actian_vectorai_client import VectorAIClient,
            OptimizersConfigDiff


            with VectorAIClient("localhost:6574") as client:
                # Update optimizer configuration
                client.collections.update(
                    "my_collection",
                    optimizers_config=OptimizersConfigDiff(
                        indexing_threshold=50_000
                    )
                )
                print("✓ Collection updated")
        - lang: JavaScript
          label: Update collection
          source: |
            import { VectorAIClient } from '@actian/vectorai-client';

            const client = new VectorAIClient('localhost:6574');

            await client.collections.update('my_collection', {
                hnswConfig: { m: 32, efConstruct: 200 },
            });
            console.log('Updated HNSW config');

            client.close();
        - lang: cURL
          label: Update collection
          source: |
            curl -X PATCH "http://localhost:6573/collections/my_collection" \
              -H "Content-Type: application/json" \
              -H 'Authorization: Bearer <admin-jwt-or-access-token>' \
              -d '{
                "optimizers_config": {
                  "indexing_threshold": 50000
                }
              }'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Admin JWT or access token for authenticating requests to VectorAI DB.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.