NornicDB provides a complete OpenAPI 3.0 specification for all REST API endpoints, enabling interactive API documentation and easy integration with API testing tools.
- openapi.yaml - Complete OpenAPI 3.0 specification
-
Online (Swagger Editor)
- Visit Swagger Editor
- Click "File" → "Import file"
- Select
docs/api-reference/openapi.yaml - Test endpoints directly in the browser
-
Local Swagger UI
# Install Swagger UI docker run -p 8080:8080 -e SWAGGER_JSON=/openapi.yaml \ -v $(pwd)/docs/api-reference/openapi.yaml:/openapi.yaml \ swaggerapi/swagger-ui
Then visit
http://localhost:8080
- Open Postman
- Click "Import" → "File"
- Select
docs/api-reference/openapi.yaml - All endpoints will be imported with example requests
- Open Insomnia
- Click "Create" → "Import/Export" → "Import Data" → "From File"
- Select
docs/api-reference/openapi.yaml - All endpoints will be available for testing
The OpenAPI specification includes:
- All REST Endpoints - Complete coverage of all HTTP API endpoints
- Request/Response Schemas - Detailed schemas for all requests and responses
- Authentication Methods - Documentation of Basic Auth and Bearer Token authentication
- Error Responses - Standard error response formats
- Examples - Example requests and responses for each endpoint
The OpenAPI spec documents two authentication methods:
-
Bearer Token (JWT)
security: - bearerAuth: []
-
Basic Auth (Neo4j Compatible)
security: - basicAuth: []
To authenticate in Swagger UI:
- Click the "Authorize" button
- Enter your credentials
- All requests will include the authentication header
GET /health- Health check (public)GET /status- Server status (authenticated)GET /metrics- Prometheus metrics (authenticated)
POST /auth/token- Get JWT tokenPOST /auth/logout- LogoutGET /auth/me- Current user infoPOST /auth/api-token- Generate API token (admin)GET /auth/oauth/redirect- OAuth redirectGET /auth/oauth/callback- OAuth callback- User management endpoints (admin only)
POST /db/{database}/tx/commit- Execute Cypher query
POST /nornicdb/search- Hybrid searchPOST /nornicdb/similar- Vector similarity searchGET /nornicdb/decay- Memory decay statistics- Embedding management endpoints
GET /admin/stats- System statisticsGET /admin/config- Server configurationPOST /admin/backup- Create backup- GPU control endpoints
GET /gdpr/export- GDPR data exportPOST /gdpr/delete- GDPR erasure request
POST /graphql- GraphQL endpointGET /graphql/playground- GraphQL Playground- MCP and Heimdall endpoints
You can generate client libraries from the OpenAPI spec using tools like:
# Install OpenAPI Generator
npm install @openapitools/openapi-generator-cli -g
# Generate Python client
openapi-generator-cli generate \
-i docs/api-reference/openapi.yaml \
-g python \
-o ./generated/python-client
# Generate JavaScript client
openapi-generator-cli generate \
-i docs/api-reference/openapi.yaml \
-g javascript \
-o ./generated/js-client
# Generate Go client
openapi-generator-cli generate \
-i docs/api-reference/openapi.yaml \
-g go \
-o ./generated/go-client# Generate Java client
swagger-codegen generate \
-i docs/api-reference/openapi.yaml \
-l java \
-o ./generated/java-client# 1. Get authentication token
TOKEN=$(curl -X POST http://localhost:7474/auth/token \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "password123"}' \
| jq -r '.access_token')
# 2. Use token for authenticated requests
curl -X POST http://localhost:7474/nornicdb/search \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "machine learning",
"limit": 10
}'import requests
# Authenticate
response = requests.post(
"http://localhost:7474/auth/token",
json={"username": "admin", "password": "password123"}
)
token = response.json()["access_token"]
# Search
response = requests.post(
"http://localhost:7474/nornicdb/search",
headers={"Authorization": f"Bearer {token}"},
json={"query": "machine learning", "limit": 10}
)
results = response.json()The OpenAPI specification is maintained manually and should be updated whenever:
- New endpoints are added
- Request/response schemas change
- Authentication methods change
- Error response formats change
To update the spec:
- Edit
docs/api-reference/openapi.yaml - Validate the YAML syntax
- Test endpoints in Swagger UI
- Update this README if needed
- API Reference - Complete API documentation
- User Guides - Usage examples
- Getting Started - Installation and setup
If you find any issues with the OpenAPI specification:
- Check that the endpoint behavior matches the spec
- Verify request/response schemas are correct
- Report issues on GitHub with:
- Endpoint path
- Expected vs actual behavior
- Example request/response
Ready to test? → OpenAPI Spec
Need help? → User Guides