Document Collections

Create Document Collection

POST
Create a collection of related documents with a shared metadata schema that you can search across.

Request

This endpoint expects an object.
collectionName
stringRequired
A unique name for the document collection.
embeddingsModel
stringOptional
The embeddings model to use for the document collection.
distanceMetric
enumOptional
The distance metric to use for the document collection.
Allowed values: EUCLIDEANCOSINEDOTPRODUCT
customMetadataSchema
objectOptional
Any custom metadata fields for this collection.

Response

This endpoint returns an object
documentCollectionId
UUID
POST
1curl -X POST https://api.credal.ai/api/v0/documentCollections/createDocumentCollection \
2 -H "Authorization: Bearer <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "collectionName": "Customer Meeting Transcripts",
6 "embeddingsModel": "text-embedding-ada-002",
7 "distanceMetric": "EUCLIDEAN",
8 "customMetadataSchema": {
9 "fields": [
10 {
11 "name": "customerName",
12 "type": "STRING"
13 },
14 {
15 "name": "meetingDate",
16 "type": "DATETIME"
17 }
18 ]
19 }
20}'
200
Successful
1{
2 "documentCollectionId": "82e4b12a-6990-45d4-8ebd-85c00e030c24"
3}