Document Collections

Add Document To Collection

POST
Add a document to a document collection. Credal automatically chunks the document and runs the collection's embeddings model on each chunk. If you want to chunk the document yourself you can use the addDocumentChunksToCollection endpoint.

Request

This endpoint expects an object.
documentId
UUIDRequired
documentCollectionId
UUIDRequired
customMetadata
map from strings to stringsRequired
The custom metadata for the document. The fields must match the custom metadata schema for the document collection.
POST
1curl -X POST https://api.credal.ai/api/v0/documentCollections/addDocumentToCollection \
2 -H "Authorization: Bearer <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "documentId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
6 "documentCollectionId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
7 "customMetadata": {
8 "customerName": "Credal",
9 "meetingDate": "2023-11-06T23:03:42.056Z"
10 }
11}'