{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/plinth-us-grants-data/json-schema/plinth-us-grants-data-essentials-search-schema.json",
  "title": "EssentialsSearch",
  "description": "Candid Essentials v4 speaks POST-with-a-body, and that is the shape a migrating client\nalready builds. `search_terms`, `from`, `size`, `filters` and `sort` therefore keep their Candid\nnames and meanings; the FILTER VOCABULARY inside `filters` is ours, because Candid's is built on\nPCS and on profile data we do not hold (see config/candid-compat.json → essentialsFilters).\n\n`filters` is a free-form object rather than a nested model on purpose: an unknown filter key is\nREPORTED in x_plinth.warnings, and a strict schema would instead 422 the whole request and tell\nthe caller nothing about which of their filters we understood.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/plinth-us-grants-data-organizations-api-openapi.yml#/components/schemas/EssentialsSearch",
  "properties": {
    "search_terms": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Search Terms",
      "description": "Organization name or keyword."
    },
    "from": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "From",
      "description": "0-based offset, as Candid."
    },
    "size": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Size",
      "description": "Page size. Default 25, capped at 1000 (Candid's ceiling is 25)."
    },
    "mode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mode",
      "description": "text (default) | semantic. `semantic` matches on mission meaning rather than name, where the embedding store is staged."
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters",
      "description": "See the Essentials filter matrix. Unknown keys are reported, not ignored."
    },
    "sort": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sort",
      "description": "{\"field\": \"total_revenue\", \"order\": \"desc\"} — or the field name alone. Sortable: total_revenue, total_expenses, net_assets, grants_paid, name."
    },
    "strict": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Strict",
      "description": "Reject the request if any filter could not be honored."
    }
  },
  "type": "object"
}