Collections
Collections group documents together for scoped search and chat. Think of them as folders for your documents.
The collection object
{
"id": "c1a2b3c4-...",
"object": "collection",
"name": "Invoices Q1",
"description": "All Q1 2026 invoices",
"document_count": 12,
"created": 1710000000
}Create a collection
POST /v1/collections| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Collection name |
description | string | no | Optional description |
curl https://docld.com/api/v1/collections \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{"name": "Invoices Q1", "description": "All Q1 2026 invoices"}'List collections
GET /v1/collectionsReturns a paginated list of your collections.
curl https://docld.com/api/v1/collections \
-H "Authorization: Bearer docld_..."Retrieve a collection
GET /v1/collections/:idcurl https://docld.com/api/v1/collections/c1a2b3c4-... \
-H "Authorization: Bearer docld_..."Update a collection
POST /v1/collections/:id| Parameter | Type | Description |
|---|---|---|
name | string | New name |
description | string | New description |
curl https://docld.com/api/v1/collections/c1a2b3c4-... \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{"name": "Invoices Q1 2026"}'Delete a collection
DELETE /v1/collections/:idRemoves the collection and all document associations. Documents themselves are not deleted.
curl -X DELETE https://docld.com/api/v1/collections/c1a2b3c4-... \
-H "Authorization: Bearer docld_..."Response
{
"id": "c1a2b3c4-...",
"object": "collection",
"deleted": true
}Add or remove a document
POST /v1/collections/:id/documents| Parameter | Type | Required | Description |
|---|---|---|---|
document_id | string | yes | ID of the document |
action | string | no | "add" (default) or "remove" |
Add a document
curl https://docld.com/api/v1/collections/c1a2b3c4-.../documents \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{"document_id": "f47ac10b-..."}'Remove a document
curl https://docld.com/api/v1/collections/c1a2b3c4-.../documents \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{"document_id": "f47ac10b-...", "action": "remove"}'Last updated on