Search
Semantic search across your documents. Returns the most relevant document chunks ranked by score.
Search documents
POST /v1/search| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | yes | The search query |
collection_id | string | no | Limit search to a specific collection |
limit | int | no | Max results (default 10, max 50) |
curl https://docld.com/api/v1/search \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{"query": "payment terms", "limit": 5}'Response
{
"object": "list",
"data": [
{
"object": "search.result",
"document_id": "f47ac10b-...",
"document_name": "contract.pdf",
"score": 0.92,
"page": 4,
"content": "Payment is due within 30 days of invoice date..."
}
]
}Scoped search
Pass collection_id to search within a specific collection:
curl https://docld.com/api/v1/search \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{"query": "payment terms", "collection_id": "c1a2b3c4-..."}'Last updated on