API Configuration
Query Builder
WHERE Conditions (AND logic)
OR WHERE Conditions (OR logic)
JOINS
Comma-separated list. Supports nested joins with dot notation.
Left outer joins. Automatically adds DISTINCT.
Outputs (Field Selection & Aggregates)
Query Options
Generated Query
{}
Examples
Basic Query
Simple field filtering with operators
JSON Fields
Query JSON/JSONB columns
Nested Joins
Join through multiple tables
Complex Query
Multiple conditions, joins, and OR logic
Field Selection
Return only specific fields
Simple Aggregate
Count records with filters
Grouped Aggregate
Count by category with grouping
Multiple Aggregates
Multiple calculations in one query
SQL Debug
Generate SQL for debugging
Quick Reference
Field References
email- Direct columnparty_roles.active- Joined tablecustom_fields.department- JSON fieldcustom_fields.meta.source- Nested JSON
Operators
eq- Equals (default)gt/gte- Greater than/equallt/lte- Less than/equalin- Array values (comma-separated)like- Pattern matching (%wildcards%)between- Range (value1,value2)null- true/false for NULL checks
Special Values
current_user_id- Requesting user's IDcurrent_party_id- User's party IDcurrent_tenant_id- Current tenantcurrent_date- Today's datecurrent_datetime- Current timestamp
Outputs Feature
- Field Selection: Return only specific fields
- Aggregates: COUNT, AVG, MIN, MAX, SUM
- Grouping: GROUP BY with aggregates
- Multiple Functions: Multiple aggregates in one query
- Debugging: Generate SQL or EXPLAIN plans
Response Types
- Standard:
{success: true, parties: [...], total_count: N} - Aggregate:
{success: true, aggregate_result: N} - Grouped:
{success: true, aggregate_results: [...]} - SQL Debug:
{success: true, sql: "SELECT ..."}
Common Use Cases
- Dashboards: Use aggregates for summary data
- Reports: Group by categories with counts
- Performance: Select only needed fields
- Debugging: Generate SQL to understand queries