{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/plinth-us-grants-data/json-schema/plinth-us-grants-data-batch-request-schema.json",
  "title": "BatchRequest",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/plinth-us-grants-data-batch-api-openapi.yml#/components/schemas/BatchRequest",
  "properties": {
    "rows": {
      "items": {
        "$ref": "#/$defs/BatchRow"
      },
      "type": "array",
      "title": "Rows",
      "description": "Up to 500 rows, answered in order."
    }
  },
  "type": "object",
  "required": [
    "rows"
  ],
  "$defs": {
    "BatchRow": {
      "properties": {
        "ein": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ein",
          "description": "EIN in any format (131837418 or 13-1837418). Either this or `name`."
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "Organization name to resolve when no EIN is known. Matched exactly after normalizing case and punctuation; a name several organizations share answers `ambiguous` with the candidates, and `state` narrows it."
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State",
          "description": "Two-letter state, used only to narrow a `name` that matches in several states."
        },
        "field": {
          "type": "string",
          "title": "Field",
          "description": "One key from GET /batch/fields."
        },
        "year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Year",
          "description": "Filing year, for the grant-graph fields. Ignored, with a note, on fields that read the latest filing."
        },
        "to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "To",
          "description": "Second EIN, for the pair fields (grants_to_*): the recipient, where the row's organization is the funder."
        }
      },
      "type": "object",
      "required": [
        "field"
      ],
      "title": "BatchRow"
    }
  }
}