WeKnora API Reference
Complete API documentation for programmatic access to WeKnora services. All API endpoints are RESTful and return JSON responses.
Base URL
All API requests should be made to:
For production deployments, replace localhost:8080 with your WeKnora server address.
Authentication
WeKnora API uses API key authentication. Include your API key in the request header:
Getting Your API Key
- Open your WeKnora instance in a browser
- Open browser developer tools (F12)
- Check network requests for the
x-api-keyheader - Copy the API key (starts with "sk")
API Endpoints
Knowledge Bases
| Method | Endpoint | Description |
|---|---|---|
| GET | /knowledgebases |
List all knowledge bases |
| POST | /knowledgebases |
Create a new knowledge base |
| GET | /knowledgebases/{id} |
Get knowledge base details |
| PUT | /knowledgebases/{id} |
Update knowledge base |
| DELETE | /knowledgebases/{id} |
Delete a knowledge base |
Documents
| Method | Endpoint | Description |
|---|---|---|
| POST | /knowledgebases/{kb_id}/documents |
Upload a document |
| GET | /knowledgebases/{kb_id}/documents |
List documents in knowledge base |
| GET | /documents/{id} |
Get document details |
| DELETE | /documents/{id} |
Delete a document |
Search & Retrieval
| Method | Endpoint | Description |
|---|---|---|
| POST | /knowledgebases/{kb_id}/search |
Search knowledge base |
| POST | /search |
Cross-knowledge base search |
Conversations
| Method | Endpoint | Description |
|---|---|---|
| POST | /conversations |
Create a new conversation |
| POST | /conversations/{id}/messages |
Send a message in conversation |
| GET | /conversations/{id} |
Get conversation history |
Document Upload
Upload documents to a knowledge base using multipart form data.
Request
Response
Search API
Search a knowledge base for relevant information.
Request
Response
Conversation API
Create and manage conversations for Q&A.
Create Conversation
Send Message
Response
Go Client Library
WeKnora provides an official Go client library for easy integration.
Installation
Usage Example
Client Documentation
Error Handling
All API errors follow a consistent format:
Error Response
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 500 | Internal Server Error |
Rate Limiting
API requests are subject to rate limiting to ensure fair usage. Rate limit information is included in response headers:
X-RateLimit-Limit: Maximum requests per windowX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: Time when rate limit resets
Webhooks
WeKnora supports webhooks for event notifications:
- Document processing completion
- Knowledge base updates
- Error notifications
Configure webhooks in the knowledge base settings.