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

# Configure a collection

> Configure a collection.



## OpenAPI

````yaml patch /collections/{collectionName}
openapi: 3.1.1
info:
  title: LambdaDB API
  summary: LambdaDB Open API Spec
  version: 1.1.1
servers:
  - url: https://{projectHost}
    description: LambdaDB API endpoints
    variables:
      projectHost:
        description: The project-scoped URL of the API
        default: api.lambdadb.ai/projects/example-project
security: []
tags:
  - name: collections
  - name: collections.docs
paths:
  /collections/{collectionName}:
    patch:
      tags:
        - collections
      description: Configure a collection.
      operationId: updateCollection
      parameters:
        - $ref: '#/components/parameters/CollectionName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                indexConfigs:
                  $ref: '#/components/schemas/IndexConfigs'
              required:
                - indexConfigs
            examples:
              example:
                summary: Example request body for collection configuration
                value:
                  indexConfigs:
                    example-field1:
                      type: text
                      analyzers:
                        - english
                    example-field2:
                      type: vector
                      dimensions: 128
                      similarity: cosine
                    example-field3:
                      type: keyword
      responses:
        '200':
          description: Updated collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  collection:
                    $ref: '#/components/schemas/CollectionResponse'
                required:
                  - collection
              examples:
                normalCollection:
                  summary: Example response for an updated collection
                  value:
                    collection:
                      projectName: example-project-name
                      collectionName: example-collection-name
                      indexConfigs:
                        example-field1:
                          type: text
                          analyzers:
                            - english
                        example-field2:
                          type: vector
                          dimensions: 128
                          similarity: cosine
                        example-field3:
                          type: keyword
                      numDocs: 1000
                      collectionStatus: ACTIVE
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                example:
                  summary: Example response for bad request
                  value:
                    message: Invalid request
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthenticated'
              examples:
                example:
                  summary: Example response for authentication failure
                  value:
                    message: Authentication failed
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
              examples:
                example:
                  summary: Example response for resource not found
                  value:
                    message: Resource not found
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequests'
              examples:
                example:
                  summary: Example response for too many requests
                  value:
                    message: Too many requests
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
              examples:
                example:
                  summary: Example response for internal server error
                  value:
                    message: Internal server error
      security:
        - ProjectApiKey: []
components:
  parameters:
    CollectionName:
      in: path
      name: collectionName
      description: Collection name.
      required: true
      schema:
        type: string
  schemas:
    IndexConfigs:
      title: IndexConfigs
      type: object
      additionalProperties:
        type: object
        oneOf:
          - properties:
              type:
                type: string
                enum:
                  - text
              analyzers:
                type: array
                description: Analyzers.
                items:
                  type: string
                  enum:
                    - standard
                    - korean
                    - japanese
                    - english
                default: standard
            additionalProperties: false
            required:
              - type
          - properties:
              type:
                type: string
                enum:
                  - vector
              managedEmbedding:
                type: boolean
                description: Set to false or omit for unmanaged vector fields.
                enum:
                  - false
              dimensions:
                type: integer
                description: Vector dimensions for unmanaged vector fields.
              similarity:
                type: string
                description: Vector similarity metric for unmanaged vector fields.
                enum:
                  - cosine
                  - euclidean
                  - dot_product
                  - max_inner_product
                default: cosine
            additionalProperties: false
            required:
              - type
              - dimensions
          - properties:
              type:
                type: string
                enum:
                  - vector
              managedEmbedding:
                type: boolean
                description: Managed embedding vector field.
                enum:
                  - true
              embedding:
                $ref: '#/components/schemas/EmbeddingConfig'
            additionalProperties: false
            required:
              - type
              - managedEmbedding
              - embedding
          - properties:
              type:
                type: string
                enum:
                  - keyword
                  - long
                  - double
                  - datetime
                  - boolean
                  - sparseVector
            description: Types that do not need additional parameters.
            additionalProperties: false
            required:
              - type
          - properties:
              type:
                type: string
                enum:
                  - object
              objectIndexConfigs:
                type: object
                additionalProperties: true
            additionalProperties: false
            required:
              - type
              - objectIndexConfigs
    CollectionResponse:
      title: CollectionResponse
      type: object
      properties:
        projectName:
          type: string
          description: Project name.
        collectionName:
          type: string
          description: Collection name.
        indexConfigs:
          $ref: '#/components/schemas/IndexConfigs'
        partitionConfig:
          $ref: '#/components/schemas/PartitionConfig'
        numPartitions:
          type: integer
          description: Total number of partitions including the default partition.
        numDocs:
          type: integer
          description: Total number of documents.
        sourceProjectName:
          type: string
          description: Source project name.
        sourceCollectionName:
          type: string
          description: Source collection name.
        sourceCollectionVersionId:
          type: string
          description: Source collection version.
        collectionStatus:
          $ref: '#/components/schemas/Status'
        createdAt:
          type: integer
          description: Collection creation time in seconds since the Unix epoch.
        updatedAt:
          type: integer
          description: Collection last update time in seconds since the Unix epoch.
        dataUpdatedAt:
          type: integer
          description: Collection data last update time in seconds since the Unix epoch.
      required:
        - projectName
        - collectionName
        - indexConfigs
        - numDocs
        - collectionStatus
        - numPartitions
        - createdAt
        - updatedAt
        - dataUpdatedAt
    BadRequest:
      title: BadRequest
      type: object
      properties:
        message:
          type: string
    Unauthenticated:
      title: Unauthenticated
      type: object
      properties:
        message:
          type: string
    ResourceNotFound:
      title: ResourceNotFound
      type: object
      properties:
        message:
          type: string
    TooManyRequests:
      title: TooManyRequests
      type: object
      properties:
        message:
          type: string
    InternalServerError:
      title: InternalServerError
      type: object
      properties:
        message:
          type: string
    EmbeddingConfig:
      title: EmbeddingConfig
      type: object
      description: Managed embedding configuration for vector fields.
      properties:
        provider:
          type: string
          description: Embedding provider.
          enum:
            - openai
        model:
          type: string
          description: >-
            Embedding model name. See /guides/collections/managed-embeddings for
            the current supported providers and models.
        sourceField:
          type: string
          description: Source text field name used to generate embeddings.
        dimensions:
          type: integer
          description: >-
            Resolved embedding dimensions. Optional in requests and resolved in
            stored collection metadata.
        similarity:
          type: string
          description: >-
            Resolved vector similarity metric. Optional in requests and resolved
            in stored collection metadata.
          enum:
            - cosine
            - euclidean
            - dot_product
            - max_inner_product
          default: cosine
      required:
        - provider
        - model
        - sourceField
    PartitionConfig:
      title: PartitionConfig
      type: object
      properties:
        fieldName:
          type: string
          description: Partition field name.
        dataType:
          type: string
          description: Partition field data type.
          enum:
            - keyword
        numPartitions:
          type: integer
          description: The number of partitions.
          minimum: 2
          maximum: 1024
    Status:
      title: Status
      type: string
      description: Status
      enum:
        - CREATING
        - ACTIVE
        - DELETING
  securitySchemes:
    ProjectApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Project API Key.
      x-speakeasy-example: <YOUR_PROJECT_API_KEY>

````