schema

Create a new collection

Defines and creates a new collection (class).

If AutoSchema is enabled (not recommended for production), Weaviate might attempt to infer schema from data during import. Manual definition via this endpoint provides explicit control.

post/schema

Request

  • Base URL: https://localhost:8080/v1
  • URL: https://localhost:8080/v1/schema
  • Auth: one of:
    • none
    • OAuth 2 (implicit, authorization URL http://to-be-configured-in-the-application-config)

Request body

classstring

Name of the collection (formerly 'class') (required). Multiple words should be concatenated in CamelCase, e.g. ArticleAuthor.

vectorConfigobject

Configure named vectors. Either use this field or vectorizer, vectorIndexType, and vectorIndexConfig fields. Available from v1.24.0.

vectorIndexTypestring

Name of the vector index type to use for the collection (e.g. hnsw or flat).

vectorIndexConfigobject

Vector-index config, that is specific to the type of index selected in vectorIndexType

shardingConfigobject

Manage how the index should be sharded and distributed in the cluster

vectorizerstring

Specify how the vectors for this collection should be determined. The options are either none - this means you have to import a vector with each object yourself - or the name of a module that provides vectorization capabilities, such as text2vec-weaviate. If left empty, it defaults to none.

moduleConfigobject

Configuration specific to modules in a collection context.

descriptionstring

Description of the collection for metadata purposes.

Response

Collection created successfully and its definition returned.

classstring

Name of the collection (formerly 'class') (required). Multiple words should be concatenated in CamelCase, e.g. ArticleAuthor.

vectorConfigobject

Configure named vectors. Either use this field or vectorizer, vectorIndexType, and vectorIndexConfig fields. Available from v1.24.0.

vectorIndexTypestring

Name of the vector index type to use for the collection (e.g. hnsw or flat).

vectorIndexConfigobject

Vector-index config, that is specific to the type of index selected in vectorIndexType

shardingConfigobject

Manage how the index should be sharded and distributed in the cluster

vectorizerstring

Specify how the vectors for this collection should be determined. The options are either none - this means you have to import a vector with each object yourself - or the name of a module that provides vectorization capabilities, such as text2vec-weaviate. If left empty, it defaults to none.

moduleConfigobject

Configuration specific to modules in a collection context.

descriptionstring

Description of the collection for metadata purposes.

Changes

No recorded changes to this operation across all 1 revision of this API.