Skip to content

Upload Documents to Collection

POST
/api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents
curl --request POST \
--url https://dashboard.quantcdn.io/api/v3/organizations/example/ai/vector-db/collections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "documents": [ { "content": "example", "key": "example", "metadata": { "title": "example", "source_url": "example", "section": "example", "tags": [ "example" ] } } ] }'

Uploads documents to a vector database collection with automatic embedding generation. Documents are chunked (if needed), embedded using the collection’s embedding model, and stored. * * Supported Content: * - Plain text content * - URLs to fetch content from * - Markdown documents * * Metadata: * Each document can include metadata (title, source_url, section, tags) that is returned with search results.

organisation
required
string

The organisation ID

collectionId
required
string format: uuid

The collection ID

Media typeapplication/json
object
documents
required
Array<object>
object
content
required

Document text content

string
key

Stable document key for upsert

string
<= 512 characters
metadata
object
title
string
source_url
string
section
string
tags
Array<string>
Examplegenerated
{
"documents": [
{
"content": "example",
"key": "example",
"metadata": {
"title": "example",
"source_url": "example",
"section": "example",
"tags": [
"example"
]
}
}
]
}

Documents uploaded successfully

Media typeapplication/json
object
success
boolean
documentIds
Array<string>
chunksCreated
integer
message
string
Example
{
"success": true
}

Invalid request parameters

Access denied

Collection not found

Failed to upload documents