Upload Documents to Collection
POST
/api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/ai/vector-db/collections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"documents":[{"content":"example","key":"example","metadata":{"title":"example","source_url":"example","section":"example","tags":["example"]}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”organisation
required
string
The organisation ID
collectionId
required
string format: uuid
The collection ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
documents
required
Array<object>
object
content
required
Document text content
string
key
Stable document key for upsert
string
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" ] } } ]}Responses
Section titled “Responses”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
