curl --request POST \
--url https://api.trychroma.com/api/v2/tenants/{tenant}/databases/{database}/collections \
--header 'Content-Type: application/json' \
--header 'x-chroma-token: <api-key>' \
--data '
{
"configuration": null,
"get_or_create": false,
"metadata": {
"key": "value"
},
"name": "my_collection",
"schema": null
}
'{
"configuration_json": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"resize_factor": 123,
"space": "l2",
"sync_threshold": 1
},
"spann": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"merge_threshold": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"space": "l2",
"split_threshold": 1,
"write_nprobe": 1
}
},
"database": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"log_position": 123,
"name": "<string>",
"tenant": "<string>",
"version": 123,
"dimension": 123,
"metadata": {},
"schema": {
"defaults": {
"bool": {
"bool_inverted_index": {
"config": {},
"enabled": true
}
},
"float": {
"float_inverted_index": {
"config": {},
"enabled": true
}
},
"float_list": {
"vector_index": {
"config": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"batch_size": 1,
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"num_threads": 1,
"resize_factor": 123,
"sync_threshold": 1
},
"source_key": "<string>",
"space": "l2",
"spann": {
"ef_construction": 1,
"ef_search": 1,
"initial_lambda": 123,
"max_neighbors": 1,
"merge_threshold": 1,
"nreplica_count": 1,
"num_centers_to_merge_to": 1,
"num_samples_kmeans": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"search_rng_epsilon": 123,
"search_rng_factor": 123,
"split_threshold": 1,
"write_nprobe": 1,
"write_rng_epsilon": 123,
"write_rng_factor": 123
}
},
"enabled": true
}
},
"int": {
"int_inverted_index": {
"config": {},
"enabled": true
}
},
"sparse_vector": {
"sparse_vector_index": {
"config": {
"bm25": true,
"embedding_function": {
"type": "legacy"
},
"source_key": "<string>"
},
"enabled": true
}
},
"string": {
"fts_index": {
"config": {},
"enabled": true
},
"string_inverted_index": {
"config": {},
"enabled": true
}
}
},
"keys": {},
"cmek": {},
"source_attached_function_id": "<string>"
}
}Creates a new collection in a database.
curl --request POST \
--url https://api.trychroma.com/api/v2/tenants/{tenant}/databases/{database}/collections \
--header 'Content-Type: application/json' \
--header 'x-chroma-token: <api-key>' \
--data '
{
"configuration": null,
"get_or_create": false,
"metadata": {
"key": "value"
},
"name": "my_collection",
"schema": null
}
'{
"configuration_json": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"resize_factor": 123,
"space": "l2",
"sync_threshold": 1
},
"spann": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"merge_threshold": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"space": "l2",
"split_threshold": 1,
"write_nprobe": 1
}
},
"database": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"log_position": 123,
"name": "<string>",
"tenant": "<string>",
"version": 123,
"dimension": 123,
"metadata": {},
"schema": {
"defaults": {
"bool": {
"bool_inverted_index": {
"config": {},
"enabled": true
}
},
"float": {
"float_inverted_index": {
"config": {},
"enabled": true
}
},
"float_list": {
"vector_index": {
"config": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"batch_size": 1,
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"num_threads": 1,
"resize_factor": 123,
"sync_threshold": 1
},
"source_key": "<string>",
"space": "l2",
"spann": {
"ef_construction": 1,
"ef_search": 1,
"initial_lambda": 123,
"max_neighbors": 1,
"merge_threshold": 1,
"nreplica_count": 1,
"num_centers_to_merge_to": 1,
"num_samples_kmeans": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"search_rng_epsilon": 123,
"search_rng_factor": 123,
"split_threshold": 1,
"write_nprobe": 1,
"write_rng_epsilon": 123,
"write_rng_factor": 123
}
},
"enabled": true
}
},
"int": {
"int_inverted_index": {
"config": {},
"enabled": true
}
},
"sparse_vector": {
"sparse_vector_index": {
"config": {
"bm25": true,
"embedding_function": {
"type": "legacy"
},
"source_key": "<string>"
},
"enabled": true
}
},
"string": {
"fts_index": {
"config": {},
"enabled": true
},
"string_inverted_index": {
"config": {},
"enabled": true
}
}
},
"keys": {},
"cmek": {},
"source_attached_function_id": "<string>"
}
}Collection creation payload
Collection created successfully
Show child attributes
Show child attributes
Schema representation for collection index configurations
This represents the server-side schema structure used for index management
Show child attributes
Was this page helpful?