Category: API Documentation | Target Audience: Developers & Integrators | Technical Level: Intermediate
Complete reference documentation for EntityDB's REST API. This section provides detailed endpoint documentation, request/response formats, and comprehensive examples for all API operations.
Complete listing of all 40 API endpoints
- Comprehensive endpoint catalog with authentication requirements
- HTTP methods, paths, and functionality overview
- Quick reference for developers and integrators
API fundamentals and getting started
- Base URL and versioning strategy
- Authentication mechanisms and headers
- Request/response formats and conventions
- Error handling and status codes
- Rate limiting and usage guidelines
Authentication and session management
- Login endpoint and credential formats
- JWT token generation and validation
- Session management and refresh tokens
- Password change and user management
- RBAC integration and permission checks
Entity CRUD operations and queries
- Create, read, update, delete operations
- Tag-based filtering and search
- Temporal queries and history retrieval
- Bulk operations and batch processing
- Entity relationships and associations
Advanced query operations
- Complex filtering with multiple criteria
- Temporal queries (as-of, history, diff)
- Tag-based searches with wildcards
- Sorting and pagination options
- Performance optimization guidelines
Dataset management and multi-tenancy
- Dataset CRUD operations and lifecycle management
- Scoped entity operations within datasets
- Dataset-level access control and permissions
- Multi-tenant data organization patterns
- Dataset migration and archival workflows
Comprehensive code examples
- Common use case implementations
- Language-specific client examples (curl, Python, JavaScript)
- Error handling patterns
- Best practices and optimization tips
- Integration patterns and workflows
POST /api/v1/auth/login # Authenticate and get token
GET /api/v1/entities/list # List entities with filtering
POST /api/v1/entities/create # Create new entity
GET /api/v1/entities/get # Retrieve specific entity
PUT /api/v1/entities/update # Update existing entity
- Login:
POST /api/v1/auth/loginwith username/password - Get Token: Extract JWT token from response
- Use Token: Include
Authorization: Bearer <token>in headers - Refresh: Use refresh endpoint before token expiry
# Create entity
curl -X POST http://localhost:8085/api/v1/entities/create \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"tags":["type:document","status:draft"],"content":"Hello World"}'
# List entities by type
curl "http://localhost:8085/api/v1/entities/list?tags=type:document" \
-H "Authorization: Bearer $TOKEN"- GET: Retrieve data (idempotent, cacheable)
- POST: Create new resources
- PUT: Update existing resources (idempotent)
- DELETE: Remove resources
All API responses follow this consistent structure:
{
"status": "ok|error",
"message": "Human-readable description",
"data": { /* Response payload */ },
"error": "Error details if applicable"
}- 400: Bad Request - Invalid input or malformed request
- 401: Unauthorized - Missing or invalid authentication
- 403: Forbidden - Insufficient permissions
- 404: Not Found - Resource doesn't exist
- 500: Internal Server Error - Server-side issues
- Format: RFC 7519 JSON Web Tokens
- Expiry: Configurable (default 24 hours)
- Refresh: Available before expiry
- Claims: User ID, roles, permissions
- Tag-based permissions:
rbac:perm:entity:create - Hierarchical inheritance:
rbac:perm:*grants all permissions - Per-endpoint checks: Each endpoint requires specific permissions
- Real-time validation: Permissions checked on every request
- Use specific tags: Avoid broad queries when possible
- Leverage indexing: Tag-based filters are optimized
- Pagination: Use limit/offset for large result sets
- Temporal caching: Recent temporal queries are cached
- Default limits: 1000 requests/hour per token
- Burst capacity: 100 requests/minute
- Header information: Limits included in response headers
- 429 responses: Rate limit exceeded notifications
- Getting Started: Getting Started - Basic setup and first API calls
- Architecture: Architecture - System design and internal workings
- User Guides: User Guides - Task-oriented API usage
- Troubleshooting: Troubleshooting - Common API issues
- Swagger UI: Available at
/swagger/on running server - JSON Spec: Available at
/swagger/doc.json - Interactive Testing: Test endpoints directly in browser
- Schema Validation: Request/response format validation
- Built-in health check:
GET /health - Metrics endpoint:
GET /metrics(Prometheus format) - Dashboard: Web interface for visual API testing
- CLI tools: Command-line scripts for automation
This API reference provides complete technical documentation for integrating with EntityDB. Use the examples and specifications to build robust applications on the EntityDB platform.