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
$curl -X POST https://api.credal.ai/api/v0/documentCollections/addDocumentToCollection \
> -H "Authorization: Bearer <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "documentId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
> "documentCollectionId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
> "customMetadata": {
> "customerName": "Credal",
> "meetingDate": "2023-11-06T23:03:42.056Z"
> }
>}'