24
HTTP API

Query Routes

Configure reusable form and category listing routes with nested AND/OR predicates.

query_routes lets you define reusable, named listing routes for forms and categories.

Config

'http' => [
  'query_routes' => [
    'forms' => [
      'legacy_or_busy' => [
        'where' => [
          'any' => [
            ['field' => 'created_at', 'op' => 'lt', 'value' => '2026-01-01T00:00:00Z'],
            ['field' => 'responses_count', 'op' => 'gt', 'value' => 100],
          ],
        ],
      ],
    ],
    'categories' => [
      'active_non_system' => [
        'where' => [
          'all' => [
            ['field' => 'is_active', 'op' => 'eq', 'value' => true],
            ['field' => 'is_system', 'op' => 'eq', 'value' => false],
          ],
        ],
      ],
    ],
  ],
],

Endpoints

  • GET /form-routes/{routeKey}
  • GET /category-routes/{routeKey}

Both endpoints are available on non-scoped and scoped route groups.

Predicate DSL

  • all: AND group
  • any: OR group
  • nesting is supported

Condition format:

{ "field": "created_at", "op": "lt", "value": "2026-01-01T00:00:00Z" }

Operators

  • eq, neq
  • gt, gte, lt, lte
  • in, not_in
  • contains, starts_with, ends_with
  • is_null, not_null
  • between

Aggregate fields

  • forms: responses_count
  • categories: forms_count

Aggregate fields support numeric operators: eq, neq, gt, gte, lt, lte.

Form field note

For forms:

  • category targets the stored category key/reference on form revisions
  • category_slug targets the linked category slug