Complete reference for the LH42 REST API. Search your knowledge base, chat with AI, and manage documents programmatically.
All API requests require authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYYou can generate API keys in your dashboard settings. Keep your keys secure and never expose them in client-side code.
/v1/searchPerform hybrid search across your knowledge base
curl -X POST https://api.lakehouse42.com/v1/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What are our Q4 revenue projections?",
"limit": 10,
"options": {
"retrieval": "hybrid",
"rerank": true
}
}'/v1/chat/completionsGenerate AI responses with RAG context
curl -X POST https://api.lakehouse42.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "What are our main competitive advantages?"
}
],
"stream": false
}'/v1/documentsUpload and index a new document
curl -X POST https://api.lakehouse42.com/v1/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.pdf" \
-F "metadata={"source": "uploads", "department": "engineering"}"/v1/documentsRetrieve all documents in your knowledge base
curl -X GET "https://api.lakehouse42.com/v1/documents?limit=10&offset=0" \
-H "Authorization: Bearer YOUR_API_KEY"/v1/documents/{id}Remove a document from the index
curl -X DELETE https://api.lakehouse42.com/v1/documents/doc_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"The API uses conventional HTTP response codes to indicate success or failure.
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad request - invalid parameters |
| 401 | Unauthorized - invalid or missing API key |
| 403 | Forbidden - insufficient permissions |
| 404 | Not found - resource doesn't exist |
| 429 | Rate limited - too many requests |
| 500 | Server error - something went wrong |
Get your API key and start integrating Lakehouse into your applications.