API Reference
Canonical REST surface for Knol OSS gateway plus enterprise tenant OpenAPI links.
Configured Service Endpoints
Gateway API
Base URL: https://api.aiknol.com
Write/search paths are relative to this base.
Tenant Swagger UI
URL: https://api.aiknol.com/docs/
OpenAPI docs generated by the tenant service.
Config Source
All docs URLs are configured in frontend/docs/src/config/site.ts.
Override via env vars: NEXT_PUBLIC_API_BASE_URL and NEXT_PUBLIC_TENANT_SWAGGER_URL.
Authentication
Send API key in Authorization header as bearer token:
Authorization: Bearer knol_live_...
API keys map to tenant + role (`ReadOnly`, `Developer`, `Admin`), and every request is tenant-scoped.
Gateway Endpoints
| Method | Path | Role | Notes |
|---|---|---|---|
POST | /v1/memory | Developer+ | Write a memory entry |
POST | /v1/memory/batch | Developer+ | Write multiple memories |
POST | /v1/memory/search | ReadOnly+ | Hybrid memory search |
GET | /v1/memory/:id | ReadOnly+ | Fetch a memory by id |
PUT | /v1/memory/:id | Developer+ | Update a memory |
DELETE | /v1/memory/:id | Developer+ | Soft delete a memory |
POST | /v1/memory/:id/restore | Developer+ | Restore soft-deleted memory |
POST | /v1/memory/export | ReadOnly+ | Export memories |
POST | /v1/memory/import | Developer+ | Import memories |
Write Memory Example
curl -X POST https://api.aiknol.com/v1/memory \
-H "Authorization: Bearer $KNOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"User likes concise replies","role":"user"}'content is required. user_id, when provided, must be a UUID.