{
  "openapi": "3.1.0",
  "info": {
    "title": "UN Mandate Registry API",
    "version": "1.0.0",
    "description": "Public, read-only access to documents, extracted paragraphs, budget citations and resolution relationships. No authentication required. Budget citations describe recorded programme-budget references, not legal in-force status. Missing extracted text does not establish that the original document contains no relevant provisions. Resolution collections are related documents, not necessarily ordered versions or legal replacements. Citation context is the selected budget cycle. Extraction and relationship coverage may be incomplete.\nUse returned pageUrl/jsonUrl links verbatim. This API does not determine legal in-force status."
  },
  "servers": [
    {
      "url": "/",
      "description": "Current host"
    },
    {
      "url": "https://mandates.un.org",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/documents": {
      "get": {
        "operationId": "searchDocuments",
        "summary": "Search and browse mandate documents",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "description": "Citing entity code, for example `DESA`. `__none__` selects documents with no citing entity.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organ",
            "in": "query",
            "required": false,
            "description": "Issuing body code from `/api/v1/reference`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "crossCitingEntity",
            "in": "query",
            "required": false,
            "description": "Second citing entity; intersects entity scope.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyword",
            "in": "query",
            "required": false,
            "description": "Search document titles, symbols and subjects using the website search grammar. Up to 500 characters and 32 whitespace-separated terms.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budget_part",
            "in": "query",
            "required": false,
            "description": "Budget part number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "description": "Budget section identifier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subprogramme",
            "in": "query",
            "required": false,
            "description": "Subprogramme label.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "foundational",
            "in": "query",
            "required": false,
            "description": "Set to `true` to select foundational/mandates-and-background citations. Applies to the selected document/entity pair.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "programme",
            "in": "query",
            "required": false,
            "description": "Programme identifier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "description": "UNBIS subject heading.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subject_domain",
            "in": "query",
            "required": false,
            "description": "Two-digit UNBIS domain code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_year",
            "in": "query",
            "required": false,
            "description": "Inclusive earliest document year, 0–9999.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "end_year",
            "in": "query",
            "required": false,
            "description": "Inclusive latest document year, 0–9999.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "budget_document",
            "in": "query",
            "required": false,
            "description": "Budget stream: `ppb`, `pko` or `plan_outline`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budget_group",
            "in": "query",
            "required": false,
            "description": "Peacekeeping budget group: `missions` or `support`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budget_location",
            "in": "query",
            "required": false,
            "description": "Structured budget-location scope serialized by website links. Copy this parameter from a filtered website URL.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document_type",
            "in": "query",
            "required": false,
            "description": "Document type label as used in the website.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agenda_item",
            "in": "query",
            "required": false,
            "description": "Agenda item filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agenda_scope",
            "in": "query",
            "required": false,
            "description": "Structured agenda scope serialized by website links; takes precedence over `agenda_item`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_scope",
            "in": "query",
            "required": false,
            "description": "Related agenda cluster scope; takes precedence over `agenda_scope` and `agenda_item`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "full_document_symbol",
            "in": "query",
            "required": false,
            "description": "Exact document symbol.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_citations",
            "in": "query",
            "required": false,
            "description": "Minimum matching citation count, 0–1000000.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "max_citations",
            "in": "query",
            "required": false,
            "description": "Maximum matching citation count, 0–1000000.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "cited",
            "in": "query",
            "required": false,
            "description": "Set to `1` to select only documents cited in the selected budget cycle.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ppb_version",
            "in": "query",
            "required": false,
            "description": "Budget-cycle slug from `/api/v1/reference`. Defaults to the database default; responses identify the resolved cycle.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "group",
            "in": "query",
            "required": false,
            "description": "Set to `1` to group matching versions in list responses. Exports always expand all matching documents.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "`citing_entities_desc` (default), `citing_entities_asc`, `citations_desc`, `citations_asc`, `year_desc`, `year_asc`, `similarity_desc`, `similarity_asc`, `word_count_desc` or `word_count_asc`. Keyword matches rank first; symbol breaks ties.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page. No overall traversal limit.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 15, maximum 100; larger values are normalized to 100. Exports ignore `page` and `limit`.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "Expand the complete selected-cycle sidebar data, independently of search citation filters.",
            "schema": {
              "type": "string",
              "enum": [
                "details"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of matching documents. Follow pagination.hasMore; page size does not cap total traversal. An out-of-range page retains total and has no items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentList"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or repeated known query parameter, unsupported selector/include/format, or unknown body, session or budget cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Data temporarily unavailable; retry after 30 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{symbol}": {
      "get": {
        "operationId": "getDocument",
        "summary": "Get a document and its complete details",
        "description": "The symbol may contain slashes; URL-encode it as a path parameter. Returned jsonUrl points to the equivalent /mandate/{symbol}.json representation.",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "A/RES/79/1"
          },
          {
            "name": "ppb_version",
            "in": "query",
            "required": false,
            "description": "Budget-cycle slug from `/api/v1/reference`. Defaults to the database default; responses identify the resolved cycle.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The document, available extracted English paragraphs and selected-cycle sidebar details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or repeated known query parameter, unsupported selector/include/format, or unknown body, session or budget cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Document not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Data temporarily unavailable; retry after 30 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agendas": {
      "get": {
        "operationId": "getAgendas",
        "summary": "Browse intergovernmental agendas",
        "description": "The hierarchy shown in the Intergovernmental Agendas tab, including allocations, available meeting counts, subtree resolution counts and related agenda clusters. Defaults to GA and the website’s preferred available session. SC uses a year as its session. Null counts and unavailable status mean missing data, not zero. No pagination or result cap. Serialize a node’s scope as agenda_scope in document search to retrieve its documents.",
        "parameters": [
          {
            "name": "body",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "GA",
                "SC",
                "ECOSOC",
                "HRC"
              ],
              "default": "GA"
            },
            "description": "Intergovernmental body."
          },
          {
            "name": "session",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,4}$"
            },
            "description": "Session from the returned sessions array; for SC this is a year. Omit to use the same default as the website. Unknown sessions return 400."
          }
        ],
        "responses": {
          "200": {
            "description": "Complete agenda tree, sessions, counts and related items. An empty status means no agenda is available for the body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgendaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or repeated known query parameter, unsupported selector/include/format, or unknown body, session or budget cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Data temporarily unavailable; retry after 30 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/programmes": {
      "get": {
        "operationId": "getProgrammes",
        "summary": "Browse entities, programmes and budget locations",
        "description": "The complete Entities and Programmes tab data: a flat tree keyed by id/parentId, document counts, expenditure matches keyed by row ID, and programme clusters. Includes official locations without citations. Serves only the latest available budget cycle, matching this tab; the response identifies that cycle. Historical cycles are not supported and ppb_version selectors return 400. No pagination or result cap. Expenditure amounts are budget-location figures, not allocations to documents.",
        "responses": {
          "200": {
            "description": "Complete entity/programme tree, latest-cycle metadata, expenditure matches and cluster membership.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgrammeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or repeated known query parameter, unsupported selector/include/format, or unknown body, session or budget cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Data temporarily unavailable; retry after 30 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reference": {
      "get": {
        "operationId": "getReference",
        "summary": "Get entities, organs, programme hierarchy and budget cycles",
        "parameters": [
          {
            "name": "ppb_version",
            "in": "query",
            "required": false,
            "description": "Budget-cycle slug from `/api/v1/reference`. Defaults to the database default; responses identify the resolved cycle.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reference codes and programme hierarchy for the selected cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reference"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or repeated known query parameter, unsupported selector/include/format, or unknown body, session or budget cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Data temporarily unavailable; retry after 30 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/exports": {
      "get": {
        "operationId": "exportDocuments",
        "summary": "Download every matching document",
        "description": "Streamed download with no total result cap. CSV has a standard column header without repeated file-level metadata; metadata is included in Excel/JSON. JSON downloads use indented regular JSON. Ignores page/limit and expands grouped versions. JSON supports include=details. Excel contains Documents, Budget citations, Version relationships and About this export sheets. Live batches are not a frozen database snapshot. A failed stream is an incomplete download and must be retried.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "description": "Citing entity code, for example `DESA`. `__none__` selects documents with no citing entity.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organ",
            "in": "query",
            "required": false,
            "description": "Issuing body code from `/api/v1/reference`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "crossCitingEntity",
            "in": "query",
            "required": false,
            "description": "Second citing entity; intersects entity scope.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyword",
            "in": "query",
            "required": false,
            "description": "Search document titles, symbols and subjects using the website search grammar. Up to 500 characters and 32 whitespace-separated terms.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budget_part",
            "in": "query",
            "required": false,
            "description": "Budget part number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "description": "Budget section identifier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subprogramme",
            "in": "query",
            "required": false,
            "description": "Subprogramme label.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "foundational",
            "in": "query",
            "required": false,
            "description": "Set to `true` to select foundational/mandates-and-background citations. Applies to the selected document/entity pair.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "programme",
            "in": "query",
            "required": false,
            "description": "Programme identifier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "description": "UNBIS subject heading.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subject_domain",
            "in": "query",
            "required": false,
            "description": "Two-digit UNBIS domain code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_year",
            "in": "query",
            "required": false,
            "description": "Inclusive earliest document year, 0–9999.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "end_year",
            "in": "query",
            "required": false,
            "description": "Inclusive latest document year, 0–9999.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "budget_document",
            "in": "query",
            "required": false,
            "description": "Budget stream: `ppb`, `pko` or `plan_outline`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budget_group",
            "in": "query",
            "required": false,
            "description": "Peacekeeping budget group: `missions` or `support`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budget_location",
            "in": "query",
            "required": false,
            "description": "Structured budget-location scope serialized by website links. Copy this parameter from a filtered website URL.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document_type",
            "in": "query",
            "required": false,
            "description": "Document type label as used in the website.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agenda_item",
            "in": "query",
            "required": false,
            "description": "Agenda item filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agenda_scope",
            "in": "query",
            "required": false,
            "description": "Structured agenda scope serialized by website links; takes precedence over `agenda_item`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_scope",
            "in": "query",
            "required": false,
            "description": "Related agenda cluster scope; takes precedence over `agenda_scope` and `agenda_item`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "full_document_symbol",
            "in": "query",
            "required": false,
            "description": "Exact document symbol.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_citations",
            "in": "query",
            "required": false,
            "description": "Minimum matching citation count, 0–1000000.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "max_citations",
            "in": "query",
            "required": false,
            "description": "Maximum matching citation count, 0–1000000.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "cited",
            "in": "query",
            "required": false,
            "description": "Set to `1` to select only documents cited in the selected budget cycle.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ppb_version",
            "in": "query",
            "required": false,
            "description": "Budget-cycle slug from `/api/v1/reference`. Defaults to the database default; responses identify the resolved cycle.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "group",
            "in": "query",
            "required": false,
            "description": "Set to `1` to group matching versions in list responses. Exports always expand all matching documents.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "`citing_entities_desc` (default), `citing_entities_asc`, `citations_desc`, `citations_asc`, `year_desc`, `year_asc`, `similarity_desc`, `similarity_asc`, `word_count_desc` or `word_count_asc`. Keyword matches rank first; symbol breaks ties.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx",
                "json"
              ],
              "default": "csv"
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "Expand the complete selected-cycle sidebar data, independently of search citation filters.",
            "schema": {
              "type": "string",
              "enum": [
                "details"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment containing all matching documents. Full details are available for JSON only.",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or repeated known query parameter, unsupported selector/include/format, or unknown body, session or budget cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Data temporarily unavailable; retry after 30 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BudgetVersion": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "ppb_year": {
            "type": "number"
          },
          "is_default": {
            "type": "boolean"
          },
          "sort_order": {
            "type": "number"
          }
        },
        "required": [
          "slug",
          "display_name",
          "ppb_year",
          "is_default",
          "sort_order"
        ],
        "additionalProperties": false
      },
      "Document": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "issuingBody": {
            "type": [
              "string",
              "null"
            ]
          },
          "year": {
            "type": [
              "number",
              "null"
            ]
          },
          "documentType": {
            "type": "string"
          },
          "subjects": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agendaItems": {
            "type": "object",
            "properties": {
              "numbers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "titles": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "numbers",
              "titles"
            ],
            "additionalProperties": false
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "pageUrl": {
            "type": "string"
          },
          "canonicalUrl": {
            "type": "string"
          },
          "jsonUrl": {
            "type": "string"
          },
          "budgetVersion": {
            "type": "string"
          },
          "matchingCitationCount": {
            "type": "number"
          },
          "matchingEntityCount": {
            "type": "number"
          },
          "matchingEntities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "matchingFoundationalEntities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "matchingProgrammes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "matchingBudgetLocations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "stream": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "part": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "part_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "section": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "section_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "programme": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "programme_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "entity": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "subprogramme": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "subprogramme_number": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "stream",
                "part",
                "part_title",
                "section",
                "section_title",
                "programme",
                "programme_title",
                "entity",
                "subprogramme",
                "subprogramme_number"
              ],
              "additionalProperties": {}
            }
          },
          "series": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "latest_version": {
                    "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "is_collection": {
                    "type": "boolean"
                  },
                  "has_newer": {
                    "type": "boolean"
                  },
                  "is_latest": {
                    "type": "boolean"
                  },
                  "series_count": {
                    "type": "number"
                  }
                },
                "required": [
                  "latest_version",
                  "is_collection",
                  "has_newer",
                  "is_latest",
                  "series_count"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "group": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "size": {
                    "type": "number"
                  },
                  "min_year": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "max_year": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "members": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "symbol": {
                          "type": "string"
                        },
                        "year": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "symbol",
                        "year",
                        "title"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "size",
                  "min_year",
                  "max_year",
                  "members"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "details": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "not_included"
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "included"
                  },
                  "citations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "origin_document": {
                          "type": "string"
                        },
                        "entity": {
                          "type": "string"
                        },
                        "entity_long": {
                          "type": "string"
                        },
                        "budget_part": {
                          "type": "string"
                        },
                        "budget_part_number": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "budget_part_title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "section": {
                          "type": "string"
                        },
                        "section_title": {
                          "type": "string"
                        },
                        "programme": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "programme_title": {
                          "type": "string"
                        },
                        "sub-programme": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "sub_programme_number": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "sub_programme_title": {
                          "description": "Title or an unnumbered source label, such as All Subprogrammes. The original combined label is retained in sub-programme.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "component": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {
                          "type": "string"
                        },
                        "part_in_document": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "origin_document",
                        "entity",
                        "entity_long",
                        "budget_part",
                        "budget_part_number",
                        "budget_part_title",
                        "section",
                        "section_title",
                        "programme",
                        "programme_title",
                        "sub-programme",
                        "sub_programme_number",
                        "sub_programme_title",
                        "component",
                        "description",
                        "part_in_document"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "budgetLocations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "stream": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "part": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "part_title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "section": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "section_title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "programme": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "programme_title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "entity": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "subprogramme": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "subprogramme_number": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "stream",
                        "part",
                        "part_title",
                        "section",
                        "section_title",
                        "programme",
                        "programme_title",
                        "entity",
                        "subprogramme",
                        "subprogramme_number"
                      ],
                      "additionalProperties": {}
                    }
                  },
                  "foundationalEntities": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "entityCitationTotals": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "number"
                    }
                  },
                  "entityExpenditures": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "matched"
                            },
                            "amount": {
                              "type": "number",
                              "description": "USD expenditure for the entity/location, not allocation to this resolution."
                            },
                            "period": {
                              "type": "string"
                            },
                            "funding": {
                              "type": "object",
                              "properties": {
                                "regular_budget": {
                                  "type": "number"
                                },
                                "other_assessed": {
                                  "type": "number"
                                },
                                "extrabudgetary": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            },
                            "nodeIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "sources": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "symbol": {
                                    "type": "string"
                                  },
                                  "url": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "datasetUrl": {
                              "type": "string"
                            },
                            "openUrl": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "status",
                            "amount",
                            "period",
                            "funding",
                            "nodeIds",
                            "sources",
                            "datasetUrl",
                            "openUrl"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "unavailable"
                            },
                            "reason": {
                              "type": "string",
                              "enum": [
                                "dco_scope",
                                "unsoh_period",
                                "not_matched",
                                "ambiguous",
                                "source_unavailable"
                              ]
                            }
                          },
                          "required": [
                            "status",
                            "reason"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "budgetLocationExpenditures": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "location": {
                          "type": "object",
                          "properties": {
                            "stream": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "part": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "part_title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "section": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "section_title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "programme": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "programme_title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "entity": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "subprogramme": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "subprogramme_number": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "stream",
                            "part",
                            "part_title",
                            "section",
                            "section_title",
                            "programme",
                            "programme_title",
                            "entity",
                            "subprogramme",
                            "subprogramme_number"
                          ],
                          "additionalProperties": {}
                        },
                        "expenditure": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "matched"
                                },
                                "amount": {
                                  "type": "number",
                                  "description": "USD expenditure for the entity/location, not allocation to this resolution."
                                },
                                "period": {
                                  "type": "string"
                                },
                                "funding": {
                                  "type": "object",
                                  "properties": {
                                    "regular_budget": {
                                      "type": "number"
                                    },
                                    "other_assessed": {
                                      "type": "number"
                                    },
                                    "extrabudgetary": {
                                      "type": "number"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "nodeIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "sources": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "symbol": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "datasetUrl": {
                                  "type": "string"
                                },
                                "openUrl": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "status",
                                "amount",
                                "period",
                                "funding",
                                "nodeIds",
                                "sources",
                                "datasetUrl",
                                "openUrl"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "unavailable"
                                },
                                "reason": {
                                  "type": "string",
                                  "enum": [
                                    "dco_scope",
                                    "unsoh_period",
                                    "not_matched",
                                    "ambiguous",
                                    "source_unavailable"
                                  ]
                                }
                              },
                              "required": [
                                "status",
                                "reason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "location",
                        "expenditure"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "paragraphs": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "available",
                          "unavailable"
                        ]
                      },
                      "language": {
                        "type": "string",
                        "const": "en"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "position": {
                              "type": "number"
                            },
                            "text": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string",
                              "const": "digitallibrary"
                            },
                            "heading_level": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "paragraph_type": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "paragraph_level": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "prefix": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "links": {
                              "type": "array",
                              "items": {
                                "type": "array",
                                "prefixItems": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ],
                                "items": false,
                                "minItems": 2,
                                "maxItems": 2
                              }
                            }
                          },
                          "required": [
                            "id",
                            "position",
                            "text",
                            "type",
                            "source",
                            "heading_level",
                            "paragraph_type",
                            "paragraph_level",
                            "prefix",
                            "links"
                          ],
                          "additionalProperties": {}
                        }
                      }
                    },
                    "required": [
                      "status",
                      "language",
                      "items"
                    ],
                    "additionalProperties": false
                  },
                  "versionHistory": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "latest_version": {
                            "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "is_collection": {
                            "type": "boolean"
                          },
                          "has_newer": {
                            "type": "boolean"
                          },
                          "is_latest": {
                            "type": "boolean"
                          },
                          "series_count": {
                            "type": "number"
                          },
                          "first_year": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "last_year": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "members": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "document_symbol": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "year": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "is_latest": {
                                  "type": "boolean"
                                },
                                "text_metrics": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                }
                              },
                              "required": [
                                "document_symbol",
                                "title",
                                "year",
                                "is_latest"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "latest_version",
                          "is_collection",
                          "has_newer",
                          "is_latest",
                          "series_count",
                          "first_year",
                          "last_year",
                          "members"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reports": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "not_included"
                          }
                        },
                        "required": [
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "included"
                          },
                          "data": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "source": {
                                    "type": "string",
                                    "const": "catalogue_notes"
                                  },
                                  "reports": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "report_recid": {
                                          "type": "number"
                                        },
                                        "title": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "date_published": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "report_symbol": {
                                          "type": "string"
                                        },
                                        "annex_position_only": {
                                          "type": "boolean"
                                        },
                                        "resolution_symbols": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "annex_resolution_symbols": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "report_recid",
                                        "title",
                                        "date_published",
                                        "report_symbol",
                                        "annex_position_only"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "source",
                                  "reports"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "source": {
                                    "type": "string",
                                    "const": "page_one"
                                  },
                                  "data": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "acceptedRunId": {
                                            "type": "null"
                                          }
                                        },
                                        "required": [
                                          "acceptedRunId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "acceptedRunId": {
                                            "type": "string"
                                          },
                                          "reports": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "report_recid": {
                                                  "type": "number"
                                                },
                                                "title": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "date_published": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "report_symbols": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "resolution_symbols": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                }
                                              },
                                              "required": [
                                                "report_recid",
                                                "title",
                                                "date_published",
                                                "report_symbols"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "acceptedRunId",
                                          "reports"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "source",
                                  "data"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "source": {
                                    "type": "string",
                                    "const": "union"
                                  },
                                  "data": {
                                    "type": "object",
                                    "properties": {
                                      "pageOneAccepted": {
                                        "type": "boolean"
                                      },
                                      "reports": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "report_recid": {
                                              "type": "number"
                                            },
                                            "title": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "date_published": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "symbols": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "provenance": {
                                              "type": "string",
                                              "enum": [
                                                "page_one",
                                                "catalogue_notes",
                                                "both"
                                              ]
                                            },
                                            "catalogueAnnexOnly": {
                                              "type": [
                                                "boolean",
                                                "null"
                                              ]
                                            },
                                            "resolutionLinks": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "symbol": {
                                                    "type": "string"
                                                  },
                                                  "provenance": {
                                                    "type": "string",
                                                    "enum": [
                                                      "page_one",
                                                      "catalogue_notes",
                                                      "both"
                                                    ]
                                                  },
                                                  "catalogueAnnexOnly": {
                                                    "type": [
                                                      "boolean",
                                                      "null"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "symbol",
                                                  "provenance",
                                                  "catalogueAnnexOnly"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "report_recid",
                                            "title",
                                            "date_published",
                                            "symbols",
                                            "provenance",
                                            "catalogueAnnexOnly"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pageOneAccepted",
                                      "reports"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "source",
                                  "data"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "status",
                          "data"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "relatedDocuments": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "not_included"
                          }
                        },
                        "required": [
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "included"
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            }
                          }
                        },
                        "required": [
                          "status",
                          "items"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "status",
                  "citations",
                  "budgetLocations",
                  "foundationalEntities",
                  "entityCitationTotals",
                  "entityExpenditures",
                  "budgetLocationExpenditures",
                  "paragraphs",
                  "versionHistory",
                  "reports",
                  "relatedDocuments"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "symbol",
          "title",
          "issuingBody",
          "year",
          "documentType",
          "subjects",
          "agendaItems",
          "sourceUrl",
          "pageUrl",
          "canonicalUrl",
          "jsonUrl",
          "budgetVersion",
          "matchingCitationCount",
          "matchingEntityCount",
          "matchingEntities",
          "matchingFoundationalEntities",
          "matchingProgrammes",
          "matchingBudgetLocations",
          "series",
          "group",
          "details"
        ],
        "additionalProperties": false
      },
      "DocumentResponse": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "budgetVersion": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "ppb_year": {
                "type": "number"
              },
              "is_default": {
                "type": "boolean"
              },
              "sort_order": {
                "type": "number"
              }
            },
            "required": [
              "slug",
              "display_name",
              "ppb_year",
              "is_default",
              "sort_order"
            ],
            "additionalProperties": false
          },
          "coverage": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "document": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "issuingBody": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "year": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "documentType": {
                "type": "string"
              },
              "subjects": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "agendaItems": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "numbers",
                  "titles"
                ],
                "additionalProperties": false
              },
              "sourceUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "pageUrl": {
                "type": "string"
              },
              "canonicalUrl": {
                "type": "string"
              },
              "jsonUrl": {
                "type": "string"
              },
              "budgetVersion": {
                "type": "string"
              },
              "matchingCitationCount": {
                "type": "number"
              },
              "matchingEntityCount": {
                "type": "number"
              },
              "matchingEntities": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "matchingFoundationalEntities": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "matchingProgrammes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "matchingBudgetLocations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "part": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "part_title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "section": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "section_title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "programme": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "programme_title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "entity": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subprogramme": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subprogramme_number": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "stream",
                    "part",
                    "part_title",
                    "section",
                    "section_title",
                    "programme",
                    "programme_title",
                    "entity",
                    "subprogramme",
                    "subprogramme_number"
                  ],
                  "additionalProperties": {}
                }
              },
              "series": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "latest_version": {
                        "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "is_collection": {
                        "type": "boolean"
                      },
                      "has_newer": {
                        "type": "boolean"
                      },
                      "is_latest": {
                        "type": "boolean"
                      },
                      "series_count": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "latest_version",
                      "is_collection",
                      "has_newer",
                      "is_latest",
                      "series_count"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "group": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "size": {
                        "type": "number"
                      },
                      "min_year": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "max_year": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "members": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "symbol": {
                              "type": "string"
                            },
                            "year": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "symbol",
                            "year",
                            "title"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "size",
                      "min_year",
                      "max_year",
                      "members"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "details": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "not_included"
                      }
                    },
                    "required": [
                      "status"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "included"
                      },
                      "citations": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "origin_document": {
                              "type": "string"
                            },
                            "entity": {
                              "type": "string"
                            },
                            "entity_long": {
                              "type": "string"
                            },
                            "budget_part": {
                              "type": "string"
                            },
                            "budget_part_number": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "budget_part_title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "section": {
                              "type": "string"
                            },
                            "section_title": {
                              "type": "string"
                            },
                            "programme": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "programme_title": {
                              "type": "string"
                            },
                            "sub-programme": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sub_programme_number": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "sub_programme_title": {
                              "description": "Title or an unnumbered source label, such as All Subprogrammes. The original combined label is retained in sub-programme.",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "component": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "description": {
                              "type": "string"
                            },
                            "part_in_document": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "origin_document",
                            "entity",
                            "entity_long",
                            "budget_part",
                            "budget_part_number",
                            "budget_part_title",
                            "section",
                            "section_title",
                            "programme",
                            "programme_title",
                            "sub-programme",
                            "sub_programme_number",
                            "sub_programme_title",
                            "component",
                            "description",
                            "part_in_document"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "budgetLocations": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "stream": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "part": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "part_title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "section": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "section_title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "programme": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "programme_title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "entity": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "subprogramme": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "subprogramme_number": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "stream",
                            "part",
                            "part_title",
                            "section",
                            "section_title",
                            "programme",
                            "programme_title",
                            "entity",
                            "subprogramme",
                            "subprogramme_number"
                          ],
                          "additionalProperties": {}
                        }
                      },
                      "foundationalEntities": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "entityCitationTotals": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "number"
                        }
                      },
                      "entityExpenditures": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "matched"
                                },
                                "amount": {
                                  "type": "number",
                                  "description": "USD expenditure for the entity/location, not allocation to this resolution."
                                },
                                "period": {
                                  "type": "string"
                                },
                                "funding": {
                                  "type": "object",
                                  "properties": {
                                    "regular_budget": {
                                      "type": "number"
                                    },
                                    "other_assessed": {
                                      "type": "number"
                                    },
                                    "extrabudgetary": {
                                      "type": "number"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "nodeIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "sources": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "symbol": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "datasetUrl": {
                                  "type": "string"
                                },
                                "openUrl": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "status",
                                "amount",
                                "period",
                                "funding",
                                "nodeIds",
                                "sources",
                                "datasetUrl",
                                "openUrl"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "unavailable"
                                },
                                "reason": {
                                  "type": "string",
                                  "enum": [
                                    "dco_scope",
                                    "unsoh_period",
                                    "not_matched",
                                    "ambiguous",
                                    "source_unavailable"
                                  ]
                                }
                              },
                              "required": [
                                "status",
                                "reason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "budgetLocationExpenditures": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "location": {
                              "type": "object",
                              "properties": {
                                "stream": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "part": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "part_title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "section": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "section_title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "programme": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "programme_title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "entity": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "subprogramme": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "subprogramme_number": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "stream",
                                "part",
                                "part_title",
                                "section",
                                "section_title",
                                "programme",
                                "programme_title",
                                "entity",
                                "subprogramme",
                                "subprogramme_number"
                              ],
                              "additionalProperties": {}
                            },
                            "expenditure": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "status": {
                                      "type": "string",
                                      "const": "matched"
                                    },
                                    "amount": {
                                      "type": "number",
                                      "description": "USD expenditure for the entity/location, not allocation to this resolution."
                                    },
                                    "period": {
                                      "type": "string"
                                    },
                                    "funding": {
                                      "type": "object",
                                      "properties": {
                                        "regular_budget": {
                                          "type": "number"
                                        },
                                        "other_assessed": {
                                          "type": "number"
                                        },
                                        "extrabudgetary": {
                                          "type": "number"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "nodeIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "sources": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "symbol": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "datasetUrl": {
                                      "type": "string"
                                    },
                                    "openUrl": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "status",
                                    "amount",
                                    "period",
                                    "funding",
                                    "nodeIds",
                                    "sources",
                                    "datasetUrl",
                                    "openUrl"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "status": {
                                      "type": "string",
                                      "const": "unavailable"
                                    },
                                    "reason": {
                                      "type": "string",
                                      "enum": [
                                        "dco_scope",
                                        "unsoh_period",
                                        "not_matched",
                                        "ambiguous",
                                        "source_unavailable"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "status",
                                    "reason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "location",
                            "expenditure"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "paragraphs": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "enum": [
                              "available",
                              "unavailable"
                            ]
                          },
                          "language": {
                            "type": "string",
                            "const": "en"
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "position": {
                                  "type": "number"
                                },
                                "text": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "source": {
                                  "type": "string",
                                  "const": "digitallibrary"
                                },
                                "heading_level": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "paragraph_type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "paragraph_level": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "prefix": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "links": {
                                  "type": "array",
                                  "items": {
                                    "type": "array",
                                    "prefixItems": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ],
                                    "items": false,
                                    "minItems": 2,
                                    "maxItems": 2
                                  }
                                }
                              },
                              "required": [
                                "id",
                                "position",
                                "text",
                                "type",
                                "source",
                                "heading_level",
                                "paragraph_type",
                                "paragraph_level",
                                "prefix",
                                "links"
                              ],
                              "additionalProperties": {}
                            }
                          }
                        },
                        "required": [
                          "status",
                          "language",
                          "items"
                        ],
                        "additionalProperties": false
                      },
                      "versionHistory": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "latest_version": {
                                "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "is_collection": {
                                "type": "boolean"
                              },
                              "has_newer": {
                                "type": "boolean"
                              },
                              "is_latest": {
                                "type": "boolean"
                              },
                              "series_count": {
                                "type": "number"
                              },
                              "first_year": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "last_year": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "members": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "document_symbol": {
                                      "type": "string"
                                    },
                                    "title": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "year": {
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    },
                                    "is_latest": {
                                      "type": "boolean"
                                    },
                                    "text_metrics": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    }
                                  },
                                  "required": [
                                    "document_symbol",
                                    "title",
                                    "year",
                                    "is_latest"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "latest_version",
                              "is_collection",
                              "has_newer",
                              "is_latest",
                              "series_count",
                              "first_year",
                              "last_year",
                              "members"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "reports": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "not_included"
                              }
                            },
                            "required": [
                              "status"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "included"
                              },
                              "data": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "source": {
                                        "type": "string",
                                        "const": "catalogue_notes"
                                      },
                                      "reports": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "report_recid": {
                                              "type": "number"
                                            },
                                            "title": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "date_published": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "report_symbol": {
                                              "type": "string"
                                            },
                                            "annex_position_only": {
                                              "type": "boolean"
                                            },
                                            "resolution_symbols": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "annex_resolution_symbols": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            }
                                          },
                                          "required": [
                                            "report_recid",
                                            "title",
                                            "date_published",
                                            "report_symbol",
                                            "annex_position_only"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "source",
                                      "reports"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "source": {
                                        "type": "string",
                                        "const": "page_one"
                                      },
                                      "data": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "acceptedRunId": {
                                                "type": "null"
                                              }
                                            },
                                            "required": [
                                              "acceptedRunId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "acceptedRunId": {
                                                "type": "string"
                                              },
                                              "reports": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "report_recid": {
                                                      "type": "number"
                                                    },
                                                    "title": {
                                                      "type": [
                                                        "string",
                                                        "null"
                                                      ]
                                                    },
                                                    "date_published": {
                                                      "type": [
                                                        "string",
                                                        "null"
                                                      ]
                                                    },
                                                    "report_symbols": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "resolution_symbols": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "report_recid",
                                                    "title",
                                                    "date_published",
                                                    "report_symbols"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "acceptedRunId",
                                              "reports"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "source",
                                      "data"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "source": {
                                        "type": "string",
                                        "const": "union"
                                      },
                                      "data": {
                                        "type": "object",
                                        "properties": {
                                          "pageOneAccepted": {
                                            "type": "boolean"
                                          },
                                          "reports": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "report_recid": {
                                                  "type": "number"
                                                },
                                                "title": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "date_published": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "symbols": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "provenance": {
                                                  "type": "string",
                                                  "enum": [
                                                    "page_one",
                                                    "catalogue_notes",
                                                    "both"
                                                  ]
                                                },
                                                "catalogueAnnexOnly": {
                                                  "type": [
                                                    "boolean",
                                                    "null"
                                                  ]
                                                },
                                                "resolutionLinks": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "symbol": {
                                                        "type": "string"
                                                      },
                                                      "provenance": {
                                                        "type": "string",
                                                        "enum": [
                                                          "page_one",
                                                          "catalogue_notes",
                                                          "both"
                                                        ]
                                                      },
                                                      "catalogueAnnexOnly": {
                                                        "type": [
                                                          "boolean",
                                                          "null"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "symbol",
                                                      "provenance",
                                                      "catalogueAnnexOnly"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                }
                                              },
                                              "required": [
                                                "report_recid",
                                                "title",
                                                "date_published",
                                                "symbols",
                                                "provenance",
                                                "catalogueAnnexOnly"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pageOneAccepted",
                                          "reports"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "source",
                                      "data"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "status",
                              "data"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "relatedDocuments": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "not_included"
                              }
                            },
                            "required": [
                              "status"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "included"
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                }
                              }
                            },
                            "required": [
                              "status",
                              "items"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "required": [
                      "status",
                      "citations",
                      "budgetLocations",
                      "foundationalEntities",
                      "entityCitationTotals",
                      "entityExpenditures",
                      "budgetLocationExpenditures",
                      "paragraphs",
                      "versionHistory",
                      "reports",
                      "relatedDocuments"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "symbol",
              "title",
              "issuingBody",
              "year",
              "documentType",
              "subjects",
              "agendaItems",
              "sourceUrl",
              "pageUrl",
              "canonicalUrl",
              "jsonUrl",
              "budgetVersion",
              "matchingCitationCount",
              "matchingEntityCount",
              "matchingEntities",
              "matchingFoundationalEntities",
              "matchingProgrammes",
              "matchingBudgetLocations",
              "series",
              "group",
              "details"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "apiVersion",
          "budgetVersion",
          "coverage",
          "document"
        ],
        "additionalProperties": false
      },
      "DocumentList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "budgetVersion": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "ppb_year": {
                "type": "number"
              },
              "is_default": {
                "type": "boolean"
              },
              "sort_order": {
                "type": "number"
              }
            },
            "required": [
              "slug",
              "display_name",
              "ppb_year",
              "is_default",
              "sort_order"
            ],
            "additionalProperties": false
          },
          "coverage": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "symbol": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "issuingBody": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "year": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "documentType": {
                  "type": "string"
                },
                "subjects": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "agendaItems": {
                  "type": "object",
                  "properties": {
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "titles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "numbers",
                    "titles"
                  ],
                  "additionalProperties": false
                },
                "sourceUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "pageUrl": {
                  "type": "string"
                },
                "canonicalUrl": {
                  "type": "string"
                },
                "jsonUrl": {
                  "type": "string"
                },
                "budgetVersion": {
                  "type": "string"
                },
                "matchingCitationCount": {
                  "type": "number"
                },
                "matchingEntityCount": {
                  "type": "number"
                },
                "matchingEntities": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "matchingFoundationalEntities": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "matchingProgrammes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "matchingBudgetLocations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "stream": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "part": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "part_title": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "section": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "section_title": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "programme": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "programme_title": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "entity": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "subprogramme": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "subprogramme_number": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "stream",
                      "part",
                      "part_title",
                      "section",
                      "section_title",
                      "programme",
                      "programme_title",
                      "entity",
                      "subprogramme",
                      "subprogramme_number"
                    ],
                    "additionalProperties": {}
                  }
                },
                "series": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "latest_version": {
                          "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "is_collection": {
                          "type": "boolean"
                        },
                        "has_newer": {
                          "type": "boolean"
                        },
                        "is_latest": {
                          "type": "boolean"
                        },
                        "series_count": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "latest_version",
                        "is_collection",
                        "has_newer",
                        "is_latest",
                        "series_count"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "group": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "size": {
                          "type": "number"
                        },
                        "min_year": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "max_year": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "members": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              },
                              "year": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "symbol",
                              "year",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "size",
                        "min_year",
                        "max_year",
                        "members"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "details": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "not_included"
                        }
                      },
                      "required": [
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "included"
                        },
                        "citations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "origin_document": {
                                "type": "string"
                              },
                              "entity": {
                                "type": "string"
                              },
                              "entity_long": {
                                "type": "string"
                              },
                              "budget_part": {
                                "type": "string"
                              },
                              "budget_part_number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "budget_part_title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "section": {
                                "type": "string"
                              },
                              "section_title": {
                                "type": "string"
                              },
                              "programme": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "programme_title": {
                                "type": "string"
                              },
                              "sub-programme": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sub_programme_number": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "sub_programme_title": {
                                "description": "Title or an unnumbered source label, such as All Subprogrammes. The original combined label is retained in sub-programme.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "component": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "description": {
                                "type": "string"
                              },
                              "part_in_document": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "origin_document",
                              "entity",
                              "entity_long",
                              "budget_part",
                              "budget_part_number",
                              "budget_part_title",
                              "section",
                              "section_title",
                              "programme",
                              "programme_title",
                              "sub-programme",
                              "sub_programme_number",
                              "sub_programme_title",
                              "component",
                              "description",
                              "part_in_document"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "budgetLocations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "stream": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "part": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "part_title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "section": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "section_title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "programme": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "programme_title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "entity": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "subprogramme": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "subprogramme_number": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "stream",
                              "part",
                              "part_title",
                              "section",
                              "section_title",
                              "programme",
                              "programme_title",
                              "entity",
                              "subprogramme",
                              "subprogramme_number"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "foundationalEntities": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "entityCitationTotals": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "number"
                          }
                        },
                        "entityExpenditures": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "const": "matched"
                                  },
                                  "amount": {
                                    "type": "number",
                                    "description": "USD expenditure for the entity/location, not allocation to this resolution."
                                  },
                                  "period": {
                                    "type": "string"
                                  },
                                  "funding": {
                                    "type": "object",
                                    "properties": {
                                      "regular_budget": {
                                        "type": "number"
                                      },
                                      "other_assessed": {
                                        "type": "number"
                                      },
                                      "extrabudgetary": {
                                        "type": "number"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "nodeIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "sources": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "symbol": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "datasetUrl": {
                                    "type": "string"
                                  },
                                  "openUrl": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "status",
                                  "amount",
                                  "period",
                                  "funding",
                                  "nodeIds",
                                  "sources",
                                  "datasetUrl",
                                  "openUrl"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "const": "unavailable"
                                  },
                                  "reason": {
                                    "type": "string",
                                    "enum": [
                                      "dco_scope",
                                      "unsoh_period",
                                      "not_matched",
                                      "ambiguous",
                                      "source_unavailable"
                                    ]
                                  }
                                },
                                "required": [
                                  "status",
                                  "reason"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "budgetLocationExpenditures": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "location": {
                                "type": "object",
                                "properties": {
                                  "stream": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "part": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "part_title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "section": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "section_title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "programme": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "programme_title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "entity": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "subprogramme": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "subprogramme_number": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "stream",
                                  "part",
                                  "part_title",
                                  "section",
                                  "section_title",
                                  "programme",
                                  "programme_title",
                                  "entity",
                                  "subprogramme",
                                  "subprogramme_number"
                                ],
                                "additionalProperties": {}
                              },
                              "expenditure": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "status": {
                                        "type": "string",
                                        "const": "matched"
                                      },
                                      "amount": {
                                        "type": "number",
                                        "description": "USD expenditure for the entity/location, not allocation to this resolution."
                                      },
                                      "period": {
                                        "type": "string"
                                      },
                                      "funding": {
                                        "type": "object",
                                        "properties": {
                                          "regular_budget": {
                                            "type": "number"
                                          },
                                          "other_assessed": {
                                            "type": "number"
                                          },
                                          "extrabudgetary": {
                                            "type": "number"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "nodeIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "sources": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "symbol": {
                                              "type": "string"
                                            },
                                            "url": {
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "datasetUrl": {
                                        "type": "string"
                                      },
                                      "openUrl": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "status",
                                      "amount",
                                      "period",
                                      "funding",
                                      "nodeIds",
                                      "sources",
                                      "datasetUrl",
                                      "openUrl"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "status": {
                                        "type": "string",
                                        "const": "unavailable"
                                      },
                                      "reason": {
                                        "type": "string",
                                        "enum": [
                                          "dco_scope",
                                          "unsoh_period",
                                          "not_matched",
                                          "ambiguous",
                                          "source_unavailable"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "status",
                                      "reason"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "location",
                              "expenditure"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "paragraphs": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "available",
                                "unavailable"
                              ]
                            },
                            "language": {
                              "type": "string",
                              "const": "en"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "position": {
                                    "type": "number"
                                  },
                                  "text": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "type": "string",
                                    "const": "digitallibrary"
                                  },
                                  "heading_level": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "paragraph_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "paragraph_level": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "prefix": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "links": {
                                    "type": "array",
                                    "items": {
                                      "type": "array",
                                      "prefixItems": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "string"
                                        }
                                      ],
                                      "items": false,
                                      "minItems": 2,
                                      "maxItems": 2
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "position",
                                  "text",
                                  "type",
                                  "source",
                                  "heading_level",
                                  "paragraph_type",
                                  "paragraph_level",
                                  "prefix",
                                  "links"
                                ],
                                "additionalProperties": {}
                              }
                            }
                          },
                          "required": [
                            "status",
                            "language",
                            "items"
                          ],
                          "additionalProperties": false
                        },
                        "versionHistory": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "latest_version": {
                                  "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "is_collection": {
                                  "type": "boolean"
                                },
                                "has_newer": {
                                  "type": "boolean"
                                },
                                "is_latest": {
                                  "type": "boolean"
                                },
                                "series_count": {
                                  "type": "number"
                                },
                                "first_year": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "last_year": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "members": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "document_symbol": {
                                        "type": "string"
                                      },
                                      "title": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "year": {
                                        "type": [
                                          "number",
                                          "null"
                                        ]
                                      },
                                      "is_latest": {
                                        "type": "boolean"
                                      },
                                      "text_metrics": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      }
                                    },
                                    "required": [
                                      "document_symbol",
                                      "title",
                                      "year",
                                      "is_latest"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "latest_version",
                                "is_collection",
                                "has_newer",
                                "is_latest",
                                "series_count",
                                "first_year",
                                "last_year",
                                "members"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reports": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "not_included"
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "included"
                                },
                                "data": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "source": {
                                          "type": "string",
                                          "const": "catalogue_notes"
                                        },
                                        "reports": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "report_recid": {
                                                "type": "number"
                                              },
                                              "title": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              },
                                              "date_published": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              },
                                              "report_symbol": {
                                                "type": "string"
                                              },
                                              "annex_position_only": {
                                                "type": "boolean"
                                              },
                                              "resolution_symbols": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "annex_resolution_symbols": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              }
                                            },
                                            "required": [
                                              "report_recid",
                                              "title",
                                              "date_published",
                                              "report_symbol",
                                              "annex_position_only"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "source",
                                        "reports"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "source": {
                                          "type": "string",
                                          "const": "page_one"
                                        },
                                        "data": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "acceptedRunId": {
                                                  "type": "null"
                                                }
                                              },
                                              "required": [
                                                "acceptedRunId"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "acceptedRunId": {
                                                  "type": "string"
                                                },
                                                "reports": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "report_recid": {
                                                        "type": "number"
                                                      },
                                                      "title": {
                                                        "type": [
                                                          "string",
                                                          "null"
                                                        ]
                                                      },
                                                      "date_published": {
                                                        "type": [
                                                          "string",
                                                          "null"
                                                        ]
                                                      },
                                                      "report_symbols": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "resolution_symbols": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string"
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "report_recid",
                                                      "title",
                                                      "date_published",
                                                      "report_symbols"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                }
                                              },
                                              "required": [
                                                "acceptedRunId",
                                                "reports"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "source",
                                        "data"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "source": {
                                          "type": "string",
                                          "const": "union"
                                        },
                                        "data": {
                                          "type": "object",
                                          "properties": {
                                            "pageOneAccepted": {
                                              "type": "boolean"
                                            },
                                            "reports": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "report_recid": {
                                                    "type": "number"
                                                  },
                                                  "title": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  },
                                                  "date_published": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  },
                                                  "symbols": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "provenance": {
                                                    "type": "string",
                                                    "enum": [
                                                      "page_one",
                                                      "catalogue_notes",
                                                      "both"
                                                    ]
                                                  },
                                                  "catalogueAnnexOnly": {
                                                    "type": [
                                                      "boolean",
                                                      "null"
                                                    ]
                                                  },
                                                  "resolutionLinks": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "object",
                                                      "properties": {
                                                        "symbol": {
                                                          "type": "string"
                                                        },
                                                        "provenance": {
                                                          "type": "string",
                                                          "enum": [
                                                            "page_one",
                                                            "catalogue_notes",
                                                            "both"
                                                          ]
                                                        },
                                                        "catalogueAnnexOnly": {
                                                          "type": [
                                                            "boolean",
                                                            "null"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "symbol",
                                                        "provenance",
                                                        "catalogueAnnexOnly"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "report_recid",
                                                  "title",
                                                  "date_published",
                                                  "symbols",
                                                  "provenance",
                                                  "catalogueAnnexOnly"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "pageOneAccepted",
                                            "reports"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "source",
                                        "data"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "status",
                                "data"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "relatedDocuments": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "not_included"
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "const": "included"
                                },
                                "items": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  }
                                }
                              },
                              "required": [
                                "status",
                                "items"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "status",
                        "citations",
                        "budgetLocations",
                        "foundationalEntities",
                        "entityCitationTotals",
                        "entityExpenditures",
                        "budgetLocationExpenditures",
                        "paragraphs",
                        "versionHistory",
                        "reports",
                        "relatedDocuments"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "symbol",
                "title",
                "issuingBody",
                "year",
                "documentType",
                "subjects",
                "agendaItems",
                "sourceUrl",
                "pageUrl",
                "canonicalUrl",
                "jsonUrl",
                "budgetVersion",
                "matchingCitationCount",
                "matchingEntityCount",
                "matchingEntities",
                "matchingFoundationalEntities",
                "matchingProgrammes",
                "matchingBudgetLocations",
                "series",
                "group",
                "details"
              ],
              "additionalProperties": false
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "page": {
                "type": "number"
              },
              "pageSize": {
                "type": "number"
              },
              "total": {
                "type": "number"
              },
              "hasMore": {
                "type": "boolean"
              }
            },
            "required": [
              "page",
              "pageSize",
              "total",
              "hasMore"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "apiVersion",
          "budgetVersion",
          "coverage",
          "items",
          "pagination"
        ],
        "additionalProperties": false
      },
      "DocumentDetails": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "included"
          },
          "citations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "origin_document": {
                  "type": "string"
                },
                "entity": {
                  "type": "string"
                },
                "entity_long": {
                  "type": "string"
                },
                "budget_part": {
                  "type": "string"
                },
                "budget_part_number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "budget_part_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "section": {
                  "type": "string"
                },
                "section_title": {
                  "type": "string"
                },
                "programme": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "programme_title": {
                  "type": "string"
                },
                "sub-programme": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sub_programme_number": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "sub_programme_title": {
                  "description": "Title or an unnumbered source label, such as All Subprogrammes. The original combined label is retained in sub-programme.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "component": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "part_in_document": {
                  "type": "string"
                }
              },
              "required": [
                "origin_document",
                "entity",
                "entity_long",
                "budget_part",
                "budget_part_number",
                "budget_part_title",
                "section",
                "section_title",
                "programme",
                "programme_title",
                "sub-programme",
                "sub_programme_number",
                "sub_programme_title",
                "component",
                "description",
                "part_in_document"
              ],
              "additionalProperties": false
            }
          },
          "budgetLocations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "stream": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "part": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "part_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "section": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "section_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "programme": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "programme_title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "entity": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "subprogramme": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "subprogramme_number": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "stream",
                "part",
                "part_title",
                "section",
                "section_title",
                "programme",
                "programme_title",
                "entity",
                "subprogramme",
                "subprogramme_number"
              ],
              "additionalProperties": {}
            }
          },
          "foundationalEntities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entityCitationTotals": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "number"
            }
          },
          "entityExpenditures": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "matched"
                    },
                    "amount": {
                      "type": "number",
                      "description": "USD expenditure for the entity/location, not allocation to this resolution."
                    },
                    "period": {
                      "type": "string"
                    },
                    "funding": {
                      "type": "object",
                      "properties": {
                        "regular_budget": {
                          "type": "number"
                        },
                        "other_assessed": {
                          "type": "number"
                        },
                        "extrabudgetary": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "nodeIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "symbol": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "datasetUrl": {
                      "type": "string"
                    },
                    "openUrl": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "amount",
                    "period",
                    "funding",
                    "nodeIds",
                    "sources",
                    "datasetUrl",
                    "openUrl"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "unavailable"
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "dco_scope",
                        "unsoh_period",
                        "not_matched",
                        "ambiguous",
                        "source_unavailable"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "budgetLocationExpenditures": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "location": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "part": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "part_title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "section": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "section_title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "programme": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "programme_title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "entity": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subprogramme": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subprogramme_number": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "stream",
                    "part",
                    "part_title",
                    "section",
                    "section_title",
                    "programme",
                    "programme_title",
                    "entity",
                    "subprogramme",
                    "subprogramme_number"
                  ],
                  "additionalProperties": {}
                },
                "expenditure": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "matched"
                        },
                        "amount": {
                          "type": "number",
                          "description": "USD expenditure for the entity/location, not allocation to this resolution."
                        },
                        "period": {
                          "type": "string"
                        },
                        "funding": {
                          "type": "object",
                          "properties": {
                            "regular_budget": {
                              "type": "number"
                            },
                            "other_assessed": {
                              "type": "number"
                            },
                            "extrabudgetary": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        "nodeIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "datasetUrl": {
                          "type": "string"
                        },
                        "openUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "status",
                        "amount",
                        "period",
                        "funding",
                        "nodeIds",
                        "sources",
                        "datasetUrl",
                        "openUrl"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "unavailable"
                        },
                        "reason": {
                          "type": "string",
                          "enum": [
                            "dco_scope",
                            "unsoh_period",
                            "not_matched",
                            "ambiguous",
                            "source_unavailable"
                          ]
                        }
                      },
                      "required": [
                        "status",
                        "reason"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "location",
                "expenditure"
              ],
              "additionalProperties": false
            }
          },
          "paragraphs": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "unavailable"
                ]
              },
              "language": {
                "type": "string",
                "const": "en"
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "position": {
                      "type": "number"
                    },
                    "text": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "const": "digitallibrary"
                    },
                    "heading_level": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "paragraph_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "paragraph_level": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "prefix": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "prefixItems": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "string"
                          }
                        ],
                        "items": false,
                        "minItems": 2,
                        "maxItems": 2
                      }
                    }
                  },
                  "required": [
                    "id",
                    "position",
                    "text",
                    "type",
                    "source",
                    "heading_level",
                    "paragraph_type",
                    "paragraph_level",
                    "prefix",
                    "links"
                  ],
                  "additionalProperties": {}
                }
              }
            },
            "required": [
              "status",
              "language",
              "items"
            ],
            "additionalProperties": false
          },
          "versionHistory": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "latest_version": {
                    "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "is_collection": {
                    "type": "boolean"
                  },
                  "has_newer": {
                    "type": "boolean"
                  },
                  "is_latest": {
                    "type": "boolean"
                  },
                  "series_count": {
                    "type": "number"
                  },
                  "first_year": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "last_year": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "members": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "document_symbol": {
                          "type": "string"
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "year": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "is_latest": {
                          "type": "boolean"
                        },
                        "text_metrics": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "document_symbol",
                        "title",
                        "year",
                        "is_latest"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "latest_version",
                  "is_collection",
                  "has_newer",
                  "is_latest",
                  "series_count",
                  "first_year",
                  "last_year",
                  "members"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "reports": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "not_included"
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "included"
                  },
                  "data": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "source": {
                            "type": "string",
                            "const": "catalogue_notes"
                          },
                          "reports": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "report_recid": {
                                  "type": "number"
                                },
                                "title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "date_published": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "report_symbol": {
                                  "type": "string"
                                },
                                "annex_position_only": {
                                  "type": "boolean"
                                },
                                "resolution_symbols": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "annex_resolution_symbols": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "report_recid",
                                "title",
                                "date_published",
                                "report_symbol",
                                "annex_position_only"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "source",
                          "reports"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "source": {
                            "type": "string",
                            "const": "page_one"
                          },
                          "data": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "acceptedRunId": {
                                    "type": "null"
                                  }
                                },
                                "required": [
                                  "acceptedRunId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "acceptedRunId": {
                                    "type": "string"
                                  },
                                  "reports": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "report_recid": {
                                          "type": "number"
                                        },
                                        "title": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "date_published": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "report_symbols": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "resolution_symbols": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "report_recid",
                                        "title",
                                        "date_published",
                                        "report_symbols"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "acceptedRunId",
                                  "reports"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "source",
                          "data"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "source": {
                            "type": "string",
                            "const": "union"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "pageOneAccepted": {
                                "type": "boolean"
                              },
                              "reports": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "report_recid": {
                                      "type": "number"
                                    },
                                    "title": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "date_published": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "symbols": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "provenance": {
                                      "type": "string",
                                      "enum": [
                                        "page_one",
                                        "catalogue_notes",
                                        "both"
                                      ]
                                    },
                                    "catalogueAnnexOnly": {
                                      "type": [
                                        "boolean",
                                        "null"
                                      ]
                                    },
                                    "resolutionLinks": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "symbol": {
                                            "type": "string"
                                          },
                                          "provenance": {
                                            "type": "string",
                                            "enum": [
                                              "page_one",
                                              "catalogue_notes",
                                              "both"
                                            ]
                                          },
                                          "catalogueAnnexOnly": {
                                            "type": [
                                              "boolean",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "symbol",
                                          "provenance",
                                          "catalogueAnnexOnly"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "report_recid",
                                    "title",
                                    "date_published",
                                    "symbols",
                                    "provenance",
                                    "catalogueAnnexOnly"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "pageOneAccepted",
                              "reports"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "source",
                          "data"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "status",
                  "data"
                ],
                "additionalProperties": false
              }
            ]
          },
          "relatedDocuments": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "not_included"
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "included"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    }
                  }
                },
                "required": [
                  "status",
                  "items"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "status",
          "citations",
          "budgetLocations",
          "foundationalEntities",
          "entityCitationTotals",
          "entityExpenditures",
          "budgetLocationExpenditures",
          "paragraphs",
          "versionHistory",
          "reports",
          "relatedDocuments"
        ],
        "additionalProperties": false
      },
      "Paragraph": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "type": "number"
          },
          "text": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "const": "digitallibrary"
          },
          "heading_level": {
            "type": [
              "number",
              "null"
            ]
          },
          "paragraph_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "paragraph_level": {
            "type": [
              "number",
              "null"
            ]
          },
          "prefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "items": false,
              "minItems": 2,
              "maxItems": 2
            }
          }
        },
        "required": [
          "id",
          "position",
          "text",
          "type",
          "source",
          "heading_level",
          "paragraph_type",
          "paragraph_level",
          "prefix",
          "links"
        ],
        "additionalProperties": {}
      },
      "BudgetCitation": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "origin_document": {
            "type": "string"
          },
          "entity": {
            "type": "string"
          },
          "entity_long": {
            "type": "string"
          },
          "budget_part": {
            "type": "string"
          },
          "budget_part_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "budget_part_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "section": {
            "type": "string"
          },
          "section_title": {
            "type": "string"
          },
          "programme": {
            "type": [
              "number",
              "null"
            ]
          },
          "programme_title": {
            "type": "string"
          },
          "sub-programme": {
            "type": [
              "string",
              "null"
            ]
          },
          "sub_programme_number": {
            "type": [
              "number",
              "null"
            ]
          },
          "sub_programme_title": {
            "description": "Title or an unnumbered source label, such as All Subprogrammes. The original combined label is retained in sub-programme.",
            "type": [
              "string",
              "null"
            ]
          },
          "component": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "part_in_document": {
            "type": "string"
          }
        },
        "required": [
          "origin_document",
          "entity",
          "entity_long",
          "budget_part",
          "budget_part_number",
          "budget_part_title",
          "section",
          "section_title",
          "programme",
          "programme_title",
          "sub-programme",
          "sub_programme_number",
          "sub_programme_title",
          "component",
          "description",
          "part_in_document"
        ],
        "additionalProperties": false
      },
      "VersionHistory": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "latest_version": {
            "description": "Latest version symbol when a unique ordered version is known; null for collections or ambiguous series.",
            "type": [
              "string",
              "null"
            ]
          },
          "is_collection": {
            "type": "boolean"
          },
          "has_newer": {
            "type": "boolean"
          },
          "is_latest": {
            "type": "boolean"
          },
          "series_count": {
            "type": "number"
          },
          "first_year": {
            "type": [
              "number",
              "null"
            ]
          },
          "last_year": {
            "type": [
              "number",
              "null"
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "document_symbol": {
                  "type": "string"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "year": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "is_latest": {
                  "type": "boolean"
                },
                "text_metrics": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              },
              "required": [
                "document_symbol",
                "title",
                "year",
                "is_latest"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "latest_version",
          "is_collection",
          "has_newer",
          "is_latest",
          "series_count",
          "first_year",
          "last_year",
          "members"
        ],
        "additionalProperties": false
      },
      "AgendaResponse": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "empty"
            ]
          },
          "body": {
            "type": "string",
            "enum": [
              "GA",
              "SC",
              "ECOSOC",
              "HRC"
            ]
          },
          "sessions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "session": {
            "type": "string"
          },
          "coverage": {
            "type": "string",
            "enum": [
              "complete",
              "partial"
            ]
          },
          "dataCutoff": {
            "type": "string"
          },
          "resolutionCountsStatus": {
            "type": "string",
            "enum": [
              "ready",
              "unavailable"
            ]
          },
          "relatedCountsStatus": {
            "type": "string",
            "enum": [
              "ready",
              "unavailable"
            ]
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "item": {
                  "type": "string"
                },
                "titles": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "allocations": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "heading": {
                  "type": "string"
                },
                "parentId": {
                  "type": "string"
                },
                "depth": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "scope": {
                  "type": "object",
                  "properties": {
                    "body": {
                      "type": "string",
                      "enum": [
                        "GA",
                        "SC",
                        "ECOSOC",
                        "HRC"
                      ]
                    },
                    "session": {
                      "type": "string"
                    },
                    "item": {
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "body",
                    "session",
                    "item",
                    "items"
                  ],
                  "additionalProperties": false,
                  "description": "Serialize this object as the agenda_scope document-search parameter."
                },
                "meetingCount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "resolutionCount": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Null means the count is unavailable; zero is a known empty result. Counts include the item subtree."
                },
                "titleDifferences": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "relatedItems": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "href": {
                        "type": "string"
                      },
                      "members": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "body": {
                              "type": "string",
                              "enum": [
                                "GA",
                                "SC",
                                "ECOSOC",
                                "HRC"
                              ]
                            },
                            "title": {
                              "type": "string"
                            },
                            "current": {
                              "type": "boolean"
                            },
                            "occurrences": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "session": {
                                    "type": "string"
                                  },
                                  "item": {
                                    "type": "string"
                                  },
                                  "resolutionCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "verified",
                                      "unsupported"
                                    ]
                                  },
                                  "reason": {
                                    "type": "string"
                                  },
                                  "href": {
                                    "type": "string"
                                  },
                                  "referenceNote": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "session",
                                  "item",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "id",
                            "body",
                            "title",
                            "current",
                            "occurrences"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "id",
                      "title",
                      "members"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "item",
                "titles",
                "allocations",
                "heading",
                "depth",
                "scope",
                "resolutionCount",
                "titleDifferences",
                "relatedItems"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "apiVersion",
          "status",
          "body",
          "sessions",
          "nodes"
        ],
        "additionalProperties": false
      },
      "ProgrammeResponse": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "budgetVersion": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "ppb_year": {
                "type": "number"
              },
              "is_default": {
                "type": "boolean"
              },
              "sort_order": {
                "type": "number"
              }
            },
            "required": [
              "slug",
              "display_name",
              "ppb_year",
              "is_default",
              "sort_order"
            ],
            "additionalProperties": false
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "parentId": {
                  "type": "string"
                },
                "depth": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "stream",
                    "part",
                    "section",
                    "group",
                    "entity",
                    "subprogramme",
                    "programme",
                    "component"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Document count for this location, including its subtree."
                },
                "entityCode": {
                  "type": "string"
                },
                "hasChildren": {
                  "type": "boolean"
                },
                "citationAvailable": {
                  "description": "False for official locations without a citation-backed document scope.",
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "depth",
                "kind",
                "label",
                "count",
                "hasChildren"
              ],
              "additionalProperties": false
            }
          },
          "expenditures": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "matched"
                    },
                    "amount": {
                      "type": "number",
                      "description": "USD expenditure for the entity/location, not allocation to this resolution."
                    },
                    "period": {
                      "type": "string"
                    },
                    "funding": {
                      "type": "object",
                      "properties": {
                        "regular_budget": {
                          "type": "number"
                        },
                        "other_assessed": {
                          "type": "number"
                        },
                        "extrabudgetary": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "nodeIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "symbol": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "datasetUrl": {
                      "type": "string"
                    },
                    "openUrl": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "amount",
                    "period",
                    "funding",
                    "nodeIds",
                    "sources",
                    "datasetUrl",
                    "openUrl"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "unavailable"
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "dco_scope",
                        "unsoh_period",
                        "not_matched",
                        "ambiguous",
                        "source_unavailable"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "description": "Expenditure matches keyed by row ID. Amounts describe budget locations, not individual documents. Preserve period, status and provenance."
          },
          "clusters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "nodeIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unsupportedCount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "reason": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "title",
                "nodeIds"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "apiVersion",
          "budgetVersion",
          "rows",
          "expenditures",
          "clusters"
        ],
        "additionalProperties": false
      },
      "Reference": {
        "type": "object",
        "required": [
          "apiVersion",
          "budgetVersion",
          "budgetVersions",
          "entities",
          "organs",
          "programmes"
        ],
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "budgetVersion": {
            "$ref": "#/components/schemas/BudgetVersion"
          },
          "budgetVersions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetVersion"
            }
          },
          "entities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entity": {
                  "type": "string"
                },
                "entity_long": {
                  "type": "string"
                }
              }
            }
          },
          "organs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "programmes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "Export": {
        "type": "object",
        "required": [
          "metadata",
          "documents",
          "exportedDocuments"
        ],
        "properties": {
          "metadata": {
            "type": "object",
            "description": "Generation time, resolved filters/cycle, expected count, grouping, coverage, detail inclusion and live-read consistency note.",
            "additionalProperties": true
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Document"
            }
          },
          "exportedDocuments": {
            "type": "integer",
            "description": "Actual number written; may differ from the initial count if live source data changes."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}
