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

# Create or update a collection

> Create a new data collection or update an existing one.



## OpenAPI

````yaml /api-reference/5.9/fusion-api-swagger.json put /collections/{collection}
openapi: 3.0.1
info:
  title: Fusion Admin APIs
  description: >-
    These APIs provide general administrative functions for your Fusion
    instance. Use these APIs to manage Fusion objects, App Studio objects,
    connections to Solr clusters, license files, job schedules, and more. You
    can also use them to create a history of service events.
  termsOfService: https://lucidworks.com/legal/developer-license-agreement/
  contact:
    name: Lucidworks
    url: www.lucidworks.com
    email: support@lucidworks.com
  license:
    name: License of API
    url: https://lucidworks.com/legal/developer-license-agreement/
  version: '5.9'
servers:
  - url: https://{FUSION HOST}/api
    description: Fusion
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
  - url: https://{FUSION HOST}/api/apps/{APP_NAME}
    description: Fusion app
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
      APP_NAME:
        default: APP_NAME
        description: The name of your Fusion application.
security: []
tags:
  - name: Apps
    description: >-
      The Apps API manages your Fusion apps. To export or import an app, see the
      Objects API. You can also import an app using the Fusion UI.
  - name: Blobs
    description: >-
      The Blob Store REST API allows storing binary objects in Solr. You can use
      it to store entity extraction models, lookup lists or exclusion lists for
      use in index pipelines. This may include the entity extraction models and
      lookup lists included with Fusion in the `{fusion_path}/data/nlp`
      directory, or files that you have created on your own.
  - name: Collections
    description: >-
      The Collections API manages Fusion collections. It provides endpoints for
      creating, updating, and deleting collection, as well as endpoints for
      getting a collection's status and usage statistics.


      Fusion maintains internal system collections for logs, blobs, and metrics
      data which operate in conjunction with collections created by users. The
      Collections API is used to manage all Fusion collections.
  - name: Configurations
    description: >-
      The Configurations API allows setting global properties for Fusion.


      Some settings are not set by any configuration file but are reported as
      settings from the operating system. Those settings cannot be changed with
      this API.
  - name: CRUD events
    description: Check the status of the CRUD Events service.
  - name: Data models
    description: >-
      These APIs manage data models.


      Data models simplify the process of getting started with Fusion by
      providing pre-configured objects to reduce the effort spent on basic
      starting tasks. This helps keep documents consistent between datasources
      and intuitive to the object's type.
  - name: Features
    description: >-
      The Features API lets you observe the status of features across
      collections.  To manipulate features for a specific collection, use the
      Collections API.
  - name: Groups
    description: >-
      These endpoints show you how your Fusion objects are grouped.  For
      example, you can use this API to see the signals-related jobs and
      collections that are part of a primary collection's group.
  - name: History
    description: >-
      The History API provides information about the services that are running.
      The list of these services is provided by the Introspect API.
  - name: Introspect
    description: >-
      The Fusion Introspect endpoint lists basic information about endpoints and
      parameters for all Fusion endpoints.
  - name: Jobs
    description: >-
      The Jobs API allows you to define schedules for objects that perform work.
      You can schedule datasources, tasks, and Spark jobs.
  - name: License
    description: The License API provides license management features.
  - name: Links
    description: >-
      The Links API manages the links that represent the relationships between
      Fusion objects. You can see these links in the Object Explorer in the
      Fusion UI. You can also export and import links using the Objects API.


      Links are structured as a tuple of (`subject`, `object`, `linkType`). An
      example would be (`foo`, `bar`, `dependsOn`), which would read as "foo
      dependsOn bar".
  - name: Nodes
    description: >-
      The Nodes API lets you check the status of each node in the search
      cluster.
  - name: Objects
    description: >-
      The Objects API lets you import and export objects between Fusion
      instances. Fusion objects include all your searchable data, plus
      pipelines, aggregations, and other configurations on which your
      collections depend.
  - name: Registration
    description: Check the status of the Registration service.
  - name: Scheduler
    description: >-
      Use the Scheduler API to define a schedule for system activities and
      manage the jobs that result from the schedule.  All of the Fusion services
      are available for scheduling, as are any Solr activities and any other
      HTTP-based URI.




      >This API is deprecated in favor of the Jobs API.
  - name: Search cluster
    description: >-
      The Search Cluster API lets you connect Fusion with existing Solr
      instances in a Zookeeper-managed cluster.
  - name: Search logs
    description: The Search Logs API lets you manage a `searchLogs` collection.
  - name: Solr
    description: >-
      The Solr API is used to manage collection-level configurations.


      Since this API proxies requests to Solr, each available method corresponds
      to the method in Solr. So, a `GET` request to Solr would use the `GET`
      method of this endpoint; a `POST` would use the `POST` method, and so on.


      Depending on the request, the response may consist of records that match a
      query or output from a Schema API request.
  - name: Solr Configuration
    description: >-
      The Solr Configuration REST API lets you access and manage Solr
      configuration files stored in ZooKeeper.
  - name: Solr admin
    description: >-
      The Solr Admin API lets you send commands to Solr through Fusion's proxy
      service. This allows you to protect your Solr instances from outside
      connections, and apply roles and user permissions from Fusion when running
      Solr commands. Requests sent to this API are subject to access
      restrictions above the collection level.


      Note that because one `searchCluster` may host several collections, it is
      not recommended to use this with a collection-level command (such as a
      query, or document update).
  - name: Swagger
    description: These endpoints give you details about Fusion's REST API schemas.
  - name: System
    description: The System REST API allows you to monitor the system performance.
  - name: Tasks
    description: >-
      These endpoints let you manage tasks, a flexible job type that can be used
      to clean up old logs or run any REST call.
  - name: Update
    description: Consult Lucidworks before using these endpoints.
  - name: Webapps
    description: Deprecated.
  - name: ZooKeeper
    description: >-
      The ZooKeeper Import/Export API provides methods to upload or download
      information from Fusion's ZooKeeper service. This service provides an
      alternative to the ZooKeeper clients `zkCli.sh` and `zk-shell` which are
      part of the Apache Zookeeper distribution included as part of the Fusion
      distribution.
paths:
  /collections/{collection}:
    put:
      tags:
        - Collections
      summary: Create or update a collection
      description: Create a new data collection or update an existing one.
      operationId: overwriteCollection
      parameters:
        - name: collection
          in: path
          description: The name of a collection.
          required: true
          schema:
            type: string
        - name: If-Match
          in: header
          description: An optional tag to match against the specified blob.
          schema:
            type: string
            default: '-1'
      requestBody:
        description: JSON-formatted configuration values.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Collection'
        required: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Collection'
components:
  schemas:
    Collection:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        createdAt:
          type: string
          format: date-time
        searchClusterId:
          type: string
        autoCommit:
          type: integer
          format: int32
          description: >-
            Solr hard commit inherited from the collection's `solrconfig.xml`
            that is designated as Fusion's default parameter for Solr data
            commits. Number of seconds in which the data is saved, but this
            parameter does not force the search results to refresh immediately.
            With this setting, search performance is not slowed, but the new
            data may not show in search results until the next refresh. Default
            value is 15.
          default: 15
        autoSoftCommit:
          type: boolean
          default: 'false'
          description: >-
            Solr soft commit that does not save the data, but makes the data
            visible to searches almost immediately. If the system crashes, that
            new data is lost because it has not been saved. Default is false,
            and search visibility is managed using the `commitWithin` setting.
        commitWithin:
          type: integer
          format: int32
          description: >-
            Solr's `commitWithin` parameter, configured at the collection level
            with a default of `10000` milliseconds, ensures data is committed
            and available for searching within 10 seconds. The default for
            signals collections is `1000` milliseconds. Fusion uses
            `commitWithin` to avoid relying on specific Solr-side
            configurations. The `com.lucidworks.apollo.solr.commitWithin` global
            property defines the default `commitWithin` for all documents added
            through Fusion. When you create a new collection in Fusion, its
            per-collection `commitWithin` is initialized from this global
            default.
          default: 10000
        features:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Feature'
        compositeIdSpec:
          $ref: '#/components/schemas/CompositeIdSpec'
        solrParams:
          $ref: '#/components/schemas/CreateCollectionCmd'
        modifiedAt:
          type: string
          format: date-time
        type:
          type: string
          enum:
            - DATA
            - LOGS
            - METRICS
            - SIGNALS
            - SIGNALS_AGGREGATION
            - SEARCHLOGS
            - SYNONYMS
            - RECOMMENDATIONS
            - HISTORY
            - BLOBS
            - MESSAGES
            - TAXONOMY
            - CRAWL_DB
            - JOB_HISTORY
            - ARCHIVING
            - AUTOCOMPLETE_DOCUMENTS
            - QUERY_REWRITE
            - USER_PREFS
            - JOB_REPORTS
            - ACL
            - 'NULL'
        relatedCollectionId:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
    Feature:
      type: object
      properties:
        name:
          type: string
        collectionId:
          type: string
        params:
          type: object
          additionalProperties:
            type: object
            properties: {}
        enabled:
          type: boolean
    CompositeIdSpec:
      type: object
      properties:
        routeKey1Field:
          type: string
        routeKey1Bits:
          type: integer
          format: int32
        routeKey2Field:
          type: string
        routeKey2Bits:
          type: integer
          format: int32
    CreateCollectionCmd:
      type: object
      properties:
        name:
          type: string
        numShards:
          type: integer
          format: int32
        replicationFactor:
          type: integer
          format: int32
        collection.configName:
          type: string

````