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

# Update collection

> Updates an existing collection's name or metadata.



## OpenAPI

````yaml https://api.trychroma.com/openapi.json put /api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}
openapi: 3.1.0
info:
  title: chroma-frontend
  description: ''
  license:
    name: ''
  version: 1.0.0
servers: []
security: []
paths:
  /api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}:
    put:
      tags:
        - Collection
      summary: Update collection
      description: Updates an existing collection's name or metadata.
      operationId: update_collection
      parameters:
        - name: tenant
          in: path
          description: Tenant UUID
          required: true
          schema:
            type: string
          example: 1e30d217-3d78-4f8c-b244-79381dc6a254
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
        - name: collection_id
          in: path
          description: Collection UUID
          required: true
          schema:
            type: string
          example: 1e30d217-3d78-4f8c-b244-79381dc6a254
      requestBody:
        description: Collection update payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCollectionPayload'
            example:
              new_configuration: null
              new_metadata:
                key: value
              new_name: updated_collection_name
        required: true
      responses:
        '200':
          description: Collection updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCollectionResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Collection not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - label: Update collection
          lang: typescript
          source: >-
            await collection.modify({ name: 'new_name', metadata: { key: 'value'
            } });
        - label: Update collection
          lang: python
          source: 'collection.modify(name=''new_name'', metadata={''key'': ''value''})'
        - label: Update collection
          lang: rust
          source: |-
            use chroma_types::Metadata;
            let mut metadata = Metadata::new();
            metadata.insert("key".to_string(), "value".into());
            collection.modify(Some("new_name"), Some(metadata)).await?;
components:
  schemas:
    UpdateCollectionPayload:
      type: object
      properties:
        new_configuration:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/UpdateCollectionConfiguration'
        new_metadata:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/HashMap'
        new_name:
          type:
            - string
            - 'null'
    UpdateCollectionResponse:
      type: object
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
    UpdateCollectionConfiguration:
      type: object
      properties:
        embedding_function:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/EmbeddingFunctionConfiguration'
        hnsw:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/UpdateHnswConfiguration'
        spann:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/UpdateSpannConfiguration'
    HashMap:
      type: object
      additionalProperties:
        oneOf:
          - type: boolean
          - type: integer
            format: int64
          - type: number
            format: double
          - type: string
          - $ref: '#/components/schemas/SparseVector'
          - type: array
            items:
              type: boolean
          - type: array
            items:
              type: integer
              format: int64
          - type: array
            items:
              type: number
              format: double
          - type: array
            items:
              type: string
      propertyNames:
        type: string
    EmbeddingFunctionConfiguration:
      oneOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - legacy
        - allOf:
            - $ref: '#/components/schemas/EmbeddingFunctionNewConfiguration'
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - known
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - unknown
    UpdateHnswConfiguration:
      type: object
      properties:
        batch_size:
          type:
            - integer
            - 'null'
          minimum: 0
        ef_search:
          type:
            - integer
            - 'null'
          minimum: 0
        max_neighbors:
          type:
            - integer
            - 'null'
          minimum: 0
        num_threads:
          type:
            - integer
            - 'null'
          minimum: 0
        resize_factor:
          type:
            - number
            - 'null'
          format: double
        sync_threshold:
          type:
            - integer
            - 'null'
          minimum: 0
      additionalProperties: false
    UpdateSpannConfiguration:
      type: object
      properties:
        ef_search:
          type:
            - integer
            - 'null'
          minimum: 0
        search_nprobe:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
      additionalProperties: false
    SparseVector:
      type: object
      description: >-
        Represents a sparse vector using parallel arrays for indices and values.


        On deserialization: accepts both old format `{"indices": [...],
        "values": [...]}`

        and new format `{"#type": "sparse_vector", "indices": [...], "values":
        [...]}`.


        On serialization: always includes `#type` field with value
        `"sparse_vector"`.
      required:
        - indices
        - values
      properties:
        indices:
          type: array
          items:
            type: integer
            format: int32
            minimum: 0
          description: Dimension indices
        tokens:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Tokens corresponding to each index
        values:
          type: array
          items:
            type: number
            format: float
          description: Values corresponding to each index
    EmbeddingFunctionNewConfiguration:
      type: object
      required:
        - name
        - config
      properties:
        config: {}
        name:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-chroma-token

````