REST API Examples
REST API Overview
:servers {
:rest {
:enabled true
:host "0.0.0.0"
:port 3000
}
}Examples with curl
Document Operations
Create or Update a Document
# Create a new document
curl -X POST http://localhost:3000/api/v1/documents/user:1 \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "[email protected]",
"age": 30,
"roles": ["admin", "user"]
}'
# Response
# {"status":"success","key":"user:1"}Get a Document
Delete a Document
Search Operations
Version Control Operations
Get Document History
Get Document at a Point in Time
Compare Document Versions
Branch Operations
List Branches
Create a Branch
Switch Branch
Merge Branches
Examples with JavaScript
Setting Up
Document Operations
Search Operations
Version Control Operations
Branch Operations
Complete Example: User Management System
Schema Validation Operations
Managing Validation Schemas
Create a Validation Schema
List All Validation Schemas
Get a Specific Schema
Get Schema History
Delete a Validation Schema
Dry-Run Validation
Validation Error Response
JavaScript Validation Examples
Last updated