Category: Core API
Since Version: 1.3.0
Status: ✅ Stable
Updated: December 22, 2025
This document provides a complete reference for all HTTP endpoints of the ThemisDB REST API. For machine-readable API specifications, see the OpenAPI Specification.
http://localhost:8765
In production environments, HTTPS should be used.
Most endpoints require Bearer token authentication:
Authorization: Bearer <api_key>
API keys can be managed via the Key Management API.
- System & Monitoring
- Entities (CRUD)
- Query & AQL
- Index Management
- Graph Operations
- Vector Search
- Content Management
- Cache (Semantic Cache)
- LLM Integration
- Change Data Capture (CDC)
- Transaction Management
- API Key Management
- PII Operations
- Audit & Compliance
- Classification & Reports
- Error Handling
Health check endpoint for the server.
Query Parameters: None
Response (200 OK):
{
"status": "healthy",
"version": "1.0.1",
"database": "rocksdb",
"uptime_seconds": 3600
}Error Handling:
- Returns status 503 if database is unavailable
Detailed server and database statistics.
Query Parameters: None
Response (200 OK):
{
"server": {
"uptime_seconds": 3600,
"total_requests": 12345,
"total_errors": 42,
"queries_per_second": 123.45,
"threads": 8
},
"storage": {
"rocksdb": {
"block_cache_usage_bytes": 1048576,
"block_cache_capacity_bytes": 8388608,
"estimate_num_keys": 100000,
"estimate_live_data_size_bytes": 52428800,
"cache_hit_rate_percent": 95.5,
"bytes_written": 104857600,
"bytes_read": 209715200
},
"raw_stats": "..."
}
}Error Handling:
500 Internal Server Error: Error retrieving statistics
Prometheus metrics in text exposition format.
Query Parameters: None
Response (200 OK):
Content-Type: text/plain
# HELP process_uptime_seconds Process uptime in seconds
# TYPE process_uptime_seconds gauge
process_uptime_seconds 3600
# HELP vccdb_requests_total Total HTTP requests handled
# TYPE vccdb_requests_total counter
vccdb_requests_total 12345
# HELP vccdb_errors_total Total HTTP errors
# TYPE vccdb_errors_total counter
vccdb_errors_total 42
Error Handling:
500 Internal Server Error: Error generating metrics
Read an entity by primary key.
Path Parameters:
key(string, required): Primary key in formattable:pk(e.g.,users:123)
Query Parameters: None
Response (200 OK):
{
"key": "users:123",
"blob": "{\"name\":\"Alice\",\"age\":30,\"email\":\"alice@example.com\"}"
}Error Handling:
404 Not Found: Entity does not exist400 Bad Request: Invalid key format500 Internal Server Error: Database error
Create or update an entity (upsert).
Path Parameters:
key(string, required): Primary key in formattable:pk
Request Body:
{
"blob": "{\"name\":\"Alice\",\"age\":30,\"email\":\"alice@example.com\"}"
}Response (201 Created):
{
"success": true,
"key": "users:123",
"blob_size": 58
}Error Handling:
400 Bad Request: Invalid request format or missing blob500 Internal Server Error: Database error
Delete an entity.
Path Parameters:
key(string, required): Primary key in formattable:pk
Query Parameters: None
Response (200 OK):
{
"success": true,
"key": "users:123"
}Error Handling:
400 Bad Request: Invalid key format500 Internal Server Error: Database error
Create a new entity (with key in body or auto-generated).
Query Parameters: None
Request Body:
{
"key": "users:124",
"blob": "{\"name\":\"Bob\",\"age\":25}"
}If key is missing, a UUID is automatically generated.
Response (201 Created):
{
"success": true,
"key": "users:124",
"blob_size": 28
}Error Handling:
400 Bad Request: Invalid request format500 Internal Server Error: Database error
Execute a query with equality and range predicates.
Query Parameters: None
Request Body:
{
"table": "users",
"predicates": [
{ "column": "city", "value": "Berlin" }
],
"range": [
{
"column": "age",
"gte": "25",
"lte": "35",
"includeLower": true,
"includeUpper": true
}
],
"order_by": {
"column": "age",
"desc": false,
"limit": 10
},
"return": "entities",
"optimize": true,
"allow_full_scan": false,
"explain": false
}Response (200 OK) - with return: "keys":
{
"table": "users",
"count": 42,
"keys": ["users:123", "users:456", "..."],
"plan": {
"mode": "index_optimized",
"order": [
{ "column": "city", "value": "Berlin" }
],
"estimates": [
{
"column": "city",
"estimated_count": 50,
"index_exists": true
}
]
}
}Response (200 OK) - with return: "entities":
{
"table": "users",
"count": 42,
"entities": [
"{\"name\":\"Alice\",\"age\":30,\"city\":\"Berlin\"}",
"{\"name\":\"Bob\",\"age\":32,\"city\":\"Berlin\"}"
]
}Error Handling:
400 Bad Request: Invalid query syntax403 Forbidden: Full scan not allowed and no index available500 Internal Server Error: Query execution error
Execute an AQL (Advanced Query Language) query.
Query Parameters: None
Request Body:
{
"query": "FOR user IN users FILTER user.city == 'Berlin' AND user.age >= 25 SORT user.age RETURN user",
"bind_vars": {
"minAge": 25
},
"options": {
"profile": false,
"fullCount": false,
"maxWarnings": 10,
"timeout": 30000
}
}Response (200 OK):
{
"result": [
{"name": "Alice", "age": 30, "city": "Berlin"},
{"name": "Bob", "age": 32, "city": "Berlin"}
],
"hasMore": false,
"cached": false,
"extra": {
"warnings": [],
"stats": {
"writesExecuted": 0,
"writesIgnored": 0,
"scannedFull": 0,
"scannedIndex": 42,
"filtered": 0,
"httpRequests": 0,
"executionTime": 0.012
}
}
}Error Handling:
400 Bad Request: Invalid AQL syntax404 Not Found: Referenced collection not found500 Internal Server Error: Query execution error
AQL queries support multiple pagination strategies for efficient handling of large result sets.
Request Parameters:
{
"query": "FOR user IN users SORT user.name RETURN user",
"use_cursor": true,
"cursor": "eyJwayI6InVzZXJzOmFsaWNlIiwiY29sbGVjdGlvbiI6InVzZXJzIiwidmVyc2lvbiI6MX0=",
"page_size": 100
}Pagination Parameters:
use_cursor(boolean): Enable cursor-based paginationcursor(string, optional): Base64-encoded cursor token from previous pagepage_size(integer, optional): Items per page (min: 1, max: 10,000, default: 100)
Paginated Response:
{
"items": [
{"name": "Alice", "age": 30},
{"name": "Bob", "age": 32}
],
"has_more": true,
"next_cursor": "eyJwayI6InVzZXJzOmJvYiIsImNvbGxlY3Rpb24iOiJ1c2VycyIsInZlcnNpb24iOjF9",
"batch_size": 100,
"page_info": {
"page_size": 100,
"has_next_page": true,
"has_prev_page": false
},
"pagination_method": "cursor"
}Pagination Methods:
- cursor: Stateless cursor-based pagination (recommended for distributed systems)
- keyset: Efficient ORDER BY-based pagination (O(log n) performance)
- offset: Traditional offset-based pagination (compatibility)
Features:
- ✅ Cursor expiration (1-hour TTL by default)
- ✅ ORDER BY value encoding for keyset pagination (eliminates database lookups)
- ✅ Configurable page size limits prevent memory exhaustion
- ✅ Backward compatible with non-paginated queries
- ✅ Stateless design suitable for distributed systems
Example - First Page:
curl -X POST http://localhost:8765/query/aql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"query": "FOR user IN users SORT user.name RETURN user",
"use_cursor": true,
"page_size": 50
}'Example - Next Page:
curl -X POST http://localhost:8765/query/aql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"query": "FOR user IN users SORT user.name RETURN user",
"use_cursor": true,
"cursor": "eyJwayI6InVzZXJzOmFsaWNlIiwiY29sbGVjdGlvbiI6InVzZXJzIn0=",
"page_size": 50
}'Error Handling:
400 Bad Request: Invalid cursor or expired cursor400 Bad Request: Page size out of range (< 1 or > 10,000)
Create an index on a table column.
Query Parameters: None
Request Body:
{
"table": "users",
"column": "email",
"index_type": "hash"
}Index Types:
hash: Equality lookups (default)range: Range queries and sortingfulltext: Full-text searchvector: Vector similarity search (requiresdimensionparameter)
Response (201 Created):
{
"success": true,
"table": "users",
"column": "email",
"index_type": "hash"
}Error Handling:
400 Bad Request: Invalid index configuration409 Conflict: Index already exists500 Internal Server Error: Index creation failed
Delete an index.
Query Parameters: None
Request Body:
{
"table": "users",
"column": "email"
}Response (200 OK):
{
"success": true,
"table": "users",
"column": "email"
}Error Handling:
404 Not Found: Index does not exist500 Internal Server Error: Index deletion failed
List all indexes for a table.
Query Parameters:
table(string, required): Table name
Response (200 OK):
{
"table": "users",
"indexes": [
{
"column": "email",
"index_type": "hash",
"created_at": "2025-01-15T10:30:00Z"
},
{
"column": "age",
"index_type": "range",
"created_at": "2025-01-15T10:31:00Z"
}
]
}Error Handling:
400 Bad Request: Missing table parameter500 Internal Server Error: Failed to retrieve indexes
Perform vector similarity search.
Query Parameters: None
Request Body:
{
"table": "embeddings",
"vector": [0.1, 0.2, 0.3, ...],
"top_k": 10,
"metric": "cosine",
"filter": {
"predicates": [
{ "column": "category", "value": "tech" }
]
}
}Metrics:
cosine: Cosine similarity (default)euclidean: Euclidean distance (L2)dot_product: Dot product
Response (200 OK):
{
"results": [
{
"key": "embeddings:doc1",
"score": 0.95,
"blob": "{\"text\":\"Machine learning\",\"embedding\":[...]}"
},
{
"key": "embeddings:doc2",
"score": 0.89,
"blob": "{\"text\":\"Deep learning\",\"embedding\":[...]}"
}
],
"count": 10,
"search_time_ms": 15
}Error Handling:
400 Bad Request: Invalid vector dimensions or parameters404 Not Found: Vector index not found500 Internal Server Error: Search execution error
Hybrid search combining vector similarity and keyword search.
Query Parameters: None
Request Body:
{
"table": "documents",
"text_query": "machine learning tutorial",
"vector": [0.1, 0.2, 0.3, ...],
"top_k": 10,
"weights": {
"bm25": 0.5,
"vector": 0.5
}
}Response (200 OK):
{
"results": [
{
"key": "documents:doc1",
"combined_score": 0.92,
"bm25_score": 0.88,
"vector_score": 0.95,
"blob": "{\"text\":\"Complete ML tutorial\"}"
}
],
"count": 10
}Error Handling:
400 Bad Request: Invalid parameters or missing indexes500 Internal Server Error: Search execution error
Traverse graph relationships.
Query Parameters: None
Request Body:
{
"start_vertex": "users:alice",
"edge_collection": "follows",
"direction": "outbound",
"min_depth": 1,
"max_depth": 3,
"uniqueness": "vertices"
}Directions:
outbound: Follow edges from start vertexinbound: Follow edges to start vertexany: Follow edges in any direction
Response (200 OK):
{
"vertices": [
{
"key": "users:bob",
"depth": 1,
"data": "{\"name\":\"Bob\"}"
},
{
"key": "users:charlie",
"depth": 2,
"data": "{\"name\":\"Charlie\"}"
}
],
"edges": [
{
"from": "users:alice",
"to": "users:bob",
"data": "{\"since\":\"2024-01-15\"}"
}
],
"paths": [
["users:alice", "users:bob", "users:charlie"]
]
}Error Handling:
400 Bad Request: Invalid traversal parameters404 Not Found: Start vertex not found500 Internal Server Error: Traversal execution error
Start a new transaction.
Query Parameters: None
Request Body:
{
"isolation_level": "SNAPSHOT",
"timeout_ms": 30000
}Isolation Levels:
READ_COMMITTED: Default isolation levelSNAPSHOT: Snapshot isolation (MVCC)
Response (201 Created):
{
"transaction_id": "txn_abc123def456",
"isolation_level": "SNAPSHOT",
"started_at": "2025-12-23T14:00:00Z"
}Error Handling:
400 Bad Request: Invalid transaction parameters500 Internal Server Error: Failed to start transaction
Commit a transaction.
Path Parameters:
txn_id(string, required): Transaction ID
Query Parameters: None
Response (200 OK):
{
"success": true,
"transaction_id": "txn_abc123def456",
"committed_at": "2025-12-23T14:01:00Z"
}Error Handling:
404 Not Found: Transaction not found409 Conflict: Transaction conflict detected500 Internal Server Error: Commit failed
Rollback a transaction.
Path Parameters:
txn_id(string, required): Transaction ID
Query Parameters: None
Response (200 OK):
{
"success": true,
"transaction_id": "txn_abc123def456",
"rolled_back_at": "2025-12-23T14:01:00Z"
}Error Handling:
404 Not Found: Transaction not found500 Internal Server Error: Rollback failed
All errors follow this standard format:
{
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid query syntax",
"details": "Expected FOR keyword at line 1, column 5",
"request_id": "req_abc123"
}
}| Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST |
400 | Malformed request body or parameters |
UNAUTHORIZED |
401 | Missing or invalid authentication |
FORBIDDEN |
403 | Insufficient permissions |
NOT_FOUND |
404 | Resource not found |
CONFLICT |
409 | Resource conflict (e.g., duplicate key) |
RATE_LIMITED |
429 | Too many requests |
INTERNAL_ERROR |
500 | Server internal error |
SERVICE_UNAVAILABLE |
503 | Service temporarily unavailable |
The API implements rate limiting to prevent abuse:
Response Headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1703001600
Rate Limit Exceeded (429):
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded",
"retry_after_seconds": 60
}
}- Use HTTPS in Production: Always use TLS/SSL encryption
- Implement Retries: Use exponential backoff for transient errors
- Cache API Keys: Don't request new keys for every request
- Use Batch Operations: Combine multiple operations when possible
- Monitor Rate Limits: Track usage via response headers
- Enable Compression: Use
Accept-Encoding: gzipheader - Use Transactions: For multi-operation consistency
- Index Appropriately: Create indexes for frequently queried columns
- AQL Reference - Query language documentation
- OpenAPI Specification - Machine-readable API spec
- Authentication Guide - Security configuration
- GraphQL API - GraphQL endpoint documentation
Note: For the most detailed and up-to-date information, please refer to the German HTTP API reference.
Version: 1.3.0 | License: MIT | Support: GitHub Issues