β

ObjectQL v4.0 is currently in Beta.

ObjectStack LogoObjectQL
API ReferenceAPI Reference

API Reference

Complete API reference for ObjectQL — REST, GraphQL, OData V4, and JSON-RPC protocols

ObjectQL auto-generates APIs from your schema through multiple protocol adapters. All protocols share the same underlying metadata, validation rules, and hook system.

Protocols

Protocol Comparison

FeatureRESTGraphQLOData V4JSON-RPC
CRUD operations
FilteringQuery paramsArguments$filterJSON filters
Field selection?fields=Native$selectfields array
Nested relationsLimitedNative$expandexpand
Batch operations$batch
Subscriptions
AI-friendlyMediumMediumLowHigh
Learning curveLowMediumMediumLow

Common Concepts

Unified ID Field

All APIs use a consistent id field as the primary key. Database-specific mappings (e.g., MongoDB's _id) are handled automatically by the driver.

Authentication

All protocols support the same authentication methods:

Authorization: Bearer <jwt_token>
X-API-Key: <api_key>

See Authentication for details.

Error Format

All protocols return errors in a consistent format:

{
  "error": {
    "code": "VALIDATION_FAIL",
    "message": "Field 'email' is required",
    "details": { "field": "email", "rule": "required" }
  }
}

See Error Handling for the complete error code reference.

Quick Start

# JSON-RPC — query all active users
curl -X POST http://localhost:3000/api/objectql \
  -H "Content-Type: application/json" \
  -d '{
    "op": "find",
    "object": "users",
    "args": {
      "fields": ["id", "name", "email"],
      "filters": [["is_active", "=", true]],
      "top": 10
    }
  }'

Additional References

On this page