{
  "openapi": "3.1.0",
  "info": {
    "title": "EU Trade Explorer",
    "description": "\nHTTP REST API for the EU Trade Explorer, serving Eurostat Comext (customs trade) and\nPRODCOM (industrial production) statistics for the Combined Nomenclature.\n\n> Bridge to the tradedashboard.eu EU Trade Explorer — access the same data via REST endpoints or, for LLM agents, via the MCP bridge at mcp.tradedashboard.eu.\n\n## Typical Workflow\n\n1. **Resolve the product**: If you don't already know the right Combined Nomenclature (CN) customs code, use `/api/reference/search` with a keyword (e.g. \"glass jars\") and `/api/reference/validate-customs-code/{customs_code}` for a candidate code. Note that CN nomenclature is often coarser than a colloquial product name: there is no code for \"glass jars\" alone, only a heading (7010) that bundles jars with bottles and closures; check `has_subcodes` and the returned hierarchy before assuming a code is a clean match.\n\n2. **Choose your path**:\n   - **Short path**: Call `/api/descriptive/overview` for the headline totals. For a quick analysis, that plus `/api/descriptive/partner-detail` and `/api/concentration/concentration` is often enough.\n   - **Long path**: There are ~25 analytical endpoints you can call iteratively depending on your angle: drill into `/api/descriptive/reporter-detail`, `/api/concentration/specialisation`, `/api/vulnerability/net-import-reliance`, etc. as needed.\n\n## Request Model\n\nEvery analytical endpoint takes the same `DashboardQuery` JSON body:\n- `customs_code`: Combined Nomenclature code(s) -- one code or a list; each code is one basket over the full requested period\n- `baskets`: the explicit form of the customs-code selection (a list of baskets, each a list of `(customs_code, optional from/to month)` pieces summed into one line) -- use it to clip a code to specific months or to chain successor codes; exactly one of `customs_code` and `baskets`\n- `reporter`: Declaring entity (EU Member State, etc.)\n- `partner_set`: Named partner preset or custom list\n- `period_start`, `period_end`: Analysis window (YYYY-MM format)\n- `frequency`: 'month', 'quarter', or 'year'\n- Plus endpoint-specific query parameters (`entity_level`, `flow`, `partner`, detection thresholds, ...)\n\n## Streaming Responses\n\nThe analytical endpoints under `/api/descriptive`, `/api/concentration`, `/api/volatility`, `/api/vulnerability`, `/api/autonomy` and `/api/production` do not return a single JSON object. They stream newline-delimited JSON (`application/jsonl`): zero or more `{\"type\": \"progress\", \"message\": ...}` lines while Eurostat data loads, then exactly one terminal frame — either `{\"type\": \"result\", \"data\": ...}` or `{\"type\": \"error\", \"detail\": ..., \"status\": ...}`.\n\nMany endpoints also accept a `compact=true` query parameter to condense long numeric time series into summary statistics (first/last/min/max/mean/pct_change) instead of full series. Use this when you just want main trends; omit it when identifying shocks and outliers.\n\n## Authentication & Access\n\nEverything under `/api/reference` and `/api/auth` is public and unlimited.\n\nThe analytical endpoints (`/api/descriptive`, `/api/concentration`,\n`/api/volatility`, `/api/vulnerability`, `/api/autonomy`, `/api/production`)\nrequire registration: anonymous calls for non-demonstration customs codes\nget HTTP 401 with a registration invitation. The only anonymous exception:\nqueries made entirely of the dashboard's welcome-page demonstration\ncustoms codes, which stay fully browsable without an account, on every\nanalytical endpoint.\nRegistering is free and currently unlimited — register once, then\nuse one of:\n- A signed-in session cookie (from the dashboard UI)\n- A personal API key sent as `Authorization: Bearer ...` or `X-API-Key`\n- OAuth 2.1 authentication (for programmatic/headless clients)\n\nSee `/.well-known/oauth-authorization-server` for OAuth setup details. LLM agents and MCP clients should use the MCP bridge at mcp.tradedashboard.eu instead: there, listing the tools is open but every tool call requires an OAuth account (no anonymous demonstration products, no free reference tools).\n\n### Credentials\n\nSessions, personal API keys and OAuth access tokens are accepted. Personal keys and OAuth tokens may read data and configure the account, but may not delete it, issue or revoke credentials, approve apps, or perform financial actions such as paying or cancelling a subscription; those actions require an interactive session. Revoking a personal key, token or connected app takes effect immediately. A password reset ends every existing session, personal key and OAuth credential: afterwards, log in again, create a new API key and reconnect your apps.\n\nRequests are additionally rate-limited per client IP at the edge (Caddy), ahead of this application, and successful analytical responses are edge-cached for 30 minutes -- a cache hit replays instantly and spends no compute.\n\n## Dashboard Navigation\n\nYou typically do not need to construct these API calls yourself if you're using the interactive dashboard. Instead, refer to the relevant menu item/tab on the website. For programmatic access, the dashboard structure is:\n\n| Menu | Name | Tab | Typical API endpoints |\n|------|------|-----|----------------------|\n| `overview` | Overview | `overview`, `report` | `/api/descriptive/overview` |\n| `by-country` | Distribution by country | `partners`, `reporters`, `reporter-benchmark`, `map-imports`, `map-exports` | `/api/descriptive/partner-detail`, `/api/descriptive/reporter-detail`, `/api/descriptive/reporter-benchmark`, `/api/descriptive/map-data` |\n| `concentration` | Market structure | `concentration`, `concentration-map`, `specialisation`, `production-volumes` | `/api/concentration/concentration`, `/api/concentration/concentration-map`, `/api/concentration/specialisation`, `/api/production/series` |\n| `cross-section` | Cross-section | `compare`, `subcode-volatility`, `subcode-concentration` | `/api/descriptive/subcode-compare`, `/api/volatility/volatility`, `/api/concentration/concentration-compare` |\n| `volatility` | Volatility & shocks | `volatility`, `supply-shocks`, `price-shocks`, `pattern-shifts` | `/api/volatility/volatility`, `/api/volatility/supply-shocks`, `/api/volatility/price-shocks`, `/api/volatility/pattern-shift` |\n| `vulnerability` | Strategic autonomy | `net-import-reliance`, `trade-intensity`, `export-propensity`, `subcontracting-*` | `/api/vulnerability/net-import-reliance`, `/api/vulnerability/trade-intensity`, `/api/vulnerability/export-propensity`, `/api/autonomy/subcontracting`, `/api/autonomy/subcontracting-reporters` |\n\n## Methodological Notes\n\nThese notes are reproduced here so figures can be interpreted and cited correctly:\n\n- **Concentration (HHI)**: The Herfindahl-Hirschman Index measures how concentrated trade is across partners or EU Member States. For each period, it sums the squared market shares of each entity, producing a score from 0 (perfectly spread across many partners) to 10,000 (one partner holds 100% of the market).\n\n- **Specialisation (RSCA)**: Intra-EU revealed symmetric comparative advantage per Member State: whether a Member State's share of intra-EU exports for a specific customs code is larger than its share of intra-EU exports overall. The Balassa index (RCA) compares a Member State's export share of the customs code against its export share of all goods (both measured within the EU); RSCA rescales RCA symmetrically onto [-1, 1]: RCA = (x_p / x_total) / (X_p / X_total), RSCA = (RCA - 1) / (RCA + 1), where x is the Member State's intra-EU exports and X is the EU total (p = this customs code, total = all goods). -1 is under-specialised, 0 is the EU average, +1 is strongly specialised. Intra-EU flows are distorted by the Rotterdam/Antwerp effect, so read the index with caution.\n\n- **Volatility (CV)**: Each value is the coefficient of variation (CV): standard deviation divided by the mean, for a single partner × customs-code pair over the selected period. Inactive periods (zero quantity) are excluded so they don't distort the result. A higher CV means the flow swings more relative to its typical level. Only the most active partners by volume are selected for volatility analysis.\n\n- **Supply shocks**: Detects abnormal collapses in trade volumes. For each partner × customs-code pair with enough sustained activity, the algorithm flags periods where volume drops well below that pair's historical average. To surface more (weaker) shocks: lower the minimum-deviation threshold, raise the cumulative trade share considered, extend tolerated gaps, lower the minimum number of stable years required, or treat any small drop (even ~5%) as a shock.\n\n- **Price shocks**: Detects sudden price variations while accounting for each flow's usual volatility. The algorithm compares each period's price against a retrospective reference window, then flags regime changes whose amplitude exceeds a configurable multiple of the coefficient of variation.\n\n- **Pattern shifts**: Suggested workflow: note the usual volatility of the entities that interest you (via volatility endpoints), check for significant volume/price variations there, use supply/price shock endpoints to identify the dates where these are most pronounced, then use one of those dates as the `midpoint` query parameter in `/api/volatility/pattern-shift`.\n\n- **Net import reliance (NIR)**: Expresses net imports (imports minus exports) as a share of domestic consumption in the Union: NIR = (Imports - Exports) / Apparent consumption, where Apparent consumption = Production + Imports - Exports. E.g., 40% means 40% of EU consumption of the goods is met by imports; negative means the EU is a net exporter (not import-dependent). Used by the European Commission to determine whether a sector should get particular monitoring or support.\n\n- **Trade intensity (TI)**: Measures how open EU27 production is to international trade, following the European Commission's CEEAG methodology (used for State-aid eligibility of sectors at risk of carbon leakage): TI = (Imports + Exports) / (Imports + Production). Close to 1 = highly trade-exposed; near 0 = predominantly domestic.\n\n- **Export propensity**: The share of EU27 production sold abroad: Export propensity = Exports / Production. E.g., 60% means 60% of the value produced in the Union is exported; re-exports or stock drawdown can push values above 100%.\n\n- **Subcontracting intensity**: The share of EU production manufactured for someone other than the factory's owner: Intensity = Sub-contracted production / Total sold production. Near 100% signals a processing hub with little own R&D; near 0% marks an autonomous industrial base. The own/sub split only exists from 2021 onward in the PRODCOM database.\n\n- **PRODCOM-backed endpoints**: For production volumes and all vulnerability endpoints—when a customs code maps to several PRODCOM codes, figures are aggregated across them, or, if Eurostat suppresses detail at that level, sourced from the nearest available higher aggregate. Use the `prodcom_code` query parameter to pin one specific mapping instead of relying on that default.\n\n- **Rotterdam/Antwerp caveat**: Whenever Belgium or the Netherlands appear as the main trading importer or exporter of a product, beware: it might just be that the bulk of the trade for that product is transiting through Antwerp or Rotterdam.\n",
    "version": "1.0.0"
  },
  "paths": {
    "/api/reference/countries": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Get Countries",
        "description": "Country reference data for the sidebar selectors: selectable reporters\nand aggregate presets, partner presets, reporter/partner groups, and a\nper-language country-name translation table so the frontend can relabel\neverything synchronously on language switch.",
        "operationId": "get_countries_api_reference_countries_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountriesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/language": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Get Language",
        "description": "Preferred UI language for a first-time visitor: explicit ``lang``\ncookie, else the ``Accept-Language`` header, else English. Reports both\nthe chosen ``lang`` and its ``source``.\n\nNegotiated over ``UiLang`` only: the app ships no catalogue for the other\nlabel languages, so detecting one would land the visitor on an untranslated\nshell. Reports and label lookups are not limited this way.",
        "operationId": "get_language_api_reference_language_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LanguageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/validate-customs-code/{customs_code}": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Validate Customs Code",
        "description": "Validate and describe one or more Combined Nomenclature customs codes.\n\nSingle code: normalises loose input, resolves the hierarchy of description\nlevels in *lang*, and returns ``{customs_code, levels, customs_code_label,\nhas_subcodes}`` plus ``interpreted_from`` when the input was reformatted.\nThe synthetic 'TOTAL' aggregate short-circuits the nomenclature lookup.\nA code the current edition no longer lists returns its recorded\ndefinitions (``in_current_cn: false``) instead of a 404. Every digit code\ncarries its recorded history (``segment_history``): the validity windows\na client composes windowed pieces from (the ``baskets`` request form).\nInput separated by commas or pipes is treated as a batch (at most 50\nitems) and returns ``{\"results\": [...]}``, each item a success dict or\n``{\"customs_code\", \"error\": {\"status\", \"detail\"}}``.\n\nErrors: 400 (malformed/too short), 404 (unknown code, with the nearest\nvalid parent), 503 (nomenclature or classification metadata unavailable).\nA mostly-numeric string over 12 digits with no separator is rejected as a\nlikely pasted list. Single successes and batches without server errors\nare day-cacheable; all other responses are no-store.",
        "operationId": "validate_customs_code_api_reference_validate_customs_code__customs_code__get",
        "parameters": [
          {
            "name": "customs_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 600,
              "title": "Customs Code"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "bg",
                "cs",
                "da",
                "de",
                "el",
                "en",
                "es",
                "et",
                "fi",
                "fr",
                "ga",
                "hr",
                "hu",
                "it",
                "lt",
                "lv",
                "mt",
                "nl",
                "pl",
                "pt",
                "ro",
                "sk",
                "sl",
                "sv"
              ],
              "type": "string",
              "default": "en",
              "title": "Lang"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ValidateCustomsCodeResponse"
                    },
                    {
                      "$ref": "#/components/schemas/ValidateCustomsCodeBatchResponse"
                    }
                  ],
                  "title": "Response Validate Customs Code Api Reference Validate Customs Code  Customs Code  Get"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/data-range": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Get Data Range",
        "description": "Period coverage of the local Comext store for the given customs\ncode(s), as ``{\"data_min\", \"data_max\"}`` ('YYYY-MM', both null when\nnothing is cached) over every declaration under the codes' digits, plus\n``selection``: for each piece of the optional ``pieces`` JSON list (each\nshaped like a ``baskets`` piece), the months its window holds. Backs the\nsidebar period picker and the MCP client's composition step. 400 for a\nmalformed piece.",
        "operationId": "get_data_range_api_reference_data_range_get",
        "parameters": [
          {
            "name": "customs_codes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "A canonical customs code, TOTAL, or a supported residual spelling."
              },
              "maxItems": 50,
              "title": "Customs Codes"
            }
          },
          {
            "name": "pieces",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 8192
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pieces"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRangeResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/comext-status": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Get Comext Status",
        "description": "Last change date of the local Comext store: the mtime of\n``manifest.json``, rewritten atomically at the end of every update run;\n``null`` before the first build. Backs the sidebar's \"Last Comext update\"\nline. Hour-cacheable — the value changes at most monthly.",
        "operationId": "get_comext_status_api_reference_comext_status_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComextStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/chapters": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Get Chapters",
        "description": "All top-level Combined Nomenclature chapters (2-digit codes), as\n``{chapters: [{customs_code, text}, ...]}`` in *lang*. Bootstraps the nomenclature\nbrowser's root level; day-cacheable; 503 when the nomenclature service is\nunavailable.",
        "operationId": "get_chapters_api_reference_chapters_get",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "bg",
                "cs",
                "da",
                "de",
                "el",
                "en",
                "es",
                "et",
                "fi",
                "fr",
                "ga",
                "hr",
                "hu",
                "it",
                "lt",
                "lv",
                "mt",
                "nl",
                "pl",
                "pt",
                "ro",
                "sk",
                "sl",
                "sv"
              ],
              "type": "string",
              "default": "en",
              "title": "Lang"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChaptersResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/subtree/{customs_code}": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Get Subtree",
        "description": "The Combined Nomenclature sub-tree rooted at *customs_code* (nested\n``{customs_code, text, children}``, in *lang*), used to drill from a\nparent code into its sub-codes. ``\"TOTAL\"`` (the Eurostat all-goods\nmeta-aggregate) is accepted: every chapter is hardcoded as its child.\nDay-cacheable; 400 for malformed codes, 503 when the nomenclature service\nis unavailable.",
        "operationId": "get_subtree_api_reference_subtree__customs_code__get",
        "parameters": [
          {
            "name": "customs_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
              "title": "Customs Code"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "bg",
                "cs",
                "da",
                "de",
                "el",
                "en",
                "es",
                "et",
                "fi",
                "fr",
                "ga",
                "hr",
                "hu",
                "it",
                "lt",
                "lv",
                "mt",
                "nl",
                "pl",
                "pt",
                "ro",
                "sk",
                "sl",
                "sv"
              ],
              "type": "string",
              "default": "en",
              "title": "Lang"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtreeNode"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/search": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Search Customs Codes",
        "description": "Keyword/code search over a nomenclature for the sidebar typeahead:\nranked ``{code, label, path}`` candidates.\n\nA dotted PRODCOM notation (``XX.XX`` or deeper) is auto-detected and runs\nthe PRODCOM→CN reverse mapping instead; candidates then carry a\n``via_prodcom`` provenance tag and the response a ``matched_prodcom``\nblock (present even when no CN code maps, so the frontend can warn).",
        "operationId": "search_customs_codes_api_reference_search_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Q"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "const": "cn",
              "type": "string",
              "default": "cn",
              "title": "Source"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "bg",
                "cs",
                "da",
                "de",
                "el",
                "en",
                "es",
                "et",
                "fi",
                "fr",
                "ga",
                "hr",
                "hu",
                "it",
                "lt",
                "lv",
                "mt",
                "nl",
                "pl",
                "pt",
                "ro",
                "sk",
                "sl",
                "sv"
              ],
              "type": "string",
              "default": "en",
              "title": "Lang"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reference/data-status": {
      "get": {
        "tags": [
          "reference"
        ],
        "summary": "Get Data Status",
        "description": "Freshness of the two mirrored Eurostat datasets, for the status page.\nHalf-day-cacheable — the COMEXT probe itself runs twice a day.",
        "operationId": "get_data_status_api_reference_data_status_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/descriptive/overview": {
      "post": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get Overview",
        "description": "Headline figures for the Overview tab.\n\nTotal import/export quantities, values and weighted-average prices per\nperiod, the trade balance, and a top-partner breakdown. Streams JSON\nLines progress frames, then one result frame.",
        "operationId": "get_overview_api_descriptive_overview_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_OverviewPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ]
      }
    },
    "/api/descriptive/partner-detail": {
      "post": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get Partner Detail",
        "description": "Per-partner import/export breakdown: top-N trading partners ranked by\nquantity and by value, each with quantity, value and price series, plus an\noptional 'Other' bucket. Streams JSON Lines.",
        "operationId": "get_partner_detail_api_descriptive_partner_detail_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_EntityDetailPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ]
      }
    },
    "/api/descriptive/reporter-detail": {
      "post": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get Reporter Detail",
        "description": "Per-EU-Member-State import/export breakdown -- the reporter-side\ncounterpart of ``/partner-detail``. Aggregate reporters (EU, Euro area,\ngroups) are excluded from the ranking and the 'Other' bucket. Streams\nJSON Lines.",
        "operationId": "get_reporter_detail_api_descriptive_reporter_detail_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_EntityDetailPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ]
      }
    },
    "/api/descriptive/reporter-benchmark": {
      "post": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get Reporter Benchmark",
        "description": "Every EU reporter ranked by value for one year -- the country-view\ncounterpart of ``/reporter-detail``.\n\nReturns ``{imports, exports, price_benchmark}``: per-flow single-year\nsnapshots (every real reporter's quantity, value and price, ranked by\nvalue) and a benchmark price series (the selected aggregate's weighted\naverage, the cross-reporter min/max envelope, and the selected reporter's\nown line when it is a single Member State). The snapshot defaults to the\nlatest *full* year (all 12 months present); override with ``year``.\nStreams JSON Lines.",
        "operationId": "get_reporter_benchmark_api_descriptive_reporter_benchmark_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 2100,
                  "minimum": 1988
                },
                {
                  "type": "null"
                }
              ],
              "description": "Override the year for the cross-sectional benchmark. Defaults to the latest full year with data.",
              "title": "Year"
            },
            "description": "Override the year for the cross-sectional benchmark. Defaults to the latest full year with data."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ReporterBenchmarkPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/descriptive/map-data": {
      "post": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get Map Data",
        "description": "Choropleth-ready aggregates for the map view.\n\nStreams JSON Lines, then returns per-period totals (quantity, value,\nprice) for both imports and exports, keyed by GISCO country code on both\nthe reporter and partner sides so the frontend can shade either map\ndirectly.",
        "operationId": "get_map_data_api_descriptive_map_data_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_MapDataPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ]
      }
    },
    "/api/descriptive/top-entities": {
      "post": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get Top Entities",
        "description": "Just the ordered list of top entities for a slice — no time series.\n\nA lightweight helper the frontend uses to populate entity pickers. Streams\nJSON Lines, then returns the ranked entity names.",
        "operationId": "get_top_entities_api_descriptive_top_entities_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "entity_level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EntityLevel",
              "description": "Dimension to rank: 'partner' (trading partners) or 'reporter' (EU Member States).",
              "default": "partner"
            },
            "description": "Dimension to rank: 'partner' (trading partners) or 'reporter' (EU Member States)."
          },
          {
            "name": "flow",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Flow",
              "description": "Trade flow to rank entities by.",
              "default": "Imports"
            },
            "description": "Trade flow to rank entities by."
          },
          {
            "name": "n",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 150,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Number of top entities to return. Defaults to the body's n_top when omitted.",
              "title": "N"
            },
            "description": "Number of top entities to return. Defaults to the body's n_top when omitted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_TopEntitiesPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/descriptive/subcode-compare": {
      "post": {
        "tags": [
          "subcodes"
        ],
        "summary": "Get Subcode Compare",
        "description": "Sub-code comparison for the Cross-section view: expands a parent code\ninto its sub-codes (or compares the entered codes directly) and returns\nper-sub-code quantity, value and price series for both flows (top-N by\nvolume), each code its own line rather than aggregated away. A leaf code\nwith no sub-codes returns ``leaf: true``. Streams JSON Lines.",
        "operationId": "get_subcode_compare_api_descriptive_subcode_compare_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_SubcodeComparePayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ]
      }
    },
    "/api/concentration/concentration": {
      "post": {
        "tags": [
          "concentration"
        ],
        "summary": "Get Concentration",
        "description": "Trade-concentration series via the Herfindahl-Hirschman Index (HHI):\nsquared market shares per period, from 0 (perfectly spread) to 10,000\n(one entity holds the whole market). Returns per-flow HHI series plus the\ntop-entity share breakdown (top 8 by value, rest bundled as 'Others').\n``entity_level`` selects the question: 'partner' (dependence on a few\ntrading partners) or 'reporter' (per top partner, concentration across\nEU Member States). Streams JSON Lines.",
        "operationId": "get_concentration_api_concentration_concentration_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "entity_level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EntityLevel",
              "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required.",
              "default": "partner"
            },
            "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required."
          },
          {
            "name": "partner",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 120
                },
                {
                  "type": "null"
                }
              ],
              "description": "Partner country name (English). Required when entity_level='reporter'.",
              "title": "Partner"
            },
            "description": "Partner country name (English). Required when entity_level='reporter'."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ConcentrationPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/concentration/concentration-compare": {
      "post": {
        "tags": [
          "concentration"
        ],
        "summary": "Get Concentration Compare",
        "description": "Partner-concentration (HHI) compared across sub-codes: one HHI line\nper sub-code (sub-codes of a parent code, or the entered codes) for\nvolume and value across both flows — so you can see which sub-codes\ndrive a parent code's overall concentration. Streams JSON Lines.",
        "operationId": "get_concentration_compare_api_concentration_concentration_compare_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "n_subcodes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "description": "Maximum number of sub-codes to plot as separate HHI lines.",
              "default": 8,
              "title": "N Subcodes"
            },
            "description": "Maximum number of sub-codes to plot as separate HHI lines."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ConcentrationComparePayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/concentration/concentration-map": {
      "post": {
        "tags": [
          "concentration"
        ],
        "summary": "Get Concentration Map",
        "description": "Cross-sectional HHI per country for one year -- the choropleth\ncounterpart of ``/concentration``. ``entity_level`` selects the view:\n'partner' (per Member State, HHI of its trade across partners) or\n'reporter' (per partner, HHI across Member States — subject to the\nRotterdam/Antwerp entry-point distortion: imports are booked to the\nMember State of customs declaration, not of final consumption). Defaults to the\nlatest *full* year; override with ``year``. Streams JSON Lines.",
        "operationId": "get_concentration_map_api_concentration_concentration_map_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 2100,
                  "minimum": 1988
                },
                {
                  "type": "null"
                }
              ],
              "description": "Override the year for the cross-sectional HHI snapshot. Defaults to the latest full year with data.",
              "title": "Year"
            },
            "description": "Override the year for the cross-sectional HHI snapshot. Defaults to the latest full year with data."
          },
          {
            "name": "entity_level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EntityLevel",
              "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required.",
              "default": "partner"
            },
            "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required."
          },
          {
            "name": "partner",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 120
                },
                {
                  "type": "null"
                }
              ],
              "description": "Partner country name (English). Required when entity_level='reporter'.",
              "title": "Partner"
            },
            "description": "Partner country name (English). Required when entity_level='reporter'."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ConcentrationMapPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/concentration/specialisation": {
      "post": {
        "tags": [
          "concentration"
        ],
        "summary": "Get Specialisation",
        "description": "Intra-EU revealed symmetric comparative advantage (RSCA) per Member\nState: is its share of intra-EU exports of this customs code larger than its\nshare of intra-EU exports overall (Comext ``TOTAL`` denominator)? Runs −1\n(under-specialised) through 0 (EU average) to +1 (strongly specialised);\nvalue-based and intra-EU only. Beware the Rotterdam/Antwerp quasi-transit\ndistortion. Defaults to the latest *full* year; override with ``year``.\nStreams JSON Lines.",
        "operationId": "get_specialisation_api_concentration_specialisation_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 2100,
                  "minimum": 1988
                },
                {
                  "type": "null"
                }
              ],
              "description": "Override the year for the RSCA snapshot. Defaults to the latest full year with data.",
              "title": "Year"
            },
            "description": "Override the year for the RSCA snapshot. Defaults to the latest full year with data."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_SpecialisationPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/volatility/volatility": {
      "post": {
        "tags": [
          "volatility"
        ],
        "summary": "Get Volatility",
        "description": "Coefficient-of-variation (CV = stdev / mean) volatility per\npartner/reporter × customs-code pair over the selected period; inactive\n(zero-quantity) periods are excluded. Higher CV = the flow swings more\nrelative to its typical level. Returns per-entity CV bars with drill-down\nseries and, unless ``include_heatmap=false``, an entity × sub-code CV\nheatmap — keyed by combo (``imp-qty`` … ``exp-price``), one entry in\nsingle-grid mode. Streams JSON Lines.",
        "operationId": "get_volatility_api_volatility_volatility_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "n_top_entities",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of top entities (partners or reporters) to include in the volatility bar chart.",
              "default": 15,
              "title": "N Top Entities"
            },
            "description": "Number of top entities (partners or reporters) to include in the volatility bar chart."
          },
          {
            "name": "n_top_subcodes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "description": "Maximum number of sub-codes to include in the entity × customs-code heatmap.",
              "default": 10,
              "title": "N Top Subcodes"
            },
            "description": "Maximum number of sub-codes to include in the entity × customs-code heatmap."
          },
          {
            "name": "include_heatmap",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Whether to compute the entity × sub-code CV heatmap. Set to false to receive only the per-entity bar chart (faster).",
              "default": true,
              "title": "Include Heatmap"
            },
            "description": "Whether to compute the entity × sub-code CV heatmap. Set to false to receive only the per-entity bar chart (faster)."
          },
          {
            "name": "entity_level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EntityLevel",
              "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required.",
              "default": "partner"
            },
            "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required."
          },
          {
            "name": "partner",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 120
                },
                {
                  "type": "null"
                }
              ],
              "description": "Partner country name (English). Required when entity_level='reporter'.",
              "title": "Partner"
            },
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          {
            "name": "combos",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated flow × indicator keys to compute in one request: imp-qty, imp-price, exp-qty, exp-price. When supplied the response is a dict keyed by combo; when absent the 'flow' and 'indicator' params select a single grid.",
              "title": "Combos"
            },
            "description": "Comma-separated flow × indicator keys to compute in one request: imp-qty, imp-price, exp-qty, exp-price. When supplied the response is a dict keyed by combo; when absent the 'flow' and 'indicator' params select a single grid."
          },
          {
            "name": "flow",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Flow",
              "description": "Trade flow for single-grid mode (ignored when 'combos' is set).",
              "default": "Imports"
            },
            "description": "Trade flow for single-grid mode (ignored when 'combos' is set)."
          },
          {
            "name": "indicator",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "quantity",
                "price"
              ],
              "type": "string",
              "description": "Measure for single-grid mode, 'quantity' or 'price' (ignored when 'combos' is set).",
              "default": "quantity",
              "title": "Indicator"
            },
            "description": "Measure for single-grid mode, 'quantity' or 'price' (ignored when 'combos' is set)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_VolatilityPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/volatility/pattern-shift": {
      "post": {
        "tags": [
          "volatility"
        ],
        "summary": "Get Pattern Shift",
        "description": "Before/after trade-pattern shift around the ``midpoint`` query parameter: for\neach entity, average quantity vs. price change as scatter points with\nquadrant labels — top-right = demand-driven growth, top-left = supply\nconstraint/monopoly risk, bottom-right = dumping/oversupply risk,\nbottom-left = market contraction. Workflow: spot a country's usual\nvolatility, find shock dates via the shock endpoints, pass one as\n``midpoint``. Omitting ``midpoint`` selects the middle valid observed\nperiod and returns every valid alternative in ``available_midpoints``.\nAn explicit midpoint that cannot form a valid split returns a 422 error\nframe. Streams JSON Lines.",
        "operationId": "get_pattern_shift_api_volatility_pattern_shift_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "midpoint",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Split point 'YYYY-MM': the window is cut in two here and the before/after change per entity is reported. Omit it to receive the middle valid observed period and every available midpoint. An explicit value that cannot form a valid split returns 422.",
              "title": "Midpoint"
            },
            "description": "Split point 'YYYY-MM': the window is cut in two here and the before/after change per entity is reported. Omit it to receive the middle valid observed period and every available midpoint. An explicit value that cannot form a valid split returns 422."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_PatternShiftPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/volatility/supply-shocks": {
      "post": {
        "tags": [
          "volatility"
        ],
        "summary": "Get Volatility Supply Shocks",
        "description": "Detect abnormal collapses in trade volumes: for each partner ×\ncustoms-code pair with enough sustained activity, flag periods where volume drops well\nbelow the pair's historical average (> 2 sigma by default). Returns ranked\nshock events per flow, each with timeline phases (baseline, decline,\ndisruption, recovery, ...), magnitude, abnormality score and the\nunderlying series. Tunable via the query params documented below; lower\nthresholds surface more (weaker) shocks. Streams JSON Lines.",
        "operationId": "get_volatility_supply_shocks_api_volatility_supply_shocks_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "entity_level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EntityLevel",
              "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required.",
              "default": "partner"
            },
            "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required."
          },
          {
            "name": "partner",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 120
                },
                {
                  "type": "null"
                }
              ],
              "description": "Partner country name (English). Required when entity_level='reporter'.",
              "title": "Partner"
            },
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          {
            "name": "min_abnormality",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 10.0,
              "minimum": 0.1,
              "description": "Minimum statistical abnormality of the volume crash, in sigma. Lower values flag more (weaker) shocks; higher values flag only extreme events. Default 2.0.",
              "default": 2.0,
              "title": "Min Abnormality"
            }
          },
          {
            "name": "relative_threshold",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 0.95,
              "minimum": 0.01,
              "description": "Minimum drop relative to peak volume to count as a collapse (e.g. 0.10 = 10% drop). Default 0.10.",
              "default": 0.1,
              "title": "Relative Threshold"
            }
          },
          {
            "name": "min_active_years",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 5,
              "minimum": 1,
              "description": "Consecutive years of regular trade required before a collapse can be flagged. Default 2.",
              "default": 2,
              "title": "Min Active Years"
            }
          },
          {
            "name": "cumulative_share",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.3,
              "description": "Only the top trading partners that together account for this share of total trade are analysed (e.g. 0.80 = top 80%). Default 0.80.",
              "default": 0.8,
              "title": "Cumulative Share"
            }
          },
          {
            "name": "max_tolerated_gap",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 6,
              "minimum": 1,
              "description": "Consecutive quiet periods allowed within an otherwise stable trading relationship. Default 2.",
              "default": 2,
              "title": "Max Tolerated Gap"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ShocksEndpointPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/volatility/price-shocks": {
      "post": {
        "tags": [
          "volatility"
        ],
        "summary": "Get Volatility Price Shocks",
        "description": "Detect sudden price regime shifts while accounting for each flow's usual\nvolatility: each period's price is compared against a retrospective\nreference window, and regime changes whose amplitude exceeds a multiple of\nthe coefficient of variation are flagged — so naturally volatile flows\naren't over-flagged. Returns ranked shock events per flow with timeline\nphases (price spike/drop, volatile trade, return to baseline, ...),\nmagnitude and series. Tunable via the query params. Streams JSON Lines.",
        "operationId": "get_volatility_price_shocks_api_volatility_price_shocks_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "entity_level",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EntityLevel",
              "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required.",
              "default": "partner"
            },
            "description": "Dimension to analyse. 'partner' — how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' — how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', the 'partner' query param is required."
          },
          {
            "name": "partner",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 120
                },
                {
                  "type": "null"
                }
              ],
              "description": "Partner country name (English). Required when entity_level='reporter'.",
              "title": "Partner"
            },
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          {
            "name": "min_abnormality",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 10.0,
              "minimum": 0.5,
              "description": "Minimum statistical unusualness of the price shift compared to baseline volatility (coefficient-of-variation multiples). Lower values surface more (weaker) shocks. Default 2.0.",
              "default": 2.0,
              "title": "Min Abnormality"
            }
          },
          {
            "name": "lookback_years",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 5,
              "minimum": 1,
              "description": "Years before the shock used to establish the coefficient-of-variation baseline. Default 2.",
              "default": 2,
              "title": "Lookback Years"
            }
          },
          {
            "name": "cumulative_share",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.3,
              "description": "Only the top trading partners that together account for this share of total trade are analysed (e.g. 0.80 = top 80%). Default 0.80.",
              "default": 0.8,
              "title": "Cumulative Share"
            }
          },
          {
            "name": "max_shocks_per_pair",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 5,
              "minimum": 1,
              "description": "Number of non-overlapping shocks kept per trading partner. Raise to surface multiple shock events per pair. Default 1.",
              "default": 1,
              "title": "Max Shocks Per Pair"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ShocksEndpointPayload_"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/vulnerability/net-import-reliance": {
      "post": {
        "tags": [
          "vulnerability"
        ],
        "summary": "Get Net Import Reliance",
        "description": "Net Import Reliance (NIR): net imports as a share of EU consumption — NIR = (Imports - Exports) / (Production + Imports - Exports). E.g. 40% means 40% of EU consumption is met by imports; negative means the EU is a net exporter. Annual, joining PRODCOM production with Comext trade data.\n\nStreams JSON Lines progress frames, then one result frame.\n\nPRODCOM (the intra-EU production-statistics database) has its own nomenclature,\nseparate from customs codes, with only partial correspondence tables. The\nmapping from a customs code resolves to a direct single match, a confidentiality\nfallback to the nearest available higher level, or a multi-match whose codes\nare aggregated (pin one with the ``prodcom_code`` query parameter). Each\n``prodcom`` block reports a ``notes`` array and, when no series can be\nproduced, an ``unavailability_type``:\n\n- ``'no_mapping'`` — no PRODCOM correspondence; no production statistics.\n- ``'selection_required'`` — several mapped codes, some suppressed; choose one.\n- ``'suppressed'`` — Eurostat publishes nothing for the mapped codes nor their\n  immediate parents.\n- ``'no_data'`` — mapped, but Eurostat returns no data yet.\n- ``'not_applicable'`` — the 'TOTAL' meta-aggregate has no PRODCOM equivalent.\n\nThe CN→PRODCOM correspondence exists for raw digit codes only: plain digit\ncodes (raw by default) and explicit ``digits@raw`` are accepted; segment\nselections (references, ``@all``, lineages) are rejected before streaming\nwith ``segment_prodcom_unavailable``, and residual spellings on their own\nreason. Production statistics never silently follow a segment selection.\n\nThe ``comparison`` block is ``single`` (one code against its same-level\nPRODCOM siblings) or ``multi`` (the entered codes side by side, plus their\naggregate when it is a valid sum); every matrix is the full\n``data[measure][basis]`` (value/quantity × total/own/sub), and the frontend\nselects which variant to plot.",
        "operationId": "get_net_import_reliance_api_vulnerability_net_import_reliance_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "prodcom_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "A canonical dotless PRODCOM code."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted.",
              "title": "Prodcom Code"
            },
            "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ExposurePayload_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid PRODCOM selection; every customs code must be full-period and non-residual.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/vulnerability/trade-intensity": {
      "post": {
        "tags": [
          "vulnerability"
        ],
        "summary": "Get Trade Intensity",
        "description": "Trade Intensity (TI): how exposed an EU sector is to international trade — TI = (Imports + Exports) / (Imports + Production). Near 1 = highly trade-exposed; near 0 = predominantly domestic (the Commission's CEEAG methodology, used for carbon-leakage / State-aid eligibility). Annual, joining PRODCOM production with Comext trade data.\n\nStreams JSON Lines progress frames, then one result frame.\n\nPRODCOM (the intra-EU production-statistics database) has its own nomenclature,\nseparate from customs codes, with only partial correspondence tables. The\nmapping from a customs code resolves to a direct single match, a confidentiality\nfallback to the nearest available higher level, or a multi-match whose codes\nare aggregated (pin one with the ``prodcom_code`` query parameter). Each\n``prodcom`` block reports a ``notes`` array and, when no series can be\nproduced, an ``unavailability_type``:\n\n- ``'no_mapping'`` — no PRODCOM correspondence; no production statistics.\n- ``'selection_required'`` — several mapped codes, some suppressed; choose one.\n- ``'suppressed'`` — Eurostat publishes nothing for the mapped codes nor their\n  immediate parents.\n- ``'no_data'`` — mapped, but Eurostat returns no data yet.\n- ``'not_applicable'`` — the 'TOTAL' meta-aggregate has no PRODCOM equivalent.\n\nThe CN→PRODCOM correspondence exists for raw digit codes only: plain digit\ncodes (raw by default) and explicit ``digits@raw`` are accepted; segment\nselections (references, ``@all``, lineages) are rejected before streaming\nwith ``segment_prodcom_unavailable``, and residual spellings on their own\nreason. Production statistics never silently follow a segment selection.\n\nThe ``comparison`` block is ``single`` (one code against its same-level\nPRODCOM siblings) or ``multi`` (the entered codes side by side, plus their\naggregate when it is a valid sum); every matrix is the full\n``data[measure][basis]`` (value/quantity × total/own/sub), and the frontend\nselects which variant to plot.",
        "operationId": "get_trade_intensity_api_vulnerability_trade_intensity_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "prodcom_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "A canonical dotless PRODCOM code."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted.",
              "title": "Prodcom Code"
            },
            "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ExposurePayload_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid PRODCOM selection; every customs code must be full-period and non-residual.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/vulnerability/export-propensity": {
      "post": {
        "tags": [
          "vulnerability"
        ],
        "summary": "Get Export Propensity",
        "description": "Export Propensity: the share of EU production that is exported — Exports / Production. Not clamped: values above 100% are legitimate (re-exports, stock drawdown, scope differences). Annual, joining PRODCOM production with Comext trade data.\n\nStreams JSON Lines progress frames, then one result frame.\n\nPRODCOM (the intra-EU production-statistics database) has its own nomenclature,\nseparate from customs codes, with only partial correspondence tables. The\nmapping from a customs code resolves to a direct single match, a confidentiality\nfallback to the nearest available higher level, or a multi-match whose codes\nare aggregated (pin one with the ``prodcom_code`` query parameter). Each\n``prodcom`` block reports a ``notes`` array and, when no series can be\nproduced, an ``unavailability_type``:\n\n- ``'no_mapping'`` — no PRODCOM correspondence; no production statistics.\n- ``'selection_required'`` — several mapped codes, some suppressed; choose one.\n- ``'suppressed'`` — Eurostat publishes nothing for the mapped codes nor their\n  immediate parents.\n- ``'no_data'`` — mapped, but Eurostat returns no data yet.\n- ``'not_applicable'`` — the 'TOTAL' meta-aggregate has no PRODCOM equivalent.\n\nThe CN→PRODCOM correspondence exists for raw digit codes only: plain digit\ncodes (raw by default) and explicit ``digits@raw`` are accepted; segment\nselections (references, ``@all``, lineages) are rejected before streaming\nwith ``segment_prodcom_unavailable``, and residual spellings on their own\nreason. Production statistics never silently follow a segment selection.\n\nThe ``comparison`` block is ``single`` (one code against its same-level\nPRODCOM siblings) or ``multi`` (the entered codes side by side, plus their\naggregate when it is a valid sum); every matrix is the full\n``data[measure][basis]`` (value/quantity × total/own/sub), and the frontend\nselects which variant to plot.",
        "operationId": "get_export_propensity_api_vulnerability_export_propensity_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "prodcom_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "A canonical dotless PRODCOM code."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted.",
              "title": "Prodcom Code"
            },
            "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ExposurePayload_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid PRODCOM selection; every customs code must be full-period and non-residual.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/autonomy/subcontracting": {
      "post": {
        "tags": [
          "autonomy"
        ],
        "summary": "Get Subcontracting Intensity",
        "description": "EU27 sub-contracting intensity: the share of sold production that is\ntoll (sub-contracted) manufacturing rather than own-account output. Returns\nthe intensity (%) across value/quantity, its components, per-period\ndata-quality status, and the resolved PRODCOM codes. The own/sub split\nexists only from 2021 onward. Exactly one customs code is accepted;\nmulti-code selections are rejected with HTTP 400. Streams JSON Lines.",
        "operationId": "get_subcontracting_intensity_api_autonomy_subcontracting_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "prodcom_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "A canonical dotless PRODCOM code."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted.",
              "title": "Prodcom Code"
            },
            "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_SubcontractingIntensityPayload_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid PRODCOM selection; exactly one full-period, non-residual customs code is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/autonomy/subcontracting-reporters": {
      "post": {
        "tags": [
          "autonomy"
        ],
        "summary": "Get Subcontracting Reporters",
        "description": "Per-country sub-contracting intensity: which reporting countries act as\nprocessing hubs versus autonomous producers. Spans every DS-059358\nreporter that reports the own/sub split (others simply don't appear);\nconfidentiality-suppressed cells are ``null``. Exactly one customs code is\naccepted; multi-code selections are rejected with HTTP 400. Streams JSON\nLines.",
        "operationId": "get_subcontracting_reporters_api_autonomy_subcontracting_reporters_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "prodcom_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "A canonical dotless PRODCOM code."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted.",
              "title": "Prodcom Code"
            },
            "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_SubcontractingReportersPayload_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid PRODCOM selection; exactly one full-period, non-residual customs code is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/production/series": {
      "post": {
        "tags": [
          "production"
        ],
        "summary": "Get Production Series",
        "description": "EU27 and per-country PRODCOM production series over time.\n\nSpans every DS-059358 reporting country (the EU Member States plus EFTA,\ncandidate and other reporters), not only the EU-27. Returns EU quantity,\nEU production unit value, and both per country; confidentiality-suppressed\nvalues are ``null``. Use ``prodcom_code`` to pin a specific mapping.\nExactly one customs code is accepted; multi-code selections are rejected\nwith HTTP 400. Streams JSON Lines.",
        "operationId": "get_production_series_api_production_series_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "prodcom_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "A canonical dotless PRODCOM code."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted.",
              "title": "Prodcom Code"
            },
            "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ProductionSeriesPayload_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid PRODCOM selection; exactly one full-period, non-residual customs code is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/production/concentration": {
      "post": {
        "tags": [
          "production"
        ],
        "summary": "Get Production Concentration",
        "description": "How concentrated production of a customs code's goods is across the\nDS-059358 reporting countries (EU Member States plus EFTA, candidate and\nother reporters — production carries no trade columns). HHI of PRODVAL\nover time plus each country's share; confidentiality-suppressed values are\n``null``. Use ``prodcom_code`` to pin a mapping. Exactly one customs code\nis accepted; multi-code selections are rejected with HTTP 400. Streams\nJSON Lines.",
        "operationId": "get_production_concentration_api_production_concentration_post",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "prodcom_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "A canonical dotless PRODCOM code."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted.",
              "title": "Prodcom Code"
            },
            "description": "Specific canonical PRODCOM code to pin when one customs code maps to several. Dotted input is accepted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/jsonl": {
                "itemSchema": {
                  "$ref": "#/components/schemas/Frame_ProductionConcentrationPayload_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid PRODCOM selection; exactly one full-period, non-residual customs code is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential, and the query is not made entirely of demonstration codes: registration is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme": {
      "get": {
        "tags": [
          "theme"
        ],
        "summary": "Get Theme",
        "description": "Build from Base (darker, primary) and Accent (lighter, secondary),\neach six hex digits with or without ``#``. A 422 explains colours that are\ntoo close or a theme that misses a contrast rule.",
        "operationId": "get_theme_api_theme_get",
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "primary",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$",
              "description": "The darker brand colour: chart slot 1 and the colour of selected and active states.",
              "title": "Primary"
            },
            "description": "The darker brand colour: chart slot 1 and the colour of selected and active states."
          },
          {
            "name": "secondary",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$",
              "description": "The lighter accent colour: chart slot 2.",
              "title": "Secondary"
            },
            "description": "The lighter accent colour: chart slot 2."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme/custom/{theme_id}.css": {
      "get": {
        "tags": [
          "theme"
        ],
        "summary": "Get Custom Theme Css",
        "description": "The owned custom theme's screen tokens for one mode (first paint and\nevery later selection or mode change).",
        "operationId": "get_custom_theme_css_api_theme_custom__theme_id__css_get",
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ThemeMode"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme/custom/{theme_id}": {
      "get": {
        "tags": [
          "theme"
        ],
        "summary": "Get Custom Theme",
        "description": "The full day/night/print theme of an owned saved colour pair.",
        "operationId": "get_custom_theme_api_theme_custom__theme_id__get",
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/register": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Register",
        "description": "Start account creation and send an email confirmation link.\n\nAlways returns ``{ok: true}`` (no account-existence disclosure); an\nunverified existing account quietly gets a fresh confirmation link.",
        "operationId": "auth_register_api_auth_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/verify": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Verify",
        "description": "Consume an email-confirmation token: mark the account verified and\nredirect to ``/account?verified=1`` (or ``/account?verified=0`` for an\ninvalid/expired token).",
        "operationId": "auth_verify_api_auth_verify_get",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128,
              "default": "",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "To `/account?verified=1`, or `/account?verified=0` for an invalid or expired token."
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Login",
        "description": "Authenticate and open a session: sets the ``td_session`` HttpOnly\ncookie and returns the user's email and searches. 401 for bad credentials,\n403 if the email has not been confirmed yet.",
        "operationId": "auth_login_api_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            }
          },
          "401": {
            "description": "Incorrect email or password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "The email address is not confirmed yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Logout",
        "description": "Revoke the current session and clear the session cookie.",
        "operationId": "auth_logout_api_auth_logout_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/me": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Me",
        "description": "The signed-in user's email, searches, email preferences and API key\nstatus. A real browser session also refreshes the first-paint theme\ncookies, including sessions opened before those cookies existed.",
        "operationId": "auth_me_api_auth_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/auth/email-prefs": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Email Prefs",
        "description": "Update which bulk emails (newsletter / announcements / database\nupdates) the signed-in user receives.",
        "operationId": "auth_email_prefs_api_auth_email_prefs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailPrefs"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPrefsResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/auth/themes": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Create Theme",
        "operationId": "auth_create_theme_api_auth_themes_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomThemeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeMutationResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/auth/themes/{theme_id}": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Update Theme",
        "operationId": "auth_update_theme_api_auth_themes__theme_id__post",
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomThemeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeMutationResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Delete Theme",
        "operationId": "auth_delete_theme_api_auth_themes__theme_id__delete",
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeMutationResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/theme-preference": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Theme Preference",
        "operationId": "auth_theme_preference_api_auth_theme_preference_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemePreferenceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeMutationResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/auth/theme.css": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Current Theme Css",
        "operationId": "auth_current_theme_css_api_auth_theme_css_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid web session or personal API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "OAuth/MCP cannot modify theme and reporting preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "personalKey": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/auth/resend-verification": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Resend",
        "description": "Resend the confirmation email for an unverified account.\n\nAlways returns ``{ok: true}`` to avoid disclosing account existence.",
        "operationId": "auth_resend_api_auth_resend_verification_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/request-password-reset": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Request Reset",
        "description": "Email a password-reset link if the address has an account (always\n``{ok: true}`` — no account-existence disclosure).",
        "operationId": "auth_request_reset_api_auth_request_password_reset_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/reset-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Reset Password",
        "description": "Set a new password using a valid reset token and end every old credential.\n\nMarks the email verified (control of the inbox is proven). The user then\nlogs in again, creates a new personal API key and reconnects OAuth apps.\n400 for an invalid/expired token, 422 for a too-short password\n(``NewPassword``).",
        "operationId": "auth_reset_password_api_auth_reset_password_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "400": {
            "description": "The reset link is invalid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/set-lang": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Set Lang",
        "description": "Persist the signed-in user's preferred UI language.",
        "operationId": "auth_set_lang_api_auth_set_lang_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetLangReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/auth/delete-account": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Auth Delete Account",
        "description": "Permanently delete the account and its account-linked data.\n\nPseudonymised login-session statistics are retained without their auth.db\nmapping. Requires the current password (401 on mismatch); clears the\nsession cookie on success.",
        "operationId": "auth_delete_account_api_auth_delete_account_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAccountReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, or an incorrect password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "A personal key or OAuth token was presented: this destructive or credential-issuing action requires an interactive session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    },
    "/api/searches/recent": {
      "post": {
        "tags": [
          "searches"
        ],
        "summary": "Searches Add Recent",
        "description": "Record a dashboard search on the user's history (deduped by criteria,\ncapped) and return the updated list.",
        "operationId": "searches_add_recent_api_searches_recent_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecentSearchReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecentSearchesResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/searches/saved": {
      "post": {
        "tags": [
          "searches"
        ],
        "summary": "Searches Save",
        "description": "Save a dashboard search on the user's account (permanent, never\nevicted by the history cap) and return the updated list.",
        "operationId": "searches_save_api_searches_saved_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedSearchReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedSearchesResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/searches/saved/{search_id}": {
      "delete": {
        "tags": [
          "searches"
        ],
        "summary": "Searches Remove Saved",
        "description": "Remove one of the signed-in user's saved searches; returns the updated\nlist.",
        "operationId": "searches_remove_saved_api_searches_saved__search_id__delete",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "search_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{12}$",
              "title": "Search Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedSearchesResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reports/request": {
      "post": {
        "tags": [
          "reports"
        ],
        "summary": "Reports Request",
        "description": "Request an on-demand report for a saved search (``search_id``) or\ninline dashboard-query criteria. Generated by the worker\n(reports/worker.py), published as an unlisted page and emailed to the\nuser's address — hence 403 while it is unverified.\n\nPublished content may be reused, but every requested PDF carries the\ncurrent theme's immutable print/day snapshot. A re-click reuses the same\nrequest row: queued requests move to the latest snapshot, running ones\nkeep the snapshot already claimed, failed/done ones requeue with it.\nOnly requests that must generate new report content hit the LLM-cost caps;\nre-rendering published content with a personal theme is free. Multi-code\nqueries are rejected.",
        "operationId": "reports_request_api_reports_request_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportRequestReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportRequestResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/reports/requests": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Reports Requests",
        "description": "The signed-in user's report requests (newest first) plus the trial\ncaps and current usage, for the account panel.",
        "operationId": "reports_requests_api_reports_requests_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportRequestsResponse"
                }
              }
            }
          },
          "401": {
            "description": "No valid session, personal key or OAuth access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/reports/pdf-access": {
      "post": {
        "tags": [
          "reports"
        ],
        "summary": "Reports Pdf Access",
        "description": "The PDF gate's form endpoint. Always 303-redirects back to the report\npage — ``#pdf-sent`` whether the address is new, known or throttled (no\naccount-existence disclosure), ``#pdf-invalid`` when malformed. A verified\naccount gets the PDF emailed straight away; a new or unverified address\ngets the confirmation link. Re-requests within PDF_GATE_RESEND_MINUTES\nare silently absorbed.",
        "operationId": "reports_pdf_access_api_reports_pdf_access_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_reports_pdf_access_api_reports_pdf_access_post"
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "Back to the report page: `#pdf-sent`, or `#pdf-invalid` for a malformed address."
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reports/pdf-confirm": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Reports Pdf Confirm",
        "description": "Consume a PDF-gate confirmation token: mark the address verified,\nemail the PDF, then redirect into the account page's set-password form\n(the conversion pitch). An invalid/expired token lands on\n/account?verified=0.",
        "operationId": "reports_pdf_confirm_api_reports_pdf_confirm_get",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128,
              "default": "",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "To the account page's set-password form, or to `/account?verified=0` for an invalid or expired token."
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/reports/feedback": {
      "post": {
        "tags": [
          "reports"
        ],
        "summary": "Reports Feedback",
        "operationId": "reports_feedback_api_reports_feedback_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_reports_feedback_api_reports_feedback_post"
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "Back to the report page's `#vote-done`."
          },
          "204": {
            "description": "The vote was posted by the dashboard (`source=app`)."
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/api-key/generate": {
      "post": {
        "tags": [
          "api-key"
        ],
        "summary": "Auth Generate Api Key",
        "description": "Create (or rotate) the signed-in user's personal API key. The raw key\nis returned exactly once and cannot be shown again; any previously issued\nkey stops working immediately.",
        "operationId": "auth_generate_api_key_api_api_key_generate_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponse"
                }
              }
            }
          },
          "401": {
            "description": "No valid session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "A personal key or OAuth token was presented: this destructive or credential-issuing action requires an interactive session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    },
    "/api/api-key/revoke": {
      "post": {
        "tags": [
          "api-key"
        ],
        "summary": "Auth Revoke Api Key",
        "description": "Revoke the signed-in user's personal API key (idempotent).",
        "operationId": "auth_revoke_api_key_api_api_key_revoke_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "401": {
            "description": "No valid session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "A personal key or OAuth token was presented: this destructive or credential-issuing action requires an interactive session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Oauth Server Metadata",
        "description": "RFC 8414 authorization server metadata: lets an MCP client discover\nevery endpoint below given only the issuer origin.",
        "operationId": "oauth_server_metadata__well_known_oauth_authorization_server_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthServerMetadata"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/register": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Oauth Register Client",
        "description": "Register an MCP client only for local or explicitly approved vendor\ncallback origins. Every client is public and must use PKCE at the token\nendpoint.",
        "operationId": "oauth_register_client_oauth_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthClientRegistrationReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthClientRegistrationResponse"
                }
              }
            }
          },
          "400": {
            "description": "A malformed request: the OAuth error object (RFC 6749 section 5.2, RFC 7591 section 3.2.2) names the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/authorize": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Oauth Authorize Get",
        "description": "Entry point of the authorization flow, hit by the MCP client's system\nbrowser. Pure redirect logic, no HTML: ``client_id`` and ``redirect_uri``\nare validated *before* anything else (redirecting to an unvalidated URI\nwould be an open-redirect vulnerability); every other problem is reported\nby redirecting back to ``redirect_uri`` with an ``error`` parameter (RFC\n6749 §4.1.2.1). On success, hands off to ``static/oauth.html`` (login +\nconsent UI) with the same params.",
        "operationId": "oauth_authorize_get_oauth_authorize_get",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 32,
                  "pattern": "^[A-Za-z0-9_-]+$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Response Type"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9._~-]+$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Client Id"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2048,
                  "pattern": "^[\\x21-\\x7e]+$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Redirect Uri"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 43,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9._~-]+$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Code Challenge"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 32,
                  "pattern": "^[A-Za-z0-9_-]+$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Code Challenge Method"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2048,
                  "pattern": "^[\\x21-\\x7e]+$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512,
                  "pattern": "^[\\x21\\x23-\\x5b\\x5d-\\x7e]+(?: [\\x21\\x23-\\x5b\\x5d-\\x7e]+)*$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Scope"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024,
                  "pattern": "^[\\x21-\\x7e]+$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "State"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "To the login and consent page, or back to `redirect_uri` with an `error` parameter (RFC 6749 section 4.1.2.1)."
          },
          "400": {
            "description": "A malformed request: the OAuth error object (RFC 6749 section 5.2, RFC 7591 section 3.2.2) names the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Oauth Token",
        "description": "Token endpoint: exchanges an authorization code (PKCE-verified) or\nrotates a refresh token. Errors follow RFC 6749 §5.2 shape: the grant\ntype is taken as a bounded word and converted here, an unknown one\nanswering ``unsupported_grant_type`` rather than a 422; a parameter of\nthe wrong shape answers ``invalid_request``. Every access token is bound\nto the one resource this server fronts (RFC 8707): a request naming\nanother is ``invalid_target``, one naming none is bound to it.",
        "operationId": "oauth_token_oauth_token_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_oauth_token_oauth_token_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokens"
                }
              }
            }
          },
          "400": {
            "description": "A malformed request: the OAuth error object (RFC 6749 section 5.2, RFC 7591 section 3.2.2) names the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/revoke": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Oauth Revoke",
        "description": "Token revocation (RFC 7009). Always responds 200, whether or not the\ntoken was valid, so callers can't use this to probe token validity.",
        "operationId": "oauth_revoke_oauth_revoke_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_oauth_revoke_oauth_revoke_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object",
                  "title": "Response Oauth Revoke Oauth Revoke Post"
                }
              }
            }
          },
          "400": {
            "description": "A malformed request: the OAuth error object (RFC 6749 section 5.2, RFC 7591 section 3.2.2) names the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Accounts are temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/oauth/client-info": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Api Oauth Client Info",
        "description": "Public: lets oauth.html show which app is requesting access, and\nre-validates client_id/redirect_uri the same way ``oauth_authorize_get``\ndid (the static page cannot trust query params on its own).",
        "operationId": "api_oauth_client_info_api_oauth_client_info_get",
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._~-]+$",
              "title": "Client Id"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[\\x21-\\x7e]+$",
              "title": "Redirect Uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthClientInfoResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/oauth/decision": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Api Oauth Decision",
        "description": "Record the consent decision from oauth.html's script (session-gated).\nReturns ``{\"redirect_to\": ...}`` for the script to navigate to; never\nredirects itself, since it is called via ``fetch``.",
        "operationId": "api_oauth_decision_api_oauth_decision_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthDecisionReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthDecisionResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "A personal key or OAuth token was presented: this destructive or credential-issuing action requires an interactive session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    },
    "/api/oauth/grants": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "Api Oauth List Grants",
        "description": "Apps (MCP clients) currently authorized against the signed-in user's\naccount — the account panel's \"connected apps\" list.",
        "operationId": "api_oauth_list_grants_api_oauth_grants_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthGrantsResponse"
                }
              }
            }
          },
          "401": {
            "description": "No valid session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "A personal key or OAuth token was presented: this destructive or credential-issuing action requires an interactive session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    },
    "/api/oauth/grants/revoke": {
      "post": {
        "tags": [
          "oauth"
        ],
        "summary": "Api Oauth Revoke Grant",
        "description": "Disconnect one previously-authorized app: revokes every token issued\nto that client for this user.",
        "operationId": "api_oauth_revoke_grant_api_oauth_grants_revoke_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthGrantRevokeReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "422": {
            "description": "A malformed request: one sentence naming the fields, never their values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No valid session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "A personal key or OAuth token was presented: this destructive or credential-issuing action requires an interactive session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountResponse": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email",
            "description": "The account's email address."
          },
          "recent_searches": {
            "items": {
              "$ref": "#/components/schemas/SavedSearch"
            },
            "type": "array",
            "title": "Recent Searches",
            "description": "The search history, most recent first."
          },
          "saved_searches": {
            "items": {
              "$ref": "#/components/schemas/SavedSearch"
            },
            "type": "array",
            "title": "Saved Searches",
            "description": "The saved searches, most recently updated first."
          },
          "email_prefs": {
            "$ref": "#/components/schemas/EmailPrefs",
            "description": "The bulk-email opt-ins."
          },
          "theme_preferences": {
            "$ref": "#/components/schemas/ThemePreferences",
            "description": "The selected theme and account-wide Day/Night mode."
          },
          "custom_themes": {
            "items": {
              "$ref": "#/components/schemas/CustomThemeDefinition"
            },
            "type": "array",
            "title": "Custom Themes",
            "description": "Saved custom theme definitions, most recently updated first."
          },
          "active_custom_theme": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThemeResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "The selected custom theme's derived palettes; null for a built-in."
          },
          "has_api_key": {
            "type": "boolean",
            "title": "Has Api Key",
            "description": "Whether a personal API key is configured."
          },
          "api_key_created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Created At",
            "description": "When the API key was issued, when one is configured."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "recent_searches",
          "saved_searches",
          "email_prefs",
          "theme_preferences",
          "custom_themes",
          "active_custom_theme",
          "has_api_key"
        ],
        "title": "AccountResponse",
        "description": "POST /api/auth/login, GET /api/auth/me — the signed-in user's\naccount state."
      },
      "ApiKeyResponse": {
        "properties": {
          "api_key": {
            "type": "string",
            "title": "Api Key",
            "description": "The raw API key; it cannot be retrieved again."
          },
          "api_key_created_at": {
            "type": "string",
            "title": "Api Key Created At",
            "description": "When the key was issued."
          },
          "has_api_key": {
            "type": "boolean",
            "title": "Has Api Key",
            "description": "Always true after generation."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "api_key",
          "api_key_created_at",
          "has_api_key"
        ],
        "title": "ApiKeyResponse",
        "description": "POST /api/api-key/generate — the new key, shown exactly once."
      },
      "BalancePayload": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "quantity": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Quantity",
            "description": "The period-aligned net-mass balance (exports - imports, tonnes); null = no figure."
          },
          "value": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Value",
            "description": "The period-aligned value balance (exports - imports, EUR); null = no figure."
          },
          "incomplete": {
            "items": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Incomplete",
            "description": "Period-aligned flags marking the periods where one side of the subtraction was 0-filled for being missing/null."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "BalancePayload",
        "description": "The trade balance (exports - imports), from ``Presenter.balance``: the\nnetted quantity and value per period, and the cells where one side of the\nsubtraction was 0-filled for being missing/null."
      },
      "Basket": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "The basket's display label; default: the pieces' codes joined with '+'."
          },
          "pieces": {
            "items": {
              "$ref": "#/components/schemas/Piece"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Pieces",
            "description": "The pieces summed into this basket."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "pieces"
        ],
        "title": "Basket",
        "description": "A nonempty tuple of pieces summed into one displayed line."
      },
      "BasketPayload": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The basket's display label (the caller's label, or the pieces' codes joined)."
          },
          "pieces": {
            "items": {
              "$ref": "#/components/schemas/PiecePayload"
            },
            "type": "array",
            "title": "Pieces",
            "description": "The basket's pieces, in request order."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "label",
          "pieces"
        ],
        "title": "BasketPayload",
        "description": "How one requested basket was read: its label and its pieces."
      },
      "Body_oauth_revoke_oauth_revoke_post": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9._~+/=-]+$",
            "title": "Token"
          }
        },
        "type": "object",
        "required": [
          "token"
        ],
        "title": "Body_oauth_revoke_oauth_revoke_post"
      },
      "Body_oauth_token_oauth_token_post": {
        "properties": {
          "grant_type": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9:._-]+$",
            "title": "Grant Type"
          },
          "code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512,
                "minLength": 1,
                "pattern": "^[A-Za-z0-9._~+/=-]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "redirect_uri": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048,
                "minLength": 1,
                "pattern": "^[\\x21-\\x7e]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Redirect Uri"
          },
          "client_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^[A-Za-z0-9._~-]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "code_verifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 43,
                "pattern": "^[A-Za-z0-9._~-]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code Verifier"
          },
          "refresh_token": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512,
                "minLength": 1,
                "pattern": "^[A-Za-z0-9._~+/=-]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Token"
          },
          "resource": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048,
                "minLength": 1,
                "pattern": "^[\\x21-\\x7e]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource"
          }
        },
        "type": "object",
        "required": [
          "grant_type"
        ],
        "title": "Body_oauth_token_oauth_token_post"
      },
      "Body_reports_feedback_api_reports_feedback_post": {
        "properties": {
          "stem": {
            "type": "string",
            "maxLength": 200,
            "title": "Stem",
            "default": ""
          },
          "vote": {
            "type": "string",
            "maxLength": 200,
            "title": "Vote",
            "default": ""
          },
          "lang": {
            "type": "string",
            "maxLength": 200,
            "title": "Lang",
            "default": "en"
          },
          "source": {
            "type": "string",
            "maxLength": 200,
            "title": "Source",
            "default": "page"
          },
          "website": {
            "type": "string",
            "maxLength": 200,
            "title": "Website",
            "default": ""
          }
        },
        "type": "object",
        "title": "Body_reports_feedback_api_reports_feedback_post"
      },
      "Body_reports_pdf_access_api_reports_pdf_access_post": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "title": "Email",
            "default": ""
          },
          "stem": {
            "type": "string",
            "maxLength": 200,
            "title": "Stem",
            "default": ""
          },
          "lang": {
            "type": "string",
            "maxLength": 200,
            "title": "Lang",
            "default": "en"
          }
        },
        "type": "object",
        "title": "Body_reports_pdf_access_api_reports_pdf_access_post"
      },
      "CellSeries_ProdcomCellStatus_": {
        "items": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/ProdcomCellStatus"
            },
            {
              "type": "null"
            }
          ]
        },
        "type": "array"
      },
      "CellSeries_WireEnum_ProdcomCellFlag__": {
        "items": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/WireEnum_ProdcomCellFlag_"
            },
            {
              "type": "null"
            }
          ]
        },
        "type": "array"
      },
      "CellSeries_WireEnum_ProdcomGap__": {
        "items": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/WireEnum_ProdcomGap_"
            },
            {
              "type": "null"
            }
          ]
        },
        "type": "array"
      },
      "ChaptersResponse": {
        "properties": {
          "chapters": {
            "items": {
              "$ref": "#/components/schemas/CodeLabel_CustomsCode_"
            },
            "type": "array",
            "title": "Chapters",
            "description": "Every top-level CN chapter (2-digit code)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "chapters"
        ],
        "title": "ChaptersResponse",
        "description": "GET /api/reference/chapters — the top-level CN chapters."
      },
      "CodeHeader": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The queried customs code(s), as requested (several codes joined)."
          },
          "levels": {
            "items": {
              "$ref": "#/components/schemas/DescriptionLevel"
            },
            "type": "array",
            "title": "Levels",
            "description": "The customs code's CN description hierarchy, chapter first."
          },
          "customs_code_label": {
            "type": "string",
            "title": "Customs Code Label",
            "description": "The customs code's display label."
          },
          "frequency": {
            "$ref": "#/components/schemas/WireEnum_Frequency_",
            "description": "The period grain of every series in the payload ('year' for PRODCOM)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "levels",
          "customs_code_label",
          "frequency"
        ],
        "title": "CodeHeader",
        "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope)."
      },
      "CodeLabel_CustomsCode_": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "A canonical customs code, TOTAL, or a supported residual spelling."
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "text"
        ],
        "title": "CodeLabel[CustomsCode]"
      },
      "ComextStatusResponse": {
        "properties": {
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At",
            "description": "When the local Comext store last changed (ISO timestamp)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ComextStatusResponse",
        "description": "GET /api/reference/comext-status — last change of the local store."
      },
      "ComponentStatusPayload": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "indicator": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Indicator",
            "description": "The period-aligned indicator line; null = availability gap (see data_status)."
          },
          "components": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Components",
            "description": "{input: period-aligned component series the indicator is built from}."
          },
          "data_status": {
            "$ref": "#/components/schemas/DataStatusPayload",
            "description": "The per-period availability/reliability/rounding breakdown (empty arrays when the indicator has no data)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data_status"
        ],
        "title": "ComponentStatusPayload",
        "description": "One (measure, basis) trade-exposure result -- the wire mirror of\n``IndicatorComponentStatus``: the ratio line (``indicator``), the inputs\nit was built from (``components``) and the per-period status.  Empty (no\nperiods) when the indicator has no data."
      },
      "ConcentrationCompareFlow": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "volume": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Volume",
            "description": "{sub-code: period-aligned quantity-based HHI line}."
          },
          "value": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Value",
            "description": "{sub-code: period-aligned value-based HHI line}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ConcentrationCompareFlow",
        "description": "One flow's per-sub-code HHI lines (volume- and value-based)."
      },
      "ConcentrationComparePayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "breakdown": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NoBreakdown"
              },
              {
                "$ref": "#/components/schemas/SubcodeConcentration"
              }
            ],
            "title": "Breakdown",
            "description": "The HHI lines ('ok'), or why there are none ('leaf', 'unavailable').",
            "discriminator": {
              "propertyName": "state",
              "mapping": {
                "leaf": "#/components/schemas/NoBreakdown",
                "ok": "#/components/schemas/SubcodeConcentration"
              }
            }
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "breakdown"
        ],
        "title": "ConcentrationComparePayload",
        "description": "POST /api/concentration/concentration-compare — partner-concentration\ncompared across sub-codes, or why the code has none."
      },
      "ConcentrationMapPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "entity_level": {
            "$ref": "#/components/schemas/WireEnum_EntityLevel_",
            "description": "'partner' or 'reporter'."
          },
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year",
            "description": "The calendar year the cross-section is pinned to (latest full year when omitted); null when no full year exists."
          },
          "imports": {
            "$ref": "#/components/schemas/IndicatorCrossSections",
            "description": "The import HHI cross-sections."
          },
          "exports": {
            "$ref": "#/components/schemas/IndicatorCrossSections",
            "description": "The export HHI cross-sections."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "entity_level",
          "year",
          "imports",
          "exports"
        ],
        "title": "ConcentrationMapPayload",
        "description": "POST /api/concentration/concentration-map — cross-sectional HHI per\ncountry for one year."
      },
      "ConcentrationPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "entity_level": {
            "$ref": "#/components/schemas/WireEnum_EntityLevel_",
            "description": "'partner' or 'reporter'."
          },
          "partners": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Partners",
            "description": "The import/export map keys in reporter mode (empty in partner mode)."
          },
          "imports": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ConcentrationSeries"
            },
            "type": "object",
            "title": "Imports",
            "description": "{key: import HHI pair}."
          },
          "exports": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ConcentrationSeries"
            },
            "type": "object",
            "title": "Exports",
            "description": "{key: export HHI pair}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "entity_level",
          "partners",
          "imports",
          "exports"
        ],
        "title": "ConcentrationPayload",
        "description": "POST /api/concentration/concentration — per-flow HHI series.\n\n``imports`` / ``exports`` are always maps: keyed by partner name in\nreporter mode (one entry per top partner), and by the reporter label in\npartner mode (a single entry).  ``partners`` lists the keys in reporter\nmode."
      },
      "ConcentrationSeries": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "volume": {
            "$ref": "#/components/schemas/ConcentrationSide",
            "description": "The quantity-based HHI."
          },
          "value": {
            "$ref": "#/components/schemas/ConcentrationSide",
            "description": "The value-based HHI."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ConcentrationSeries",
        "description": "The volume + value HHI pair for one flow."
      },
      "ConcentrationSide": {
        "properties": {
          "indicator": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Indicator",
            "description": "The period-aligned HHI line (0-10000; higher = more concentrated)."
          },
          "columns": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Columns",
            "description": "The entity order the components are keyed by (top-N + Others)."
          },
          "components": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Components",
            "description": "{entity: period-aligned absolute values the HHI shares are computed from}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ConcentrationSide",
        "description": "One indicator's HHI line plus the breakdown it is built from -- the\nwire mirror of ``core.computation.shapes.IndicatorComponents`` over a period\nSeries, with ``columns`` fixing the entity order (top-N + Others)."
      },
      "ConsentDecision": {
        "type": "string",
        "enum": [
          "approve",
          "deny"
        ],
        "title": "ConsentDecision",
        "description": "The user's answer on the OAuth consent page."
      },
      "CountriesResponse": {
        "properties": {
          "reporters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Reporters",
            "description": "Selectable reporters (EU Member States)."
          },
          "reporter_presets": {
            "items": {
              "$ref": "#/components/schemas/ReporterPreset"
            },
            "type": "array",
            "title": "Reporter Presets",
            "description": "The aggregate reporter presets (EU, euro area, candidates)."
          },
          "candidate_reporters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Candidate Reporters",
            "description": "EU candidate countries, selectable as reporters."
          },
          "other_reporters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Other Reporters",
            "description": "Other selectable reporters (Northern Ireland)."
          },
          "reporter_groups": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Reporter Groups",
            "description": "Predefined reporter groups: {group name: [reporters]}."
          },
          "partner_presets": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Partner Presets",
            "description": "Named partner-set presets (e.g. 'non-EU countries')."
          },
          "partner_groups": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Partner Groups",
            "description": "Predefined partner groups: {group name: [partners]}."
          },
          "all_partners": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "All Partners",
            "description": "Every selectable partner country."
          },
          "eu_countries": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Eu Countries",
            "description": "The EU Member States."
          },
          "translations": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": "object",
            "title": "Translations",
            "description": "{English name: {lang: translated name}} for every individual country."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "reporters",
          "reporter_presets",
          "candidate_reporters",
          "other_reporters",
          "reporter_groups",
          "partner_presets",
          "partner_groups",
          "all_partners",
          "eu_countries",
          "translations"
        ],
        "title": "CountriesResponse",
        "description": "GET /api/reference/countries — country reference data for the sidebar\nselectors."
      },
      "Coverage": {
        "properties": {
          "min": {
            "type": "string",
            "title": "Min"
          },
          "max": {
            "type": "string",
            "title": "Max"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "min",
          "max"
        ],
        "title": "Coverage",
        "description": "Local store span: 'YYYY-MM' for COMEXT, 'YYYY' for PRODCOM."
      },
      "CoverageKind": {
        "type": "string",
        "enum": [
          "reporter_coverage",
          "total_only_period",
          "unmapped_country_code",
          "no_residuals_stored",
          "outliers_nulled",
          "supp_unit_mixed",
          "supp_coverage_gate",
          "partial_bucket",
          "component_empty",
          "negative_values",
          "cn8_residual_sibling",
          "group_residual_above"
        ],
        "title": "CoverageKind",
        "description": "The kinds of coverage note."
      },
      "CoverageWindow": {
        "properties": {
          "data_min": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Data Min",
            "description": "The first month with data inside the window ('YYYY-MM')."
          },
          "data_max": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Data Max",
            "description": "The last month with data inside the window ('YYYY-MM')."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data_min",
          "data_max"
        ],
        "title": "CoverageWindow"
      },
      "CrossSectionTriplet": {
        "properties": {
          "quantity": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Quantity",
            "description": "{entity: net mass (tonnes)}; null = not reported."
          },
          "value": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Value",
            "description": "{entity: value (EUR)}; null = not reported."
          },
          "price": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Price",
            "description": "{entity: weighted-average price}; null = not reported."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CrossSectionTriplet",
        "description": "A time-collapsed quantity / value / price cross-section: each field\n``{entity: value}`` (GISCO-keyed on the map views)."
      },
      "CustomThemeDefinition": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "primary": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Primary",
            "description": "An sRGB colour, #RRGGBB."
          },
          "secondary": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Secondary",
            "description": "An sRGB colour, #RRGGBB."
          },
          "created_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updated_at": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "primary",
          "secondary",
          "created_at",
          "updated_at"
        ],
        "title": "CustomThemeDefinition",
        "description": "One saved custom theme's inputs; derived palettes are never stored."
      },
      "CustomThemeRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "English, French or German letters, digits 0-9 and spaces, at most 20 characters; stored lowercase."
          },
          "primary": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Primary",
            "description": "Base colour: darker, primary, chart slot 1."
          },
          "secondary": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Secondary",
            "description": "Accent colour: lighter, secondary, chart slot 2."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "primary",
          "secondary"
        ],
        "title": "CustomThemeRequest",
        "description": "Create or update a custom theme."
      },
      "CustomsCodeLevel": {
        "type": "string",
        "enum": [
          "chapter",
          "heading",
          "subheading",
          "cn8",
          "total"
        ],
        "title": "CustomsCodeLevel"
      },
      "DashboardQuery": {
        "properties": {
          "reporter": {
            "type": "string",
            "maxLength": 120,
            "title": "Reporter",
            "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
            "default": "European Union"
          },
          "group_reporters": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Reporters",
            "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
          },
          "partner_set": {
            "type": "string",
            "maxLength": 120,
            "title": "Partner Set",
            "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
            "default": "non-EU countries"
          },
          "partners": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Partners",
            "description": "Explicit partner-country list that overrides 'partner_set' when present."
          },
          "period_start": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Period Start",
            "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
            "default": {
              "year": 2015,
              "month": 1
            }
          },
          "frequency": {
            "$ref": "#/components/schemas/Frequency",
            "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'.",
            "default": "quarter"
          },
          "remove_outliers": {
            "type": "boolean",
            "title": "Remove Outliers",
            "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
            "default": true
          },
          "customs_code": {
            "anyOf": [
              {
                "type": "string",
                "description": "A canonical customs code, TOTAL, or a supported residual spelling."
              },
              {
                "items": {
                  "type": "string",
                  "description": "A canonical customs code, TOTAL, or a supported residual spelling."
                },
                "type": "array",
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Customs Code",
            "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
            "examples": [
              "3801",
              [
                "0901",
                "0902"
              ],
              "TOTAL",
              "850440XX",
              "85SSS"
            ]
          },
          "baskets": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Basket"
                },
                "type": "array",
                "maxItems": 50,
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Baskets",
            "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
          },
          "period_end": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Period End",
            "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported."
          },
          "n_top": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "N Top",
            "description": "Number of top entities (by volume/value) to break out individually in charts.",
            "default": 7
          },
          "include_other": {
            "type": "boolean",
            "title": "Include Other",
            "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
            "default": true
          },
          "include_residuals": {
            "type": "boolean",
            "title": "Include Residuals",
            "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
            "default": true
          },
          "lang": {
            "type": "string",
            "enum": [
              "bg",
              "cs",
              "da",
              "de",
              "el",
              "en",
              "es",
              "et",
              "fi",
              "fr",
              "ga",
              "hr",
              "hu",
              "it",
              "lt",
              "lv",
              "mt",
              "nl",
              "pl",
              "pt",
              "ro",
              "sk",
              "sl",
              "sv"
            ],
            "title": "Lang",
            "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
            "default": "en"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DashboardQuery",
        "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body."
      },
      "DataProvenance": {
        "properties": {
          "store_generation": {
            "type": "string",
            "title": "Store Generation",
            "description": "The trade store's completed-build generation."
          },
          "metadata_generation": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata Generation",
            "description": "The CN classification snapshot's generation; null when none is published."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "store_generation",
          "metadata_generation"
        ],
        "title": "DataProvenance",
        "description": "The published data a response was computed from."
      },
      "DataRangeResponse": {
        "properties": {
          "data_min": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Min",
            "description": "The first month with data in the local store, over the codes' raw declarations (every definition)."
          },
          "data_max": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Max",
            "description": "The last month with data in the local store, over the codes' raw declarations."
          },
          "selection": {
            "items": {
              "$ref": "#/components/schemas/SelectedCoveragePayload"
            },
            "type": "array",
            "title": "Selection",
            "description": "For each piece given (the basket request form), the coverage of its window -- separate from the raw base coverage above."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DataRangeResponse",
        "description": "GET /api/reference/data-range — cached period coverage ('YYYY-MM')."
      },
      "DataStatusPayload": {
        "properties": {
          "availability": {
            "$ref": "#/components/schemas/CellSeries_WireEnum_ProdcomCellFlag__",
            "description": "Per period: the most-severe suppression flag across the components (confidential, not_available, low_quality, not_applicable); null = none suppressed."
          },
          "gap": {
            "$ref": "#/components/schemas/CellSeries_WireEnum_ProdcomGap__",
            "description": "Per period: why the indicator is not computable although every component is present (a formula gap); null = no gap."
          },
          "reliability": {
            "$ref": "#/components/schemas/CellSeries_ProdcomCellStatus_",
            "description": "Per period, where the figure is usable: the worst component flag and whether a component covers only some of its codes (partial), when that needs a caveat; null = no caveat (or suppressed)."
          },
          "components": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CellSeries_ProdcomCellStatus_"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_ProdcomIndicator_"
            },
            "type": "object",
            "title": "Components",
            "description": "{component indicator: per-period flag and partial coverage of that component's cell}."
          },
          "rounding_band": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Rounding Band",
            "description": "Per period: the largest component rounding base."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "availability",
          "gap",
          "reliability",
          "components",
          "rounding_band"
        ],
        "title": "DataStatusPayload",
        "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` pair of ``flag`` and ``partial``) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout."
      },
      "DataStatusResponse": {
        "properties": {
          "comext": {
            "$ref": "#/components/schemas/DatasetStatus"
          },
          "prodcom": {
            "$ref": "#/components/schemas/DatasetStatus"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "comext",
          "prodcom"
        ],
        "title": "DataStatusResponse",
        "description": "GET /api/reference/data-status — freshness of both mirrored datasets."
      },
      "DatasetStatus": {
        "properties": {
          "dataset": {
            "type": "string",
            "title": "Dataset"
          },
          "upstream_modified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Modified"
          },
          "imported_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Imported At"
          },
          "coverage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Coverage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "dataset"
        ],
        "title": "DatasetStatus"
      },
      "DeleteAccountReq": {
        "properties": {
          "password": {
            "type": "string",
            "maxLength": 1024,
            "title": "Password"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "password"
        ],
        "title": "DeleteAccountReq"
      },
      "DescriptionLevel": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The level's customs code."
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "The level's label, in the requested language."
          },
          "untranslated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Untranslated",
            "description": "True when the label fell back to English."
          },
          "is_catch_all": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Catch All",
            "description": "True for a catch-all ('other') level."
          },
          "siblings": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CodeLabel_CustomsCode_"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Siblings",
            "description": "For a catch-all level, the ordinary siblings it excludes."
          },
          "segment": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Segment",
            "description": "True for a historical segment's own definition."
          },
          "residual": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Residual",
            "description": "True for the synthetic level of a residual spelling."
          },
          "window": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SegmentWindow"
              },
              {
                "type": "null"
              }
            ],
            "description": "For a level read from a dated edition (a former definition, or one of its ancestors as that edition had them): the validity window of the definition shown. Absent for current-edition levels."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "text"
        ],
        "title": "DescriptionLevel",
        "description": "One level of a customs code's description hierarchy, chapter first\n(``ComextNomenclature.get_description_levels``, plus the synthetic\nlevels of residual spellings and the dated levels of former editions).\n\nThe optional flags are sparse on the wire: present when true, absent\notherwise (the shape of the nomenclature layer's raw dicts)."
      },
      "EmailPrefs": {
        "properties": {
          "newsletter": {
            "$ref": "#/components/schemas/Flag",
            "description": "Receives the newsletter."
          },
          "announcements": {
            "$ref": "#/components/schemas/Flag",
            "description": "Receives product announcements."
          },
          "updates": {
            "$ref": "#/components/schemas/Flag",
            "description": "Receives database-update notices."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "newsletter",
          "announcements",
          "updates"
        ],
        "title": "EmailPrefs",
        "description": "A user's three bulk-email opt-ins, supplied together in an update\nrequest or read from an ``email_prefs`` row (its ``*_opt_in`` columns\naliased to these names)."
      },
      "EmailPrefsResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok",
            "description": "Always true: failures are HTTP errors."
          },
          "email_prefs": {
            "$ref": "#/components/schemas/EmailPrefs",
            "description": "The opt-ins as now stored."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "email_prefs"
        ],
        "title": "EmailPrefsResponse",
        "description": "POST /api/auth/email-prefs — the updated opt-ins."
      },
      "EmailReq": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "title": "Email"
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "de"
            ],
            "title": "Lang",
            "default": "en"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email"
        ],
        "title": "EmailReq"
      },
      "EmptySliceHint": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Where the trade sits instead, and what to query."
          },
          "residual_code": {
            "type": "string",
            "title": "Residual Code",
            "description": "The residual spelling that carries the trade (e.g. '8504XX')."
          },
          "parent_code": {
            "type": "string",
            "title": "Parent Code",
            "description": "The code the residual sits directly under."
          },
          "level": {
            "$ref": "#/components/schemas/WireEnum_CustomsCodeLevel_",
            "description": "The CN level of parent_code."
          },
          "value_eur": {
            "type": "integer",
            "title": "Value Eur",
            "description": "The trade value the residual carries under the request's filters (EUR, rounded)."
          },
          "years": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Years",
            "description": "The years named ('2019' or '2019–2021'); null when the request's period is open-ended."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "residual_code",
          "parent_code",
          "level",
          "value_eur",
          "years"
        ],
        "title": "EmptySliceHint",
        "description": "The structured detail of an empty slice's 404 when a residual code of\nan ancestor carries the trade (``ResidualService.empty_hint``): the sentence\nplus the facts it names, so clients never parse the prose."
      },
      "EnteredCodeExposure": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The entered customs code."
          },
          "prodcom": {
            "$ref": "#/components/schemas/ProdcomMetaPayload",
            "description": "How it resolved to PRODCOM; unavailability_type is set when it has no usable EU27 data."
          },
          "data": {
            "additionalProperties": {
              "additionalProperties": {
                "$ref": "#/components/schemas/ComponentStatusPayload"
              },
              "propertyNames": {
                "$ref": "#/components/schemas/WireEnum_ProductionBasis_"
              },
              "type": "object"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_Measure_"
            },
            "type": "object",
            "title": "Data",
            "description": "Its measure × basis indicator matrix; empty when unavailable."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "prodcom",
          "data"
        ],
        "title": "EnteredCodeExposure",
        "description": "One entered customs code of a multi-code comparison."
      },
      "EnteredCodesComparison": {
        "properties": {
          "mode": {
            "type": "string",
            "const": "multi",
            "title": "Mode",
            "default": "multi"
          },
          "aggregable": {
            "type": "boolean",
            "title": "Aggregable",
            "description": "Whether the codes may be summed: every code has data and all their PRODCOM codes sit at one hierarchy level."
          },
          "data": {
            "additionalProperties": {
              "additionalProperties": {
                "$ref": "#/components/schemas/ComponentStatusPayload"
              },
              "propertyNames": {
                "$ref": "#/components/schemas/WireEnum_ProductionBasis_"
              },
              "type": "object"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_Measure_"
            },
            "type": "object",
            "title": "Data",
            "description": "The aggregate's measure × basis indicator matrix; empty when not aggregable."
          },
          "prodcom_unit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UnitDescriptor"
              },
              {
                "type": "null"
              }
            ],
            "description": "The aggregate's PRODCOM quantity unit, when it carries one."
          },
          "codes": {
            "items": {
              "$ref": "#/components/schemas/EnteredCodeExposure"
            },
            "type": "array",
            "title": "Codes",
            "description": "Every entered code, in request order."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "aggregable",
          "data",
          "prodcom_unit",
          "codes"
        ],
        "title": "EnteredCodesComparison",
        "description": "Multi-code mode: the entered customs codes compared directly, plus\ntheir aggregate when it is a valid sum."
      },
      "EntityBreakdowns": {
        "properties": {
          "imports": {
            "$ref": "#/components/schemas/PanelPayload",
            "description": "The import panel, ranked by quantity."
          },
          "exports": {
            "$ref": "#/components/schemas/PanelPayload",
            "description": "The export panel, ranked by quantity."
          },
          "imports_by_value": {
            "$ref": "#/components/schemas/PanelPayload",
            "description": "The import panel, ranked by value."
          },
          "exports_by_value": {
            "$ref": "#/components/schemas/PanelPayload",
            "description": "The export panel, ranked by value."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "imports",
          "exports",
          "imports_by_value",
          "exports_by_value"
        ],
        "title": "EntityBreakdowns",
        "description": "The top-N entity panels of the partner-/reporter-detail endpoints,\nranked by quantity and by value so the client can re-rank without a\nsecond request."
      },
      "EntityDetailPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "custom_selection": {
            "type": "boolean",
            "title": "Custom Selection",
            "description": "True when the partners come from an explicit list rather than a preset (partner-detail only)."
          },
          "supp_unit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UnitDescriptor"
              },
              {
                "type": "null"
              }
            ],
            "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
          },
          "entities": {
            "$ref": "#/components/schemas/EntityBreakdowns",
            "description": "The top-N partner (or Member-State) panels, per flow, ranked by quantity and by value."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "custom_selection",
          "supp_unit",
          "entities"
        ],
        "title": "EntityDetailPayload",
        "description": "POST /api/descriptive/partner-detail and /reporter-detail — the top-N\nentity panels, ranked by quantity and by value.  ``custom_selection``\nmarks an explicit partner list (partner-detail only)."
      },
      "EntityLevel": {
        "type": "string",
        "enum": [
          "partner",
          "reporter"
        ],
        "title": "EntityLevel",
        "description": "The geographic axis an analysis ranks or folds."
      },
      "ErrorBody": {
        "additionalProperties": false,
        "description": "The dashboard's error envelope: a refused request is answered with one\nhuman-readable sentence (``HTTPException.detail`` is a string, always;\nmaintenance/checks/error_details.py). The OAuth protocol endpoints answer\nin the RFCs' own format instead (``OAuthErrorBody``).",
        "properties": {
          "detail": {
            "description": "What was refused and why, as one sentence.",
            "title": "Detail",
            "type": "string"
          }
        },
        "required": [
          "detail"
        ],
        "title": "ErrorBody",
        "type": "object"
      },
      "ErrorFrame": {
        "properties": {
          "type": {
            "type": "string",
            "const": "error",
            "title": "Type",
            "default": "error"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/EmptySliceHint"
              }
            ],
            "title": "Detail",
            "description": "The error message, or the structured empty-slice hint."
          },
          "status": {
            "type": "integer",
            "title": "Status",
            "description": "The HTTP status."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "detail",
          "status"
        ],
        "title": "ErrorFrame",
        "description": "The terminal frame when the work fails: the explained status and\ndetail, or a 500 for an unhandled error."
      },
      "EuProductionBlock": {
        "properties": {
          "quantity": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Quantity",
            "description": "The period-aligned EU27 production quantity (the PRODCOM unit); null = no figure."
          },
          "value": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Value",
            "description": "The period-aligned EU27 production value (EUR); null = no figure."
          },
          "price": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Price",
            "description": "The period-aligned EU27 production unit value (value per quantity unit); null = no figure."
          },
          "data_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataStatusPayload"
              },
              {
                "type": "null"
              }
            ],
            "description": "The EU27 figure's per-period status; null when the basis has no EU27 aggregate."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "EuProductionBlock",
        "description": "EU27 production quantity, value and unit value of one basis, with the\ndata status of the EU figure -- the wire mirror of the EU\n``TripletGeoStatus``.  Arrays are parallel to the owning series' period axis."
      },
      "ExposureIndicator": {
        "type": "string",
        "enum": [
          "net_import_reliance",
          "trade_intensity",
          "export_propensity"
        ],
        "title": "ExposureIndicator",
        "description": "The three EU27 trade-exposure indicators."
      },
      "ExposurePayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/CodeHeader",
            "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
          },
          "indicator": {
            "$ref": "#/components/schemas/WireEnum_ExposureIndicator_",
            "description": "Which of the three EU27 trade-exposure indicators this payload carries."
          },
          "comparison": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SiblingComparison"
              },
              {
                "$ref": "#/components/schemas/EnteredCodesComparison"
              }
            ],
            "title": "Comparison",
            "description": "The indicator figures: one code against its PRODCOM siblings ('single'), or the entered codes side by side ('multi').",
            "discriminator": {
              "propertyName": "mode",
              "mapping": {
                "multi": "#/components/schemas/EnteredCodesComparison",
                "single": "#/components/schemas/SiblingComparison"
              }
            }
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "indicator",
          "comparison"
        ],
        "title": "ExposurePayload",
        "description": "POST /api/vulnerability/{net-import-reliance,trade-intensity,\nexport-propensity} — one shared shape; ``indicator`` says which."
      },
      "Flag": {
        "type": "boolean"
      },
      "Flow": {
        "type": "string",
        "enum": [
          "Imports",
          "Exports"
        ],
        "title": "Flow",
        "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports)."
      },
      "FlowBlocks": {
        "properties": {
          "imports": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PatternShiftBlock"
              },
              {
                "type": "null"
              }
            ],
            "description": "The import scatter (null when not computable)."
          },
          "exports": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PatternShiftBlock"
              },
              {
                "type": "null"
              }
            ],
            "description": "The export scatter (null when not computable)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FlowBlocks",
        "description": "Per-flow blocks, either of which may be absent (not computable)."
      },
      "FlowCrossSections": {
        "properties": {
          "imports": {
            "$ref": "#/components/schemas/CrossSectionTriplet",
            "description": "The import cross-sections."
          },
          "exports": {
            "$ref": "#/components/schemas/CrossSectionTriplet",
            "description": "The export cross-sections."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "imports",
          "exports"
        ],
        "title": "FlowCrossSections",
        "description": "Per-flow cross-sections for one scope (reporters or partners)."
      },
      "Frame_ConcentrationComparePayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ConcentrationComparePayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ConcentrationComparePayload_"
          }
        }
      },
      "Frame_ConcentrationMapPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ConcentrationMapPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ConcentrationMapPayload_"
          }
        }
      },
      "Frame_ConcentrationPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ConcentrationPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ConcentrationPayload_"
          }
        }
      },
      "Frame_EntityDetailPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_EntityDetailPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_EntityDetailPayload_"
          }
        }
      },
      "Frame_ExposurePayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ExposurePayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ExposurePayload_"
          }
        }
      },
      "Frame_MapDataPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_MapDataPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_MapDataPayload_"
          }
        }
      },
      "Frame_OverviewPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_OverviewPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_OverviewPayload_"
          }
        }
      },
      "Frame_PatternShiftPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_PatternShiftPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_PatternShiftPayload_"
          }
        }
      },
      "Frame_ProductionConcentrationPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ProductionConcentrationPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ProductionConcentrationPayload_"
          }
        }
      },
      "Frame_ProductionSeriesPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ProductionSeriesPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ProductionSeriesPayload_"
          }
        }
      },
      "Frame_ReporterBenchmarkPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ReporterBenchmarkPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ReporterBenchmarkPayload_"
          }
        }
      },
      "Frame_ShocksEndpointPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_ShocksEndpointPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_ShocksEndpointPayload_"
          }
        }
      },
      "Frame_SpecialisationPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_SpecialisationPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_SpecialisationPayload_"
          }
        }
      },
      "Frame_SubcodeComparePayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_SubcodeComparePayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_SubcodeComparePayload_"
          }
        }
      },
      "Frame_SubcontractingIntensityPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_SubcontractingIntensityPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_SubcontractingIntensityPayload_"
          }
        }
      },
      "Frame_SubcontractingReportersPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_SubcontractingReportersPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_SubcontractingReportersPayload_"
          }
        }
      },
      "Frame_TopEntitiesPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_TopEntitiesPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_TopEntitiesPayload_"
          }
        }
      },
      "Frame_VolatilityPayload_": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProgressFrame"
          },
          {
            "$ref": "#/components/schemas/ResultFrame_VolatilityPayload_"
          },
          {
            "$ref": "#/components/schemas/ErrorFrame"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "error": "#/components/schemas/ErrorFrame",
            "progress": "#/components/schemas/ProgressFrame",
            "result": "#/components/schemas/ResultFrame_VolatilityPayload_"
          }
        }
      },
      "Frequency": {
        "type": "string",
        "enum": [
          "month",
          "quarter",
          "year"
        ],
        "title": "Frequency",
        "description": "The resampling frequency of a series."
      },
      "GeoIntensityBlock": {
        "properties": {
          "indicator": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Indicator",
            "description": "{country name: period-aligned intensity}; null = suppressed or not reported."
          },
          "components": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Components",
            "description": "{country name: period-aligned sub-contracted production behind the intensity}."
          },
          "data_status": {
            "additionalProperties": {
              "$ref": "#/components/schemas/DataStatusPayload"
            },
            "type": "object",
            "title": "Data Status",
            "description": "{country name: its per-period status}."
          },
          "intensity_map": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Intensity Map",
            "description": "{GISCO code: latest-year intensity} (choropleth view)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "GeoIntensityBlock",
        "description": "A per-reporter intensity panel plus its GISCO-keyed choropleth map."
      },
      "IndicatorCrossSections": {
        "properties": {
          "quantity": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Quantity",
            "description": "{entity: quantity-based HHI}."
          },
          "value": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Value",
            "description": "{entity: value-based HHI}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "IndicatorCrossSections",
        "description": "Per-indicator cross-sections (quantity / value) keyed by GISCO code."
      },
      "Lang": {
        "type": "string",
        "enum": [
          "bg",
          "cs",
          "da",
          "de",
          "el",
          "en",
          "es",
          "et",
          "fi",
          "fr",
          "ga",
          "hr",
          "hu",
          "it",
          "lt",
          "lv",
          "mt",
          "nl",
          "pl",
          "pt",
          "ro",
          "sk",
          "sl",
          "sv",
          "ja",
          "zh"
        ],
        "title": "Lang",
        "description": "Every language code the data or the published reports use. The value\nis the code itself: the same string in URLs, sqlite, JSON and file names.\n``JA`` and ``ZH`` have no metadata: their reports take English labels and\nexist as HTML pages only. Build a value with ``Lang(code)``, which raises\non any other code."
      },
      "LanguageResponse": {
        "properties": {
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "de"
            ],
            "title": "Lang",
            "description": "The detected UI language code."
          },
          "source": {
            "$ref": "#/components/schemas/WireEnum_LanguageSource_",
            "description": "Where the language came from: explicit cookie, browser header, or the default."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "lang",
          "source"
        ],
        "title": "LanguageResponse",
        "description": "GET /api/reference/language — the preferred UI language and where it\ncame from."
      },
      "LanguageSource": {
        "type": "string",
        "enum": [
          "cookie",
          "accept-language",
          "default"
        ],
        "title": "LanguageSource",
        "description": "Where a first-time visitor's detected UI language came from."
      },
      "LoginReq": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 1024,
            "title": "Password"
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "de"
            ],
            "title": "Lang",
            "default": "en"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "LoginReq"
      },
      "MapDataPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "totals": {
            "$ref": "#/components/schemas/MapTotalsPayload",
            "description": "Per-reporter and per-partner cross-sections, per flow (GISCO-keyed)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "totals"
        ],
        "title": "MapDataPayload",
        "description": "POST /api/descriptive/map-data — choropleth aggregates."
      },
      "MapTotalsPayload": {
        "properties": {
          "reporters": {
            "$ref": "#/components/schemas/FlowCrossSections",
            "description": "Per-reporter cross-sections (GISCO-keyed)."
          },
          "partners": {
            "$ref": "#/components/schemas/FlowCrossSections",
            "description": "Per-partner cross-sections (GISCO-keyed)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "reporters",
          "partners"
        ],
        "title": "MapTotalsPayload",
        "description": "Choropleth aggregates, from ``Presenter.map_totals``: per scope × flow,\na cross-section triplet keyed by GISCO code."
      },
      "MatchedProdcom": {
        "properties": {
          "prodcom_code": {
            "type": "string",
            "title": "Prodcom Code",
            "description": "The resolved PRODCOM code, in dotted form.",
            "examples": [
              "23.99.14",
              "24.10.T3.40"
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "The code's label, when the nomenclature lists one."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prodcom_code",
          "description"
        ],
        "title": "MatchedProdcom",
        "description": "The PRODCOM code resolved from a dotted search query."
      },
      "Measure": {
        "type": "string",
        "enum": [
          "value",
          "quantity",
          "price"
        ],
        "title": "Measure",
        "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only)."
      },
      "NoBreakdown": {
        "properties": {
          "state": {
            "type": "string",
            "const": "leaf",
            "title": "State"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Why there is no breakdown."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "state",
          "message"
        ],
        "title": "NoBreakdown",
        "description": "A sub-code expansion that cannot be served: the code is a leaf in the\nrequested window."
      },
      "NotePayload": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/WireEnum_CoverageKind_",
            "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
          },
          "severity": {
            "$ref": "#/components/schemas/WireEnum_Severity_",
            "description": "'warning' when the figures are affected, 'info' otherwise."
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Fixed English text of the kind; slice-specific facts are in args."
          },
          "basket_refs": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Basket Refs",
            "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice."
          },
          "args": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Args",
            "description": "The note's structured facts (codes, windows, counts, shares)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "severity",
          "message",
          "basket_refs",
          "args"
        ],
        "title": "NotePayload",
        "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served)."
      },
      "OAuthClientInfoResponse": {
        "properties": {
          "client_name": {
            "type": "string",
            "title": "Client Name",
            "description": "The requesting client's display name."
          },
          "contact_email": {
            "type": "string",
            "title": "Contact Email",
            "description": "The client's registration contact, or ''."
          },
          "redirect_uri": {
            "type": "string",
            "title": "Redirect Uri",
            "description": "The validated callback URL."
          },
          "redirect_host": {
            "type": "string",
            "title": "Redirect Host",
            "description": "The callback URL's host."
          },
          "redirect_kind": {
            "$ref": "#/components/schemas/WireEnum_RedirectKind_",
            "description": "'local' for loopback callbacks, 'vendor' for an approved hosted vendor's."
          },
          "vendor_name": {
            "type": "string",
            "title": "Vendor Name",
            "description": "The approved vendor's name, or ''."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_name",
          "contact_email",
          "redirect_uri",
          "redirect_host",
          "redirect_kind",
          "vendor_name"
        ],
        "title": "OAuthClientInfoResponse",
        "description": "GET /api/oauth/client-info — what the consent page shows."
      },
      "OAuthClientRegistrationReq": {
        "properties": {
          "redirect_uris": {
            "items": {
              "type": "string",
              "maxLength": 2048,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "title": "Redirect Uris"
          },
          "client_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Name"
          },
          "contacts": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 254
                },
                "type": "array",
                "maxItems": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Contacts"
          }
        },
        "type": "object",
        "required": [
          "redirect_uris"
        ],
        "title": "OAuthClientRegistrationReq",
        "description": "Dynamic Client Registration (RFC 7591) request body.\n\nEvery registered client is \"public\" (no client_secret) with mandatory\nPKCE -- see ``api.users.oauth.OAuthStore.register_oauth_client``. Only the\nhandful of fields this bridge actually uses are declared; unknown fields\nreal clients send (``token_endpoint_auth_method``, ``grant_types``, ...)\nare ignored rather than rejected. Anyone may register, so every field is\nbounded: the redirect URIs still have to pass the loopback/vendor\nallowlist, and the name and contacts are what the account holder is\nshown when asked to connect the app."
      },
      "OAuthClientRegistrationResponse": {
        "properties": {
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "The issued client identifier."
          },
          "client_name": {
            "type": "string",
            "title": "Client Name",
            "description": "The client's display name."
          },
          "redirect_uris": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Redirect Uris",
            "description": "The registered callback URLs."
          },
          "token_endpoint_auth_method": {
            "type": "string",
            "title": "Token Endpoint Auth Method",
            "description": "Always 'none': every client is public and uses PKCE."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_id",
          "client_name",
          "redirect_uris",
          "token_endpoint_auth_method"
        ],
        "title": "OAuthClientRegistrationResponse",
        "description": "POST /oauth/register — the registered public client (RFC 7591)."
      },
      "OAuthDecisionReq": {
        "properties": {
          "client_id": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9._~-]+$",
            "title": "Client Id"
          },
          "redirect_uri": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "pattern": "^[\\x21-\\x7e]+$",
            "title": "Redirect Uri"
          },
          "code_challenge": {
            "type": "string",
            "maxLength": 128,
            "minLength": 43,
            "pattern": "^[A-Za-z0-9._~-]+$",
            "title": "Code Challenge"
          },
          "decision": {
            "$ref": "#/components/schemas/WireEnum_ConsentDecision_"
          },
          "resource": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048,
                "minLength": 1,
                "pattern": "^[\\x21-\\x7e]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512,
                "minLength": 1,
                "pattern": "^[\\x21\\x23-\\x5b\\x5d-\\x7e]+(?: [\\x21\\x23-\\x5b\\x5d-\\x7e]+)*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          },
          "state": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[\\x21-\\x7e]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_id",
          "redirect_uri",
          "code_challenge",
          "decision"
        ],
        "title": "OAuthDecisionReq",
        "description": "Consent decision from static/oauth.html's script -- the JSON\ncounterpart of the ``client_id``/``redirect_uri``/... query params\n``/oauth/authorize`` was originally called with. An optional one sent\nempty is absent, as on the authorization request itself."
      },
      "OAuthDecisionResponse": {
        "properties": {
          "redirect_to": {
            "type": "string",
            "title": "Redirect To",
            "description": "The client callback URL, carrying the code or the error."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "redirect_to"
        ],
        "title": "OAuthDecisionResponse",
        "description": "POST /api/oauth/decision — where the consent page navigates next."
      },
      "OAuthGrant": {
        "properties": {
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "The client's identifier."
          },
          "client_name": {
            "type": "string",
            "title": "Client Name",
            "description": "The client's display name."
          },
          "issued_at": {
            "type": "string",
            "title": "Issued At",
            "description": "When the client was first authorized."
          },
          "refresh_expires_at": {
            "type": "string",
            "title": "Refresh Expires At",
            "description": "When the client's latest refresh token expires."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_id",
          "client_name",
          "issued_at",
          "refresh_expires_at"
        ],
        "title": "OAuthGrant",
        "description": "One client currently authorized on an account (aggregated from its\n``oauth_tokens`` rows)."
      },
      "OAuthGrantRevokeReq": {
        "properties": {
          "client_id": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9._~-]+$",
            "title": "Client Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_id"
        ],
        "title": "OAuthGrantRevokeReq",
        "description": "The client to disconnect from the signed-in account."
      },
      "OAuthGrantsResponse": {
        "properties": {
          "grants": {
            "items": {
              "$ref": "#/components/schemas/OAuthGrant"
            },
            "type": "array",
            "title": "Grants",
            "description": "The authorized clients, most recent first."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "grants"
        ],
        "title": "OAuthGrantsResponse",
        "description": "GET /api/oauth/grants — the account's connected apps."
      },
      "OAuthServerMetadata": {
        "properties": {
          "issuer": {
            "type": "string",
            "title": "Issuer",
            "description": "The authorization server's issuer origin."
          },
          "authorization_endpoint": {
            "type": "string",
            "title": "Authorization Endpoint",
            "description": "The authorization endpoint URL."
          },
          "token_endpoint": {
            "type": "string",
            "title": "Token Endpoint",
            "description": "The token endpoint URL."
          },
          "registration_endpoint": {
            "type": "string",
            "title": "Registration Endpoint",
            "description": "The dynamic client registration endpoint URL."
          },
          "revocation_endpoint": {
            "type": "string",
            "title": "Revocation Endpoint",
            "description": "The token revocation endpoint URL."
          },
          "response_types_supported": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Response Types Supported",
            "description": "Supported response types."
          },
          "grant_types_supported": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Grant Types Supported",
            "description": "Supported grant types."
          },
          "code_challenge_methods_supported": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Code Challenge Methods Supported",
            "description": "Supported PKCE challenge methods."
          },
          "token_endpoint_auth_methods_supported": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Token Endpoint Auth Methods Supported",
            "description": "Supported client authentication methods at the token endpoint."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "issuer",
          "authorization_endpoint",
          "token_endpoint",
          "registration_endpoint",
          "revocation_endpoint",
          "response_types_supported",
          "grant_types_supported",
          "code_challenge_methods_supported",
          "token_endpoint_auth_methods_supported"
        ],
        "title": "OAuthServerMetadata",
        "description": "GET /.well-known/oauth-authorization-server — RFC 8414 metadata."
      },
      "OAuthTokens": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token",
            "description": "The bearer access token."
          },
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token",
            "description": "The refresh token (rotated on every use)."
          },
          "token_type": {
            "type": "string",
            "const": "Bearer",
            "title": "Token Type",
            "description": "Always 'Bearer'."
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In",
            "description": "The access token's lifetime, in seconds."
          },
          "scope": {
            "type": "string",
            "title": "Scope",
            "description": "The granted scope, or ''."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "access_token",
          "refresh_token",
          "token_type",
          "expires_in",
          "scope"
        ],
        "title": "OAuthTokens",
        "description": "An issued token pair (RFC 6749 §5.1)."
      },
      "OkResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok",
            "description": "Always true: failures are HTTP errors."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok"
        ],
        "title": "OkResponse",
        "description": "The bare acknowledgement most account mutations return."
      },
      "OverviewPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "total": {
            "$ref": "#/components/schemas/PanelPayload",
            "description": "The headline folded totals (single 'total' column)."
          },
          "partners": {
            "$ref": "#/components/schemas/EntityBreakdowns",
            "description": "The top-partner breakdowns, ranked by quantity and by value."
          },
          "balance": {
            "$ref": "#/components/schemas/BalancePayload",
            "description": "The trade balance (exports - imports)."
          },
          "has_subcodes": {
            "type": "boolean",
            "title": "Has Subcodes",
            "description": "Whether the customs code has children in the current CN edition."
          },
          "supp_unit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UnitDescriptor"
              },
              {
                "type": "null"
              }
            ],
            "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "total",
          "partners",
          "balance",
          "has_subcodes",
          "supp_unit"
        ],
        "title": "OverviewPayload",
        "description": "POST /api/descriptive/overview — headline totals, trade balance and\ntop-partner breakdowns for the Overview tab."
      },
      "PairSeries": {
        "properties": {
          "quantity": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Quantity",
            "description": "The period-aligned quantity series; null = no figure."
          },
          "price": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Price",
            "description": "The period-aligned price series; null = no figure."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PairSeries",
        "description": "A pair's quantity and price series over the shock payload's period\naxis (the wire mirror of ``core.computation.shapes.PairSeries``)."
      },
      "Palette": {
        "properties": {
          "slots": {
            "items": {
              "$ref": "#/components/schemas/Slot"
            },
            "type": "array",
            "title": "Slots",
            "description": "The eight series colours in series order: the bottom segment of a stacked bar first, the grey ('rest of the world') last."
          },
          "gradient": {
            "items": {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$",
              "description": "An sRGB colour, #RRGGBB."
            },
            "type": "array",
            "title": "Gradient",
            "description": "The five stops of the continuous health scale, healthy (cool) to worst (red)."
          },
          "phases": {
            "additionalProperties": {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$",
              "description": "An sRGB colour, #RRGGBB."
            },
            "propertyNames": {
              "$ref": "#/components/schemas/Phase"
            },
            "type": "object",
            "title": "Phases",
            "description": "The colour of each shock phase."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "slots",
          "gradient",
          "phases"
        ],
        "title": "Palette",
        "description": "A chart palette with the scales derived from it."
      },
      "PanelPayload": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "columns": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Columns",
            "description": "The column order (the entity/sub-code ranking) the triplet fields are keyed by."
          },
          "primary": {
            "$ref": "#/components/schemas/TripletFrames",
            "description": "The net-mass quantity / value / price view."
          },
          "supplementary": {
            "$ref": "#/components/schemas/SupplementaryTripletFrames",
            "description": "The supplementary-unit view (empty when no usable supplementary quantities survive)."
          },
          "descriptions": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descriptions",
            "description": "Subcode-compare only: customs-code column -> its CN label."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PanelPayload",
        "description": "The canonical descriptive-breakdown block (per-flow totals, per-entity\nand per-sub-code panels), from ``Presenter.panel``.\n\n``periods`` is the shared axis; ``columns`` the column order (the\nentity/sub-code ranking); each triplet field is keyed by those columns.\n``descriptions`` (subcode-compare only) maps customs-code columns to\ntheir CN labels."
      },
      "PatternShiftBlock": {
        "properties": {
          "points": {
            "items": {
              "$ref": "#/components/schemas/PatternShiftPoint"
            },
            "type": "array",
            "title": "Points",
            "description": "The scatter points, one per entity."
          },
          "quadrants": {
            "additionalProperties": {
              "$ref": "#/components/schemas/QuadrantLabel"
            },
            "type": "object",
            "title": "Quadrants",
            "description": "The four quadrant labels, keyed by corner."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PatternShiftBlock",
        "description": "The before/after scatter for one entity level × flow, from\n``Presenter.pattern_shift``; ``quadrants`` labels the four corners."
      },
      "PatternShiftPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "midpoint": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "Midpoint",
            "description": "The canonical 'YYYY-MM' split used for this response; null when no valid split exists."
          },
          "available_midpoints": {
            "items": {
              "type": "string",
              "pattern": "\\d{4}-\\d{2}",
              "description": "A calendar month, 'YYYY-MM'."
            },
            "type": "array",
            "title": "Available Midpoints",
            "description": "Every valid 'YYYY-MM' split point in observed-period order; the first and last bounds do not imply that interior gaps are valid."
          },
          "partners": {
            "$ref": "#/components/schemas/FlowBlocks",
            "description": "The partner-level scatter, per flow."
          },
          "reporters": {
            "$ref": "#/components/schemas/FlowBlocks",
            "description": "The reporter-level scatter, per flow."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "midpoint",
          "available_midpoints",
          "partners",
          "reporters"
        ],
        "title": "PatternShiftPayload",
        "description": "POST /api/volatility/pattern-shift."
      },
      "PatternShiftPoint": {
        "properties": {
          "entity": {
            "type": "string",
            "title": "Entity",
            "description": "The entity (partner or reporter)."
          },
          "qty_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qty Change Pct",
            "description": "Quantity change (%) after vs before the midpoint -- the scatter's x value."
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct",
            "description": "Price change (%) after vs before the midpoint -- the scatter's y value."
          },
          "total_qty": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Qty",
            "description": "The entity's total quantity over the window (bubble size)."
          },
          "qty_before": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qty Before",
            "description": "Average quantity before the midpoint."
          },
          "qty_after": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qty After",
            "description": "Average quantity after the midpoint."
          },
          "price_before": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Before",
            "description": "Average price before the midpoint."
          },
          "price_after": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price After",
            "description": "Average price after the midpoint."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "entity",
          "qty_change_pct",
          "price_change_pct",
          "total_qty",
          "qty_before",
          "qty_after",
          "price_before",
          "price_after"
        ],
        "title": "PatternShiftPoint",
        "description": "One entity's before/after shift (scatter point): a row of the\npattern-shift table."
      },
      "Phase": {
        "type": "string",
        "enum": [
          "baseline",
          "active",
          "full_recovery",
          "return_to_baseline",
          "partial_recovery",
          "price_drop",
          "shock",
          "decline",
          "price_spike",
          "price_volatility",
          "depressed",
          "volume_volatility",
          "volatile_trade",
          "sporadic",
          "post_shock",
          "disruption",
          "exit",
          "price_exit"
        ],
        "title": "Phase",
        "description": "The shock-analysis phases that carry a colour (mirrors\n``PHASE_SCORES`` in ``src/lib/palette.ts``)."
      },
      "Piece": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS)."
          },
          "from_month": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "From Month",
            "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
          },
          "to_month": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "To Month",
            "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code"
        ],
        "title": "Piece",
        "description": "Every declaration under one code in one optional month window."
      },
      "PiecePayload": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The piece's customs code."
          },
          "from_month": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "From Month",
            "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
          },
          "to_month": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "To Month",
            "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
          },
          "definitions": {
            "items": {
              "$ref": "#/components/schemas/SegmentPayload"
            },
            "type": "array",
            "title": "Definitions",
            "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "from_month",
          "to_month",
          "definitions"
        ],
        "title": "PiecePayload",
        "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation."
      },
      "PriceBenchmarkPayload": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "prices": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Prices",
            "description": "{line: period-aligned price series} -- the aggregate average, the min/max envelope and the selected reporter's line."
          },
          "extremes": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Extremes",
            "description": "{envelope edge: period-aligned owner of that edge (the reporter hitting the min/max that period)}."
          },
          "supplementary": {
            "type": "boolean",
            "title": "Supplementary",
            "description": "True when the prices are per supplementary unit rather than per tonne.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PriceBenchmarkPayload",
        "description": "Benchmark price lines per flow, from ``Presenter.price_benchmark_series``:\n``prices`` carries the aggregate average / envelope / selected-reporter\nlines, ``extremes`` the per-period owner of each envelope edge."
      },
      "ProdcomCellFlag": {
        "type": "string",
        "enum": [
          "confidential",
          "not_available",
          "low_quality",
          "not_applicable",
          "estimate",
          "rounded",
          "exact",
          "unflagged"
        ],
        "title": "ProdcomCellFlag",
        "description": "A DS-059358 cell's data-quality flag: the PRODCOM store's normalized\nform of Eurostat's raw flags. A value with an increasing reliability\ncaveat (``exact`` / ``rounded`` / ``estimate``), a value Eurostat\nattached no flag to (``unflagged``), or the reason Eurostat published no\nusable value (the suppressions; the cell's value is NaN).\n\nThe declaration order is the severity order (:attr:`severity`): the most\nsevere suppression first, the cleanest value last. Among the caveats an\n``estimate`` is worse than a ``rounded`` value: a rounded figure stays\nclose to the original, an estimate can diverge widely."
      },
      "ProdcomCellStatus": {
        "properties": {
          "flag": {
            "$ref": "#/components/schemas/WireEnum_ProdcomCellFlag_"
          },
          "partial": {
            "type": "boolean",
            "title": "Partial"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "flag",
          "partial"
        ],
        "title": "ProdcomCellStatus",
        "description": "The combined status of one (period, indicator) cell over several\ncustoms codes: the worst contributing flag, and whether only some of the\nexpected codes contributed (a partial figure misses part of the value).\nAlso the reliability of a reduced indicator: the worst flag over its\ncomponent cells, partial when any of them is."
      },
      "ProdcomGap": {
        "type": "string",
        "enum": [
          "gap_negative_apparent",
          "gap_zero_denominator",
          "gap_no_production",
          "gap_no_quantity",
          "gap_no_total_production"
        ],
        "title": "ProdcomGap",
        "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status."
      },
      "ProdcomIndicator": {
        "type": "string",
        "enum": [
          "PRODVAL",
          "OWNPRODVAL",
          "SCPRODVAL",
          "IMPVAL",
          "EXPVAL",
          "PRODQNT",
          "OWNPRODQNT",
          "SCPRODQNT",
          "IMPQNT",
          "EXPQNT"
        ],
        "title": "ProdcomIndicator",
        "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one."
      },
      "ProdcomMappingStatus": {
        "type": "string",
        "enum": [
          "exact",
          "fallback",
          "unavailable"
        ],
        "title": "ProdcomMappingStatus",
        "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data."
      },
      "ProdcomMetaPayload": {
        "properties": {
          "prodcom_codes": {
            "items": {
              "$ref": "#/components/schemas/ProdcomPickerCode"
            },
            "type": "array",
            "title": "Prodcom Codes",
            "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own."
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Notes",
            "description": "Fallback and selection notes explaining the resolution."
          },
          "unavailability_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_ProdcomUnavailability_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why no PRODCOM query can be formed or served, when it can't."
          },
          "prodcom_unit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UnitDescriptor"
              },
              {
                "type": "null"
              }
            ],
            "description": "The PRODCOM quantity unit, when the data carries one."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prodcom_codes",
          "notes",
          "unavailability_type",
          "prodcom_unit"
        ],
        "title": "ProdcomMetaPayload",
        "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the production quantity unit.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps."
      },
      "ProdcomPickerCode": {
        "properties": {
          "prodcom_code": {
            "type": "string",
            "title": "Prodcom Code",
            "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
            "examples": [
              "23.99.14",
              "24.10.T3.40"
            ]
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "The code's label."
          },
          "status": {
            "$ref": "#/components/schemas/WireEnum_ProdcomMappingStatus_",
            "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
          },
          "original_prodcom_code_fmt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Prodcom Code Fmt",
            "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prodcom_code",
          "description",
          "status",
          "original_prodcom_code_fmt"
        ],
        "title": "ProdcomPickerCode",
        "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once."
      },
      "ProdcomSibling": {
        "properties": {
          "prodcom_code": {
            "type": "string",
            "title": "Prodcom Code",
            "description": "The sibling's PRODCOM code, in dotted form.",
            "examples": [
              "23.99.14",
              "24.10.T3.40"
            ]
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Its label, in the requested language when available."
          },
          "data": {
            "additionalProperties": {
              "additionalProperties": {
                "$ref": "#/components/schemas/ComponentStatusPayload"
              },
              "propertyNames": {
                "$ref": "#/components/schemas/WireEnum_ProductionBasis_"
              },
              "type": "object"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_Measure_"
            },
            "type": "object",
            "title": "Data",
            "description": "Its measure × basis indicator matrix; empty when it has no EU27 data."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prodcom_code",
          "label",
          "data"
        ],
        "title": "ProdcomSibling",
        "description": "One same-level PRODCOM sibling of the selected code, with its EU27\nindicator matrix (single-code mode)."
      },
      "ProdcomUnavailability": {
        "type": "string",
        "enum": [
          "not_applicable",
          "no_mapping",
          "selection_required",
          "suppressed",
          "no_data"
        ],
        "title": "ProdcomUnavailability",
        "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable)."
      },
      "ProductionBasis": {
        "type": "string",
        "enum": [
          "total",
          "own",
          "sub"
        ],
        "title": "ProductionBasis",
        "description": "The production basis axis: total sold production and its two\n2021-onward components, own-account and sub-contracted."
      },
      "ProductionConcentration": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "data": {
            "additionalProperties": {
              "additionalProperties": {
                "$ref": "#/components/schemas/ProductionHhiBlock"
              },
              "propertyNames": {
                "$ref": "#/components/schemas/WireEnum_ProductionBasis_"
              },
              "type": "object"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_Measure_"
            },
            "type": "object",
            "title": "Data",
            "description": "{measure: {basis: the production HHI line, its country shares and per-country status}}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ProductionConcentration",
        "description": "Per measure × basis: the production HHI line, the country shares\nbehind it and per-geo status, on one annual axis."
      },
      "ProductionConcentrationPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/CodeHeader",
            "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
          },
          "prodcom": {
            "$ref": "#/components/schemas/ProdcomMetaPayload",
            "description": "How the customs code resolved to PRODCOM: the code picker, fallback notes, the unavailability reason and the production unit."
          },
          "concentration": {
            "$ref": "#/components/schemas/ProductionConcentration",
            "description": "The production HHI per measure × basis."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "prodcom",
          "concentration"
        ],
        "title": "ProductionConcentrationPayload",
        "description": "POST /api/production/concentration."
      },
      "ProductionHhiBlock": {
        "properties": {
          "indicator": {
            "items": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array",
            "title": "Indicator",
            "description": "The period-aligned production HHI line (0-10000; higher = more concentrated)."
          },
          "components": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Components",
            "description": "{country name: period-aligned production share}; null = suppressed or not reported."
          },
          "data_status": {
            "additionalProperties": {
              "$ref": "#/components/schemas/DataStatusPayload"
            },
            "type": "object",
            "title": "Data Status",
            "description": "{country name: its per-period status}, the reason behind each absent share."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ProductionHhiBlock",
        "description": "One measure × basis production HHI: the line across reporting countries,\nthe country shares behind it and each country's status."
      },
      "ProductionSeries": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "eu": {
            "additionalProperties": {
              "$ref": "#/components/schemas/EuProductionBlock"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_ProductionBasis_"
            },
            "type": "object",
            "title": "Eu",
            "description": "{basis ('total'/'own'/'sub'): the EU27 production block}."
          },
          "reporters": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ReporterProductionBlock"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_ProductionBasis_"
            },
            "type": "object",
            "title": "Reporters",
            "description": "{basis: the per-country production panel}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "eu",
          "reporters"
        ],
        "title": "ProductionSeries",
        "description": "EU27 and per-reporter production, per basis, on one annual axis."
      },
      "ProductionSeriesPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/CodeHeader",
            "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
          },
          "prodcom": {
            "$ref": "#/components/schemas/ProdcomMetaPayload",
            "description": "How the customs code resolved to PRODCOM: the code picker, fallback notes, the unavailability reason and the production unit."
          },
          "production": {
            "$ref": "#/components/schemas/ProductionSeries",
            "description": "EU27 and per-reporter production, per basis."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "prodcom",
          "production"
        ],
        "title": "ProductionSeriesPayload",
        "description": "POST /api/production/series."
      },
      "ProgressFrame": {
        "properties": {
          "type": {
            "type": "string",
            "const": "progress",
            "title": "Type",
            "default": "progress"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "The progress message (ad-hoc prose)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message"
        ],
        "title": "ProgressFrame",
        "description": "A streamed progress line. ``message`` is ad-hoc prose (see the module\ndocstring's vocabulary note)."
      },
      "QuadrantLabel": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The quadrant's short label."
          },
          "desc": {
            "type": "string",
            "title": "Desc",
            "description": "The quadrant's interpretation (e.g. demand-driven growth, supply constraint, dumping/oversupply risk, market contraction)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "label",
          "desc"
        ],
        "title": "QuadrantLabel"
      },
      "RecentSearchReq": {
        "properties": {
          "reporter": {
            "type": "string",
            "maxLength": 120,
            "title": "Reporter",
            "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
            "default": "European Union"
          },
          "group_reporters": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Reporters",
            "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
          },
          "partner_set": {
            "type": "string",
            "maxLength": 120,
            "title": "Partner Set",
            "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
            "default": "non-EU countries"
          },
          "partners": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Partners",
            "description": "Explicit partner-country list that overrides 'partner_set' when present."
          },
          "period_start": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Period Start",
            "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
            "default": {
              "year": 2015,
              "month": 1
            }
          },
          "frequency": {
            "$ref": "#/components/schemas/Frequency",
            "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'.",
            "default": "quarter"
          },
          "remove_outliers": {
            "type": "boolean",
            "title": "Remove Outliers",
            "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
            "default": true
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          },
          "period_end": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "customs_code": {
            "anyOf": [
              {
                "type": "string",
                "description": "A canonical customs code, TOTAL, or a supported residual spelling."
              },
              {
                "items": {
                  "type": "string",
                  "description": "A canonical customs code, TOTAL, or a supported residual spelling."
                },
                "type": "array",
                "maxItems": 50
              }
            ],
            "title": "Customs Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code"
        ],
        "title": "RecentSearchReq",
        "description": "One dashboard search to remember on the user's account: every query\nparameter from the dashboard URL except the palette. Field defaults\nmirror the dashboard's own."
      },
      "RecentSearchesResponse": {
        "properties": {
          "recent_searches": {
            "items": {
              "$ref": "#/components/schemas/SavedSearch"
            },
            "type": "array",
            "title": "Recent Searches",
            "description": "The search history, most recent first."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "recent_searches"
        ],
        "title": "RecentSearchesResponse",
        "description": "POST /api/searches/recent — the updated history."
      },
      "RecordedLinkPayload": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The other segment's customs code."
          },
          "valid_from": {
            "type": "string",
            "title": "Valid From",
            "description": "The other segment's window start, ISO date."
          },
          "valid_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid To",
            "description": "The other segment's window end, ISO date; null when open."
          },
          "marker": {
            "type": "string",
            "title": "Marker",
            "description": "Eurostat's relation marker, as recorded."
          },
          "match": {
            "$ref": "#/components/schemas/WireEnum_LinkMatch_",
            "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "valid_from",
          "valid_to",
          "marker",
          "match"
        ],
        "title": "RecordedLinkPayload",
        "description": "One recorded predecessor/successor edge of an exact segment."
      },
      "RecordedLinksPayload": {
        "properties": {
          "successors": {
            "items": {
              "$ref": "#/components/schemas/RecordedLinkPayload"
            },
            "type": "array",
            "title": "Successors",
            "description": "Edges recorded from this segment."
          },
          "predecessors": {
            "items": {
              "$ref": "#/components/schemas/RecordedLinkPayload"
            },
            "type": "array",
            "title": "Predecessors",
            "description": "Edges recorded into this segment."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "successors",
          "predecessors"
        ],
        "title": "RecordedLinksPayload"
      },
      "RedirectKind": {
        "type": "string",
        "enum": [
          "local",
          "vendor"
        ],
        "title": "RedirectKind",
        "description": "Why a callback is allowed: a loopback URI (local clients, RFC 8252)\nor an approved hosted vendor's documented callback."
      },
      "RegisterReq": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 1024,
            "title": "Password"
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "de"
            ],
            "title": "Lang",
            "default": "en"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "RegisterReq"
      },
      "ReportCaps": {
        "properties": {
          "per_day": {
            "type": "integer",
            "title": "Per Day",
            "description": "The daily on-demand report allowance."
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "The lifetime on-demand report allowance."
          },
          "used_today": {
            "type": "integer",
            "title": "Used Today",
            "description": "How many of today's reports are used."
          },
          "used_total": {
            "type": "integer",
            "title": "Used Total",
            "description": "How many lifetime reports are used."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "per_day",
          "total",
          "used_today",
          "used_total"
        ],
        "title": "ReportCaps"
      },
      "ReportRequestOutcome": {
        "type": "string",
        "enum": [
          "done",
          "pending",
          "queued"
        ],
        "title": "ReportRequestOutcome",
        "description": "What POST /api/reports/request did: ``done`` -- a listed report\nalready exists; ``pending`` -- this report is already being generated;\n``queued`` -- generation was (re)queued."
      },
      "ReportRequestReq": {
        "properties": {
          "reporter": {
            "type": "string",
            "maxLength": 120,
            "title": "Reporter",
            "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
            "default": "European Union"
          },
          "group_reporters": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Reporters",
            "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
          },
          "partner_set": {
            "type": "string",
            "maxLength": 120,
            "title": "Partner Set",
            "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
            "default": "non-EU countries"
          },
          "partners": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Partners",
            "description": "Explicit partner-country list that overrides 'partner_set' when present."
          },
          "period_start": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Period Start",
            "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
            "default": {
              "year": 2015,
              "month": 1
            }
          },
          "frequency": {
            "$ref": "#/components/schemas/Frequency",
            "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'.",
            "default": "quarter"
          },
          "remove_outliers": {
            "type": "boolean",
            "title": "Remove Outliers",
            "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
            "default": true
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          },
          "period_end": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "search_id": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{12}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Search Id"
          },
          "customs_code": {
            "anyOf": [
              {
                "type": "string",
                "description": "A canonical customs code, TOTAL, or a supported residual spelling."
              },
              {
                "items": {
                  "type": "string",
                  "description": "A canonical customs code, TOTAL, or a supported residual spelling."
                },
                "type": "array",
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Customs Code"
          },
          "lang": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_Lang_"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ReportRequestReq",
        "description": "An on-demand report generation request (POST /api/reports/request):\neither a saved-search id, or inline criteria in the saved-search shape.\n``lang`` is the report's language, any :class:`Lang` (default: the\naccount's language)."
      },
      "ReportRequestResponse": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/WireEnum_ReportRequestOutcome_",
            "description": "'done' when a report already exists for the query, 'pending'/'queued' otherwise."
          },
          "report_hash": {
            "type": "string",
            "maxLength": 12,
            "minLength": 12,
            "pattern": "^[0-9a-f]{12}$",
            "title": "Report Hash",
            "description": "The report's content hash (its URL key)."
          },
          "page_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Url",
            "description": "The report page's URL, when it exists."
          },
          "eta_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eta Minutes",
            "description": "Estimated wait in minutes, when queued or running."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "report_hash"
        ],
        "title": "ReportRequestResponse",
        "description": "POST /api/reports/request — the report-request outcome.  ``page_url``\nwhen a report for the query is already published (done); ``eta_minutes``\nwhen queued or already running (pending)."
      },
      "ReportRequestRow": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "The request's id."
          },
          "search_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Search Id",
            "description": "The saved search the request was made from, when any."
          },
          "report_hash": {
            "type": "string",
            "maxLength": 12,
            "minLength": 12,
            "pattern": "^[0-9a-f]{12}$",
            "title": "Report Hash",
            "description": "The report's content hash."
          },
          "status": {
            "$ref": "#/components/schemas/WireEnum_ReportStatus_",
            "description": "The request's status."
          },
          "page_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Url",
            "description": "The report page's URL, when generated."
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "The failure message, when generation failed."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At",
            "description": "When the request was made."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "report_hash",
          "status"
        ],
        "title": "ReportRequestRow",
        "description": "One past report request in the account panel."
      },
      "ReportRequestsResponse": {
        "properties": {
          "requests": {
            "items": {
              "$ref": "#/components/schemas/ReportRequestRow"
            },
            "type": "array",
            "title": "Requests",
            "description": "The user's past requests, newest first."
          },
          "caps": {
            "$ref": "#/components/schemas/ReportCaps",
            "description": "The trial allowances and their usage."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "requests",
          "caps"
        ],
        "title": "ReportRequestsResponse",
        "description": "GET /api/reports/requests — the user's requests plus trial caps."
      },
      "ReportStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "done",
          "failed"
        ],
        "title": "ReportStatus",
        "description": "Lifecycle of an on-demand report request: the web app enqueues, the\nworker claims (running), then closes it as done or failed."
      },
      "ReporterBenchmarkPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "supp_unit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UnitDescriptor"
              },
              {
                "type": "null"
              }
            ],
            "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
          },
          "imports": {
            "$ref": "#/components/schemas/ReporterSnapshotPayload",
            "description": "The import cross-section for the latest full year."
          },
          "exports": {
            "$ref": "#/components/schemas/ReporterSnapshotPayload",
            "description": "The export cross-section for the latest full year."
          },
          "price_benchmark": {
            "$ref": "#/components/schemas/PriceBenchmarkPayload",
            "description": "The benchmark price series (aggregate average, envelope, selected reporter)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "supp_unit",
          "imports",
          "exports",
          "price_benchmark"
        ],
        "title": "ReporterBenchmarkPayload",
        "description": "POST /api/descriptive/reporter-benchmark — per-flow single-year\nsnapshots plus the benchmark price series."
      },
      "ReporterPreset": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key",
            "description": "The frontend's i18n key for the preset's label."
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "The English identifier submitted back as 'reporter'."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "key",
          "name"
        ],
        "title": "ReporterPreset",
        "description": "An aggregate reporter preset (rendered via its i18n ``key``; ``name``\nis the English identifier submitted back as ``reporter``)."
      },
      "ReporterProductionBlock": {
        "properties": {
          "quantity": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Quantity",
            "description": "{column: period-aligned quantity series (trade: net mass in tonnes; production: the PRODCOM unit); null = no figure}."
          },
          "value": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Value",
            "description": "{column: period-aligned value series (EUR); null = no figure}."
          },
          "price": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Price",
            "description": "{column: period-aligned unit value series (value per quantity unit); null = no figure}."
          },
          "data_status": {
            "additionalProperties": {
              "$ref": "#/components/schemas/DataStatusPayload"
            },
            "type": "object",
            "title": "Data Status",
            "description": "{country name: its per-period status}; the value and quantity components are carried separately, so a reader can tell why either one is absent."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data_status"
        ],
        "title": "ReporterProductionBlock",
        "description": "Production quantity / value / unit value of one basis per reporting\ncountry, plus each country's status -- the wire mirror of the per-country\n``TripletGeoStatus``.  Each triplet field is keyed by country name; a\ncountry without data has no entry in ``data_status``."
      },
      "ReporterSnapshotPayload": {
        "properties": {
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year",
            "description": "The calendar year the cross-section is pinned to."
          },
          "entities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Entities",
            "description": "The reporters, ranked by value."
          },
          "quantity": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Quantity",
            "description": "{reporter: net mass (tonnes)}; null = not reported."
          },
          "value": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Value",
            "description": "{reporter: value (EUR)}."
          },
          "price": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Price",
            "description": "{reporter: weighted-average price}; null = not reported."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ReporterSnapshotPayload",
        "description": "One year's per-reporter cross-section, ranked by value, from\n``Presenter.reporter_snapshot_series``."
      },
      "ResetReq": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 128,
            "title": "Token"
          },
          "password": {
            "type": "string",
            "maxLength": 1024,
            "title": "Password"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "token",
          "password"
        ],
        "title": "ResetReq"
      },
      "ResidualKind": {
        "type": "string",
        "enum": [
          "xx",
          "letter"
        ],
        "title": "ResidualKind"
      },
      "ResidualReason": {
        "type": "string",
        "enum": [
          "A",
          "B",
          "C",
          "E",
          "F",
          "I",
          "M",
          "P",
          "R",
          "S",
          "T",
          "V",
          "W",
          "Y"
        ],
        "title": "ResidualReason"
      },
      "ResidualShareNote": {
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/WireEnum_ResidualShareUnavailable_",
            "description": "Stable identifier of the reason."
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "The reason in English, naming the code where relevant."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "reason",
          "message"
        ],
        "title": "ResidualShareNote",
        "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null)."
      },
      "ResidualSharePayload": {
        "properties": {
          "value_share": {
            "type": "number",
            "title": "Value Share",
            "description": "Share of the slice's total value (0-1) declared in residual customs codes."
          },
          "quantity_share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Share",
            "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
          },
          "quantity_share_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Share Note",
            "description": "Why quantity_share is null, when it is."
          },
          "by_level": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ResidualShareSlice"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_CustomsCodeLevel_"
            },
            "type": "object",
            "title": "By Level",
            "description": "The share split by the level the residual sits directly under (chapter/heading/subheading)."
          },
          "by_kind": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ResidualShareSlice"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_ResidualKind_"
            },
            "type": "object",
            "title": "By Kind",
            "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "value_share"
        ],
        "title": "ResidualSharePayload",
        "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only."
      },
      "ResidualShareSlice": {
        "properties": {
          "value_share": {
            "type": "number",
            "title": "Value Share",
            "description": "Share of the slice's total value (0-1) declared in residual customs codes."
          },
          "quantity_share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Share",
            "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
          },
          "quantity_share_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Share Note",
            "description": "Why quantity_share is null, when it is."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "value_share"
        ],
        "title": "ResidualShareSlice",
        "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``."
      },
      "ResidualShareUnavailable": {
        "type": "string",
        "enum": [
          "switched_off",
          "multi_code",
          "mixed_codes",
          "pieced_basket",
          "residual_spelling",
          "total",
          "cn8_leaf",
          "no_partners",
          "no_store_data",
          "no_total_trade"
        ],
        "title": "ResidualShareUnavailable",
        "description": "Why a slice has no residual share (``ResidualShareNote.reason``)."
      },
      "ResidualSpelling": {
        "type": "string",
        "enum": [
          "xx",
          "letter",
          "reason_group"
        ],
        "title": "ResidualSpelling"
      },
      "ResponseHeader": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The queried customs code(s), as requested (several codes joined)."
          },
          "levels": {
            "items": {
              "$ref": "#/components/schemas/DescriptionLevel"
            },
            "type": "array",
            "title": "Levels",
            "description": "The customs code's CN description hierarchy, chapter first."
          },
          "customs_code_label": {
            "type": "string",
            "title": "Customs Code Label",
            "description": "The customs code's display label."
          },
          "frequency": {
            "$ref": "#/components/schemas/WireEnum_Frequency_",
            "description": "The period grain of every series in the payload ('year' for PRODCOM)."
          },
          "reporter_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reporter Label",
            "description": "The reporter's display label; null for views spanning every reporter."
          },
          "partner_set_label": {
            "type": "string",
            "title": "Partner Set Label",
            "description": "The partner set's label."
          },
          "quantity_unit": {
            "$ref": "#/components/schemas/UnitDescriptor",
            "description": "The unit of every 'quantity' series: net mass in tonnes."
          },
          "residual_share": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResidualSharePayload"
              },
              {
                "type": "null"
              }
            ],
            "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
          },
          "residual_share_note": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResidualShareNote"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
          },
          "in_eurostat_api": {
            "type": "boolean",
            "title": "In Eurostat Api",
            "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes."
          },
          "baskets": {
            "items": {
              "$ref": "#/components/schemas/BasketPayload"
            },
            "type": "array",
            "title": "Baskets",
            "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets."
          },
          "notes": {
            "items": {
              "$ref": "#/components/schemas/NotePayload"
            },
            "type": "array",
            "title": "Notes",
            "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served."
          },
          "data_provenance": {
            "$ref": "#/components/schemas/DataProvenance",
            "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "levels",
          "customs_code_label",
          "frequency",
          "reporter_label",
          "partner_set_label",
          "quantity_unit",
          "residual_share",
          "residual_share_note",
          "in_eurostat_api",
          "baskets",
          "notes",
          "data_provenance"
        ],
        "title": "ResponseHeader",
        "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``)."
      },
      "ResultFrame_ConcentrationComparePayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ConcentrationComparePayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ConcentrationComparePayload]"
      },
      "ResultFrame_ConcentrationMapPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ConcentrationMapPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ConcentrationMapPayload]"
      },
      "ResultFrame_ConcentrationPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ConcentrationPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ConcentrationPayload]"
      },
      "ResultFrame_EntityDetailPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/EntityDetailPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[EntityDetailPayload]"
      },
      "ResultFrame_ExposurePayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ExposurePayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ExposurePayload]"
      },
      "ResultFrame_MapDataPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/MapDataPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[MapDataPayload]"
      },
      "ResultFrame_OverviewPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/OverviewPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[OverviewPayload]"
      },
      "ResultFrame_PatternShiftPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/PatternShiftPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[PatternShiftPayload]"
      },
      "ResultFrame_ProductionConcentrationPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ProductionConcentrationPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ProductionConcentrationPayload]"
      },
      "ResultFrame_ProductionSeriesPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ProductionSeriesPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ProductionSeriesPayload]"
      },
      "ResultFrame_ReporterBenchmarkPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ReporterBenchmarkPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ReporterBenchmarkPayload]"
      },
      "ResultFrame_ShocksEndpointPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/ShocksEndpointPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[ShocksEndpointPayload]"
      },
      "ResultFrame_SpecialisationPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/SpecialisationPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[SpecialisationPayload]"
      },
      "ResultFrame_SubcodeComparePayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/SubcodeComparePayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[SubcodeComparePayload]"
      },
      "ResultFrame_SubcontractingIntensityPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/SubcontractingIntensityPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[SubcontractingIntensityPayload]"
      },
      "ResultFrame_SubcontractingReportersPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/SubcontractingReportersPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[SubcontractingReportersPayload]"
      },
      "ResultFrame_TopEntitiesPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/TopEntitiesPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[TopEntitiesPayload]"
      },
      "ResultFrame_VolatilityPayload_": {
        "properties": {
          "type": {
            "type": "string",
            "const": "result",
            "title": "Type",
            "default": "result"
          },
          "data": {
            "$ref": "#/components/schemas/VolatilityPayload",
            "description": "The route's payload."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ResultFrame[VolatilityPayload]"
      },
      "SavedSearch": {
        "properties": {
          "reporter": {
            "type": "string",
            "maxLength": 120,
            "title": "Reporter",
            "default": "European Union"
          },
          "group_reporters": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Reporters"
          },
          "partner_set": {
            "type": "string",
            "maxLength": 120,
            "title": "Partner Set",
            "default": "non-EU countries"
          },
          "partners": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Partners"
          },
          "period_start": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Period Start",
            "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
            "default": "2015-01"
          },
          "frequency": {
            "$ref": "#/components/schemas/Frequency",
            "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'.",
            "default": "quarter"
          },
          "remove_outliers": {
            "type": "boolean",
            "title": "Remove Outliers",
            "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
            "default": true
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          },
          "period_end": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "customs_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            ],
            "title": "Customs Code"
          },
          "saved_at": {
            "type": "string",
            "title": "Saved At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "customs_code",
          "saved_at"
        ],
        "title": "SavedSearch",
        "description": "One stored search: a ``saved_searches`` payload, or one element of a\n``recent_searches`` blob (both tables share the shape). A stored key this\nmodel does not declare raises. A stored month is read strictly (``Month``),\nnever corrected."
      },
      "SavedSearchReq": {
        "properties": {
          "reporter": {
            "type": "string",
            "maxLength": 120,
            "title": "Reporter",
            "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
            "default": "European Union"
          },
          "group_reporters": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Reporters",
            "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
          },
          "partner_set": {
            "type": "string",
            "maxLength": 120,
            "title": "Partner Set",
            "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
            "default": "non-EU countries"
          },
          "partners": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 120
                },
                "type": "array",
                "maxItems": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Partners",
            "description": "Explicit partner-country list that overrides 'partner_set' when present."
          },
          "period_start": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}",
            "title": "Period Start",
            "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
            "default": {
              "year": 2015,
              "month": 1
            }
          },
          "frequency": {
            "$ref": "#/components/schemas/Frequency",
            "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'.",
            "default": "quarter"
          },
          "remove_outliers": {
            "type": "boolean",
            "title": "Remove Outliers",
            "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
            "default": true
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          },
          "period_end": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "customs_code": {
            "anyOf": [
              {
                "type": "string",
                "description": "A canonical customs code, TOTAL, or a supported residual spelling."
              },
              {
                "items": {
                  "type": "string",
                  "description": "A canonical customs code, TOTAL, or a supported residual spelling."
                },
                "type": "array",
                "maxItems": 50
              }
            ],
            "title": "Customs Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code"
        ],
        "title": "SavedSearchReq",
        "description": "A dashboard search to save on the user's account. Same shape as the\nrecent-history entries -- saved searches carry no notification flags\n(there is no per-search notification system)."
      },
      "SavedSearchesResponse": {
        "properties": {
          "saved_searches": {
            "items": {
              "$ref": "#/components/schemas/SavedSearch"
            },
            "type": "array",
            "title": "Saved Searches",
            "description": "The saved searches, most recently updated first."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "saved_searches"
        ],
        "title": "SavedSearchesResponse",
        "description": "POST/DELETE /api/searches/saved — the updated saved searches."
      },
      "SearchResponse": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query",
            "description": "The query as received."
          },
          "lang": {
            "type": "string",
            "enum": [
              "bg",
              "cs",
              "da",
              "de",
              "el",
              "en",
              "es",
              "et",
              "fi",
              "fr",
              "ga",
              "hr",
              "hu",
              "it",
              "lt",
              "lv",
              "mt",
              "nl",
              "pl",
              "pt",
              "ro",
              "sk",
              "sl",
              "sv"
            ],
            "title": "Lang",
            "description": "The label language used."
          },
          "source": {
            "$ref": "#/components/schemas/WireEnum_SearchSource_",
            "description": "The nomenclature searched ('cn', or 'prodcom' for PRODCOM-notation queries)."
          },
          "matched_prodcom": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MatchedProdcom"
              },
              {
                "type": "null"
              }
            ],
            "description": "The resolved PRODCOM code descriptor, when the query used PRODCOM notation (present even when no CN code maps)."
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            },
            "type": "array",
            "title": "Results",
            "description": "The ranked candidates."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "query",
          "lang",
          "source",
          "results"
        ],
        "title": "SearchResponse",
        "description": "GET /api/reference/search — ranked candidates; ``matched_prodcom`` is\nset when the query was a dotted PRODCOM notation."
      },
      "SearchResult": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code",
            "description": "The candidate's customs code."
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "The code's label, in the requested language; null for a mapped code the nomenclature does not list."
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path",
            "description": "The candidate's breadcrumb: its ancestor labels joined into one string; null alongside a null label."
          },
          "via_prodcom": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Via Prodcom",
            "description": "The dotted PRODCOM form the match came through, for PRODCOM-notation queries."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "code"
        ],
        "title": "SearchResult",
        "description": "One ranked search candidate."
      },
      "SearchSource": {
        "type": "string",
        "enum": [
          "cn",
          "prodcom"
        ],
        "title": "SearchSource",
        "description": "The nomenclature a search ran over: the CN index, or the PRODCOM\nreverse mapping a dotted-notation query is answered from."
      },
      "SegmentHistoryEntry": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The customs code the segment defines."
          },
          "valid_from": {
            "type": "string",
            "title": "Valid From",
            "description": "First day of the segment's validity window, ISO date."
          },
          "valid_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid To",
            "description": "Last day of the window, ISO date; null for a segment still in force."
          },
          "kind": {
            "$ref": "#/components/schemas/WireEnum_SegmentKind_",
            "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The segment's own label (the definition in force during its window), in the requested language when available."
          },
          "label_lang": {
            "type": "string",
            "enum": [
              "bg",
              "cs",
              "da",
              "de",
              "el",
              "en",
              "es",
              "et",
              "fi",
              "fr",
              "ga",
              "hr",
              "hu",
              "it",
              "lt",
              "lv",
              "mt",
              "nl",
              "pl",
              "pt",
              "ro",
              "sk",
              "sl",
              "sv"
            ],
            "title": "Label Lang",
            "description": "The label's language (English when the requested one is not recorded for this definition)."
          },
          "untranslated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Untranslated",
            "description": "True when the label fell back to English."
          },
          "recorded_links": {
            "$ref": "#/components/schemas/RecordedLinksPayload",
            "description": "Direct correspondence edges recorded for this exact definition. An empty list means no recorded direct link -- not that the code never changed (headings have no edges of their own)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "valid_from",
          "valid_to",
          "kind",
          "label",
          "label_lang",
          "recorded_links"
        ],
        "title": "SegmentHistoryEntry",
        "description": "One recorded definition of a customs code with its direct recorded\nlinks (``SegmentHistoryPayload.segments``)."
      },
      "SegmentHistoryPayload": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The base customs code."
          },
          "metadata_generation": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata Generation",
            "description": "The classification snapshot the history comes from."
          },
          "segments": {
            "items": {
              "$ref": "#/components/schemas/SegmentHistoryEntry"
            },
            "type": "array",
            "title": "Segments",
            "description": "The definitions, oldest first."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "metadata_generation",
          "segments"
        ],
        "title": "SegmentHistoryPayload",
        "description": "Every recorded definition of one customs code (the CN classification\nfiles), independent of the current edition."
      },
      "SegmentKind": {
        "type": "string",
        "enum": [
          "cn",
          "residual_xx",
          "letter_coded",
          "chapter_00",
          "other"
        ],
        "title": "SegmentKind",
        "description": "The ingest classification of one CN.txt identity."
      },
      "SegmentPayload": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The customs code the segment defines."
          },
          "valid_from": {
            "type": "string",
            "title": "Valid From",
            "description": "First day of the segment's validity window, ISO date."
          },
          "valid_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid To",
            "description": "Last day of the window, ISO date; null for a segment still in force."
          },
          "kind": {
            "$ref": "#/components/schemas/WireEnum_SegmentKind_",
            "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The segment's own label (the definition in force during its window), in the requested language when available."
          },
          "label_lang": {
            "type": "string",
            "enum": [
              "bg",
              "cs",
              "da",
              "de",
              "el",
              "en",
              "es",
              "et",
              "fi",
              "fr",
              "ga",
              "hr",
              "hu",
              "it",
              "lt",
              "lv",
              "mt",
              "nl",
              "pl",
              "pt",
              "ro",
              "sk",
              "sl",
              "sv"
            ],
            "title": "Label Lang",
            "description": "The label's language (English when the requested one is not recorded for this definition)."
          },
          "untranslated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Untranslated",
            "description": "True when the label fell back to English."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "valid_from",
          "valid_to",
          "kind",
          "label",
          "label_lang"
        ],
        "title": "SegmentPayload",
        "description": "One recorded definition of a customs code: a fact of the\nclassification metadata, with its window and its own label."
      },
      "SegmentWindow": {
        "properties": {
          "valid_from": {
            "type": "string",
            "title": "Valid From",
            "description": "First day of the window, ISO date."
          },
          "valid_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid To",
            "description": "Last day of the window, ISO date; null while in force."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valid_from",
          "valid_to"
        ],
        "title": "SegmentWindow",
        "description": "The validity window of one customs-code segment (one definition)."
      },
      "SelectedCoveragePayload": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The piece's customs code."
          },
          "from_month": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "From Month",
            "description": "The window's first month, ISO 'YYYY-MM'; null = the store coverage start."
          },
          "to_month": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "\\d{4}-\\d{2}",
                "description": "A calendar month, 'YYYY-MM'."
              },
              {
                "type": "null"
              }
            ],
            "title": "To Month",
            "description": "The window's last month, ISO 'YYYY-MM'; null = the store coverage end."
          },
          "windows": {
            "items": {
              "$ref": "#/components/schemas/CoverageWindow"
            },
            "type": "array",
            "title": "Windows",
            "description": "The months holding data inside the piece's window; an empty list means nothing is stored there."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "from_month",
          "to_month",
          "windows"
        ],
        "title": "SelectedCoveragePayload",
        "description": "The stored coverage of one piece: the months holding data inside its\nwindow, so gaps between definitions stay visible."
      },
      "SemanticRole": {
        "type": "string",
        "enum": [
          "red",
          "ochre",
          "green",
          "cool"
        ],
        "title": "SemanticRole",
        "description": "The four jobs the site gives chart colours by name: red (errors,\nprice maps, the diverging maps' negative pole), ochre (warnings), green\n(success, value maps), cool (the healthy end of the phase gradient, the\ndiverging maps' positive pole, quantity maps)."
      },
      "SetLangReq": {
        "properties": {
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "de"
            ],
            "title": "Lang"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "lang"
        ],
        "title": "SetLangReq"
      },
      "Severity": {
        "type": "string",
        "enum": [
          "info",
          "warning"
        ],
        "title": "Severity"
      },
      "ShockBlock": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/WireEnum_ShockBlockType_",
            "description": "The phase kind (e.g. baseline, decline, disruption, full_recovery for supply shocks; price spike/drop, volatile trade, return to baseline for price shocks)."
          },
          "start": {
            "type": "string",
            "format": "date",
            "title": "Start",
            "description": "The phase's first period."
          },
          "end": {
            "type": "string",
            "format": "date",
            "title": "End",
            "description": "The phase's last period (inclusive)."
          },
          "length": {
            "type": "integer",
            "title": "Length",
            "description": "The phase's length in periods."
          },
          "qty_mean": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qty Mean",
            "description": "Mean quantity per period over the phase (no-trade periods count as 0)."
          },
          "price_mean": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Mean",
            "description": "Volume-weighted mean price over the phase."
          },
          "qty_pct_to_baseline": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qty Pct To Baseline",
            "description": "The phase's quantity as % of the baseline mean."
          },
          "price_pct_to_baseline": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Pct To Baseline",
            "description": "The phase's price as % of the baseline mean."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "start",
          "end",
          "length"
        ],
        "title": "ShockBlock",
        "description": "One timeline phase of a shock event (the wire mirror of\n``core.computation.shapes.ShockPhase``)."
      },
      "ShockBlockType": {
        "type": "string",
        "enum": [
          "baseline",
          "exit",
          "disruption",
          "decline",
          "full_recovery",
          "partial_recovery",
          "depressed",
          "sporadic",
          "price spike",
          "price drop",
          "shock",
          "volatile trade",
          "price volatility",
          "volume volatility",
          "return to baseline",
          "post shock"
        ],
        "title": "ShockBlockType",
        "description": "One timeline phase of a detected shock (``ComextVolatility``): the\nbaseline, the shock itself, and the aftermath."
      },
      "ShockEvent": {
        "properties": {
          "entity": {
            "type": "string",
            "title": "Entity",
            "description": "The entity (partner or reporter) the shock was detected for."
          },
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The customs code of the pair."
          },
          "shift_pct": {
            "type": "number",
            "title": "Shift Pct",
            "description": "The magnitude of the collapse/spike vs baseline (%)."
          },
          "baseline_cv": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Cv",
            "description": "The pair's usual volatility (CV) over the baseline window."
          },
          "abnormality": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abnormality",
            "description": "How unusual the event is vs the pair's own history (sigma for supply shocks, CV multiples for price shocks)."
          },
          "value_share": {
            "type": "number",
            "title": "Value Share",
            "description": "The pair's share of the slice's total value."
          },
          "center": {
            "type": "string",
            "format": "date",
            "title": "Center",
            "description": "The period the shock is centred on (sharpest drop/spike)."
          },
          "series": {
            "$ref": "#/components/schemas/PairSeries",
            "description": "The pair's quantity/price series over the payload's period axis."
          },
          "blocks": {
            "items": {
              "$ref": "#/components/schemas/ShockBlock"
            },
            "type": "array",
            "title": "Blocks",
            "description": "The timeline phases (empty when detection found none)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "entity",
          "customs_code",
          "shift_pct",
          "value_share",
          "center",
          "series",
          "blocks"
        ],
        "title": "ShockEvent",
        "description": "One detected shock: identity, magnitude vs. baseline, and the\ntimeline phases (the wire mirror of ``core.computation.shapes.DetectedShock``)."
      },
      "ShocksEndpointPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "entity_level": {
            "$ref": "#/components/schemas/WireEnum_EntityLevel_",
            "description": "'partner' or 'reporter'."
          },
          "imports": {
            "$ref": "#/components/schemas/ShocksPayload",
            "description": "The import-flow shocks."
          },
          "exports": {
            "$ref": "#/components/schemas/ShocksPayload",
            "description": "The export-flow shocks."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "entity_level",
          "imports",
          "exports"
        ],
        "title": "ShocksEndpointPayload",
        "description": "POST /api/volatility/supply-shocks and /price-shocks."
      },
      "ShocksPayload": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/ShockEvent"
            },
            "type": "array",
            "title": "Events",
            "description": "The detected shocks, ranked by abnormality."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ShocksPayload",
        "description": "The grouped supply-/price-shock payload -- the wire mirror of\n``core.computation.shapes.ShockIndicator`` (blocks nested under their event,\nperiods carried once)."
      },
      "SiblingComparison": {
        "properties": {
          "mode": {
            "type": "string",
            "const": "single",
            "title": "Mode",
            "default": "single"
          },
          "prodcom": {
            "$ref": "#/components/schemas/ProdcomMetaPayload",
            "description": "How the customs code resolved to PRODCOM: the code picker, fallback notes, the unavailability reason and the production unit."
          },
          "aggregable": {
            "type": "boolean",
            "title": "Aggregable",
            "description": "Whether the resolved PRODCOM codes sit at one hierarchy level, so that data sums them; false forces an explicit pick."
          },
          "data": {
            "additionalProperties": {
              "additionalProperties": {
                "$ref": "#/components/schemas/ComponentStatusPayload"
              },
              "propertyNames": {
                "$ref": "#/components/schemas/WireEnum_ProductionBasis_"
              },
              "type": "object"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_Measure_"
            },
            "type": "object",
            "title": "Data",
            "description": "The selected (or summed) codes' measure × basis indicator matrix; empty when unavailable."
          },
          "siblings": {
            "items": {
              "$ref": "#/components/schemas/ProdcomSibling"
            },
            "type": "array",
            "title": "Siblings",
            "description": "The same-level siblings, when a single PRODCOM code is in effect (an explicit pick or the sole mapping)."
          },
          "siblings_truncated": {
            "type": "integer",
            "title": "Siblings Truncated",
            "description": "How many siblings were cut by the cap."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prodcom",
          "aggregable",
          "data",
          "siblings",
          "siblings_truncated"
        ],
        "title": "SiblingComparison",
        "description": "Single-code mode: the code's own indicator matrix, compared with its\nsame-level PRODCOM siblings (never the parent or sub-categories, so every\nseries is directly comparable)."
      },
      "Slot": {
        "properties": {
          "role": {
            "$ref": "#/components/schemas/SlotRole",
            "description": "What the slot is."
          },
          "semantic": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SemanticRole"
              },
              {
                "type": "null"
              }
            ],
            "description": "The job the site gives this colour by name, if any (a brand colour may take one)."
          },
          "colour": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Colour",
            "description": "An sRGB colour, #RRGGBB."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role",
          "semantic",
          "colour"
        ],
        "title": "Slot",
        "description": "One chart colour."
      },
      "SlotRole": {
        "type": "string",
        "enum": [
          "primary",
          "secondary",
          "red",
          "ochre",
          "green",
          "cool",
          "free_1",
          "free_2",
          "free_3",
          "grey"
        ],
        "title": "SlotRole",
        "description": "What a chart slot is. The two brand colours, the derived colours\n(one per semantic role a brand colour did not take, then free ones),\nand the grey that is always \"rest of the world\"."
      },
      "SpecialisationBlock": {
        "properties": {
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year",
            "description": "The calendar year the RSCA is computed for."
          },
          "reporters": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SpecialisationRow"
            },
            "type": "object",
            "title": "Reporters",
            "description": "{Member State: its RSCA figures} (name-keyed, for the detail table)."
          },
          "rsca_map": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Rsca Map",
            "description": "{GISCO code: RSCA} (the choropleth view; Member States without an RSCA are absent)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "year",
          "reporters",
          "rsca_map"
        ],
        "title": "SpecialisationBlock",
        "description": "Intra-EU RSCA per Member State for one year -- the wire form of the\n``specialisation()`` result; ``rsca_map`` is the GISCO-keyed choropleth\nview of the same figures."
      },
      "SpecialisationPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "specialisation": {
            "$ref": "#/components/schemas/SpecialisationBlock",
            "description": "Intra-EU RSCA per Member State for the year."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "specialisation"
        ],
        "title": "SpecialisationPayload",
        "description": "POST /api/concentration/specialisation.  The header's\n``reporter_label`` is null: the view spans every Member State."
      },
      "SpecialisationRow": {
        "properties": {
          "rsca": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rsca",
            "description": "Revealed symmetric comparative advantage (-1 under-specialised, +1 strongly specialised)."
          },
          "rca": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rca",
            "description": "The underlying Balassa index before the symmetric transform."
          },
          "prod_share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prod Share",
            "description": "The customs code's share of the reporter's trade value."
          },
          "total_share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Share",
            "description": "The reporter's share of the EU's trade value."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "rsca",
          "rca",
          "prod_share",
          "total_share"
        ],
        "title": "SpecialisationRow",
        "description": "One reporter's RSCA figures for the year (a row of the specialisation table)."
      },
      "SubcodeComparePayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "breakdown": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NoBreakdown"
              },
              {
                "$ref": "#/components/schemas/SubcodePanels"
              }
            ],
            "title": "Breakdown",
            "description": "The panels ('ok'), or why there are none ('leaf', 'unavailable').",
            "discriminator": {
              "propertyName": "state",
              "mapping": {
                "leaf": "#/components/schemas/NoBreakdown",
                "ok": "#/components/schemas/SubcodePanels"
              }
            }
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "breakdown"
        ],
        "title": "SubcodeComparePayload",
        "description": "POST /api/descriptive/subcode-compare — per-sub-code panels for both\nflows, or why the code has none."
      },
      "SubcodeConcentration": {
        "properties": {
          "state": {
            "type": "string",
            "const": "ok",
            "title": "State",
            "default": "ok"
          },
          "subcodes": {
            "items": {
              "$ref": "#/components/schemas/SubcodeRow"
            },
            "type": "array",
            "title": "Subcodes",
            "description": "Every series of the breakdown (before the top-N cut), with its label and the definitions it reads."
          },
          "imports": {
            "$ref": "#/components/schemas/ConcentrationCompareFlow",
            "description": "The per-sub-code import HHI lines."
          },
          "exports": {
            "$ref": "#/components/schemas/ConcentrationCompareFlow",
            "description": "The per-sub-code export HHI lines."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "subcodes",
          "imports",
          "exports"
        ],
        "title": "SubcodeConcentration",
        "description": "The per-sub-code HHI lines of both flows."
      },
      "SubcodePanels": {
        "properties": {
          "state": {
            "type": "string",
            "const": "ok",
            "title": "State",
            "default": "ok"
          },
          "subcodes": {
            "items": {
              "$ref": "#/components/schemas/SubcodeRow"
            },
            "type": "array",
            "title": "Subcodes",
            "description": "Every series of the breakdown (before the top-N cut), with its label and the definitions it reads."
          },
          "supp_unit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UnitDescriptor"
              },
              {
                "type": "null"
              }
            ],
            "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
          },
          "imports": {
            "$ref": "#/components/schemas/PanelPayload",
            "description": "The per-sub-code import panel."
          },
          "exports": {
            "$ref": "#/components/schemas/PanelPayload",
            "description": "The per-sub-code export panel."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "subcodes",
          "supp_unit",
          "imports",
          "exports"
        ],
        "title": "SubcodePanels",
        "description": "The per-sub-code panels of both flows."
      },
      "SubcodeRow": {
        "properties": {
          "basket_key": {
            "type": "string",
            "title": "Basket Key",
            "description": "The key of this row's basket in the payload's per-sub-code maps: the sub-code (read over the parent piece's window), or the entered basket's label."
          },
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The sub-code (or residual spelling)."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The label of the row's (latest) definition, in the requested language when recorded."
          },
          "untranslated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Untranslated",
            "description": "True when the label fell back to English."
          },
          "segments": {
            "items": {
              "$ref": "#/components/schemas/SegmentPayload"
            },
            "type": "array",
            "title": "Segments",
            "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows)."
          },
          "residual_kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_ResidualKind_"
              },
              {
                "type": "null"
              }
            ],
            "description": "For a residual row: 'xx' or 'letter'. Residual rows explain the gap between the sub-codes and the parent, and are pinned outside the top-N ranking."
          },
          "residual_spelling": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_ResidualSpelling_"
              },
              {
                "type": "null"
              }
            ],
            "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
          },
          "residual_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_ResidualReason_"
              },
              {
                "type": "null"
              }
            ],
            "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
          },
          "in_eurostat_api": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "In Eurostat Api",
            "description": "For a residual row: whether Eurostat's API serves the spelling as a PRODUCT value (XX codes only)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "basket_key",
          "customs_code",
          "label",
          "segments"
        ],
        "title": "SubcodeRow",
        "description": "One sub-code or residual customs code row, shared by breakdown views\n(``subcode-compare``, ``concentration-compare``, ``volatility``) and\nvalidation responses (``ValidateCustomsCodeResponse.residual_customs_codes``)."
      },
      "SubcontractingIntensityPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/CodeHeader",
            "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
          },
          "prodcom": {
            "$ref": "#/components/schemas/ProdcomMetaPayload",
            "description": "How the customs code resolved to PRODCOM: the code picker, fallback notes, the unavailability reason and the production unit."
          },
          "intensity": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ComponentStatusPayload"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_Measure_"
            },
            "type": "object",
            "title": "Intensity",
            "description": "{measure: the EU27 sub-contracting intensity line and its components}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "prodcom",
          "intensity"
        ],
        "title": "SubcontractingIntensityPayload",
        "description": "POST /api/autonomy/subcontracting."
      },
      "SubcontractingReporters": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/GeoIntensityBlock"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_Measure_"
            },
            "type": "object",
            "title": "Data",
            "description": "{measure: the per-reporter intensity panel and map}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data"
        ],
        "title": "SubcontractingReporters",
        "description": "The per-reporter sub-contracting intensity, per measure, on one\nannual axis."
      },
      "SubcontractingReportersPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/CodeHeader",
            "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
          },
          "prodcom": {
            "$ref": "#/components/schemas/ProdcomMetaPayload",
            "description": "How the customs code resolved to PRODCOM: the code picker, fallback notes, the unavailability reason and the production unit."
          },
          "intensity": {
            "$ref": "#/components/schemas/SubcontractingReporters",
            "description": "The per-reporter sub-contracting intensity, per measure."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "prodcom",
          "intensity"
        ],
        "title": "SubcontractingReportersPayload",
        "description": "POST /api/autonomy/subcontracting-reporters."
      },
      "SubtreeNode": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The node's customs code."
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "The code's label, in the requested language."
          },
          "children": {
            "items": {
              "$ref": "#/components/schemas/SubtreeNode"
            },
            "type": "array",
            "title": "Children",
            "description": "The code's sub-codes."
          },
          "untranslated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Untranslated",
            "description": "True when the label fell back to English."
          },
          "is_catch_all": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Catch All",
            "description": "True for a catch-all ('other') node."
          },
          "siblings": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CodeLabel_CustomsCode_"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Siblings",
            "description": "For a catch-all ('other') node, the ordinary siblings it excludes."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "text",
          "children"
        ],
        "title": "SubtreeNode",
        "description": "One node of a CN sub-tree (recursive). The optional flags are sparse\non the wire: present when true (``siblings``: for catch-all nodes),\nabsent otherwise."
      },
      "SupplementaryTripletFrames": {
        "properties": {
          "quantity": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Quantity",
            "description": "{column: period-aligned supplementary-quantity series; null = no figure}."
          },
          "price": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Price",
            "description": "{column: period-aligned supplementary-unit price series; null = no figure}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SupplementaryTripletFrames",
        "description": "The supplementary-unit view of a triplet: its own quantity and derived\nprice; the value is shared with the primary view and not repeated."
      },
      "ThemeAnchors": {
        "properties": {
          "primary_input": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Primary Input",
            "description": "An sRGB colour, #RRGGBB."
          },
          "secondary_input": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Secondary Input",
            "description": "An sRGB colour, #RRGGBB."
          },
          "primary_chart": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Primary Chart",
            "description": "Chart slot 1: the primary as entered, unless it needed a minimum of colour or visibility on white."
          },
          "secondary_chart": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Secondary Chart",
            "description": "Chart slot 2, by the same rule."
          },
          "separation": {
            "additionalProperties": {
              "type": "number"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/Vision"
            },
            "type": "object",
            "title": "Separation",
            "description": "CIEDE2000 distance between the two chart colours, per vision type."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "primary_input",
          "secondary_input",
          "primary_chart",
          "secondary_chart",
          "separation"
        ],
        "title": "ThemeAnchors",
        "description": "The two brand colours at each stage."
      },
      "ThemeMode": {
        "type": "string",
        "enum": [
          "day",
          "night"
        ],
        "title": "ThemeMode",
        "description": "The two screen modes. Print is an export derivative, not a mode."
      },
      "ThemeMutationResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok",
            "description": "Always true; failures are HTTP errors."
          },
          "theme_preferences": {
            "$ref": "#/components/schemas/ThemePreferences"
          },
          "custom_themes": {
            "items": {
              "$ref": "#/components/schemas/CustomThemeDefinition"
            },
            "type": "array",
            "title": "Custom Themes"
          },
          "active_custom_theme": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThemeResponse"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "theme_preferences",
          "custom_themes",
          "active_custom_theme"
        ],
        "title": "ThemeMutationResponse",
        "description": "The account's theme state after a successful mutation."
      },
      "ThemePreferenceRequest": {
        "properties": {
          "selection": {
            "type": "string",
            "title": "Selection"
          },
          "mode": {
            "$ref": "#/components/schemas/WireEnum_ThemeMode_"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "selection",
          "mode"
        ],
        "title": "ThemePreferenceRequest",
        "description": "Save the selected theme and the account-wide Day/Night mode."
      },
      "ThemePreferences": {
        "properties": {
          "selection": {
            "type": "string",
            "title": "Selection"
          },
          "mode": {
            "$ref": "#/components/schemas/ThemeMode"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "selection",
          "mode"
        ],
        "title": "ThemePreferences",
        "description": "The selected theme and the account-wide screen mode."
      },
      "ThemeResponse": {
        "properties": {
          "anchors": {
            "$ref": "#/components/schemas/ThemeAnchors"
          },
          "day": {
            "$ref": "#/components/schemas/Palette",
            "description": "The screen palette."
          },
          "night": {
            "$ref": "#/components/schemas/Palette",
            "description": "The neon palette for the night mode, on black."
          },
          "print_palette": {
            "$ref": "#/components/schemas/Palette",
            "description": "The export palette: the day palette darkened for paper (exports add dashes and hatching)."
          },
          "day_tokens": {
            "$ref": "#/components/schemas/Tokens"
          },
          "night_tokens": {
            "$ref": "#/components/schemas/Tokens"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "anchors",
          "day",
          "night",
          "print_palette",
          "day_tokens",
          "night_tokens"
        ],
        "title": "ThemeResponse",
        "description": "GET /api/theme — a complete theme built from two brand colours."
      },
      "Timestamp": {
        "type": "string",
        "format": "date-time"
      },
      "Tokens": {
        "properties": {
          "bg": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Bg",
            "description": "The page."
          },
          "surface": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Surface",
            "description": "Content grounds (chart cards, tables, forms)."
          },
          "rule": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Rule",
            "description": "Faint ruling lines."
          },
          "edge": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Edge",
            "description": "Control edges, at least 3:1 on page and surface."
          },
          "text": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Text",
            "description": "An sRGB colour, #RRGGBB."
          },
          "text_muted": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Text Muted",
            "description": "An sRGB colour, #RRGGBB."
          },
          "text_inverse": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Text Inverse",
            "description": "Ink on filled controls."
          },
          "accent": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Accent",
            "description": "Selected and active states."
          },
          "accent_hover": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Accent Hover",
            "description": "An sRGB colour, #RRGGBB."
          },
          "accent_light": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9A-F]{6}$",
                "description": "An sRGB colour, #RRGGBB."
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent Light",
            "description": "The tier-2 state tint; none at night (no fill)."
          },
          "secondary": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Secondary",
            "description": "The secondary brand colour, readable as text."
          },
          "file": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "File",
            "description": "The commit (apply) fill."
          },
          "file_hover": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "File Hover",
            "description": "An sRGB colour, #RRGGBB."
          },
          "file_text": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "File Text",
            "description": "An sRGB colour, #RRGGBB."
          },
          "error": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Error",
            "description": "An sRGB colour, #RRGGBB."
          },
          "error_hover": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Error Hover",
            "description": "An sRGB colour, #RRGGBB."
          },
          "error_bg": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Error Bg",
            "description": "An sRGB colour, #RRGGBB."
          },
          "error_border": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Error Border",
            "description": "An sRGB colour, #RRGGBB."
          },
          "warning": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Warning",
            "description": "An sRGB colour, #RRGGBB."
          },
          "warning_bg": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Warning Bg",
            "description": "An sRGB colour, #RRGGBB."
          },
          "success": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Success",
            "description": "An sRGB colour, #RRGGBB."
          },
          "map_sea": {
            "type": "string",
            "pattern": "^#[0-9A-F]{6}$",
            "title": "Map Sea",
            "description": "Water on choropleth maps."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bg",
          "surface",
          "rule",
          "edge",
          "text",
          "text_muted",
          "text_inverse",
          "accent",
          "accent_hover",
          "accent_light",
          "secondary",
          "file",
          "file_hover",
          "file_text",
          "error",
          "error_hover",
          "error_bg",
          "error_border",
          "warning",
          "warning_bg",
          "success",
          "map_sea"
        ],
        "title": "Tokens",
        "description": "The interface colours of one mode (the ``--clr-*`` custom properties)."
      },
      "TopEntitiesPayload": {
        "properties": {
          "entity_level": {
            "$ref": "#/components/schemas/WireEnum_EntityLevel_",
            "description": "'partner' or 'reporter'."
          },
          "flow": {
            "$ref": "#/components/schemas/WireEnum_Flow_",
            "description": "'Imports' or 'Exports'."
          },
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The queried customs code(s)."
          },
          "reporter_label": {
            "type": "string",
            "title": "Reporter Label",
            "description": "The reporter's display label."
          },
          "partner_set_label": {
            "type": "string",
            "title": "Partner Set Label",
            "description": "The partner set's label."
          },
          "entities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Entities",
            "description": "The top entities, ranked by the requested measure."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "entity_level",
          "flow",
          "customs_code",
          "reporter_label",
          "partner_set_label",
          "entities"
        ],
        "title": "TopEntitiesPayload",
        "description": "POST /api/descriptive/top-entities — the ranked entity list, no series."
      },
      "TripletFrames": {
        "properties": {
          "quantity": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Quantity",
            "description": "{column: period-aligned quantity series (trade: net mass in tonnes; production: the PRODCOM unit); null = no figure}."
          },
          "value": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Value",
            "description": "{column: period-aligned value series (EUR); null = no figure}."
          },
          "price": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Price",
            "description": "{column: period-aligned unit value series (value per quantity unit); null = no figure}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TripletFrames",
        "description": "A quantity / value / price panel: each field ``{column: [...]}``,\nparallel to the block's own ``periods`` axis."
      },
      "UnitDescriptor": {
        "properties": {
          "unit_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Code",
            "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "The unit's display label in the response's language."
          },
          "symbol": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Symbol",
            "description": "The unit's display symbol (e.g. 't', 'l')."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UnitDescriptor",
        "description": "A quantity/supplementary unit label (``supp_unit`` / ``prodcom_unit`` /\n``quantity_unit`` in response headers)."
      },
      "ValidateCustomsCodeBatchResponse": {
        "properties": {
          "results": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ValidateCustomsCodeResponse"
                },
                {
                  "$ref": "#/components/schemas/ValidateCustomsCodeError"
                }
              ]
            },
            "type": "array",
            "title": "Results",
            "description": "The results, one per input item, in input order."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "results"
        ],
        "title": "ValidateCustomsCodeBatchResponse",
        "description": "The comma-separated batch path of validate-customs-code: each item a\nsuccess or an error."
      },
      "ValidateCustomsCodeError": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The input item as typed."
          },
          "error": {
            "$ref": "#/components/schemas/ValidateCustomsCodeErrorDetail",
            "description": "Why it failed."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code",
          "error"
        ],
        "title": "ValidateCustomsCodeError",
        "description": "One batch item's failure shape."
      },
      "ValidateCustomsCodeErrorDetail": {
        "properties": {
          "status": {
            "type": "integer",
            "title": "Status",
            "description": "The HTTP status the single-code endpoint would have returned."
          },
          "detail": {
            "type": "string",
            "title": "Detail",
            "description": "The error message."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "detail"
        ],
        "title": "ValidateCustomsCodeErrorDetail"
      },
      "ValidateCustomsCodeResponse": {
        "properties": {
          "customs_code": {
            "type": "string",
            "title": "Customs Code",
            "description": "The validated, normalised customs code."
          },
          "levels": {
            "items": {
              "$ref": "#/components/schemas/DescriptionLevel"
            },
            "type": "array",
            "title": "Levels",
            "description": "The code's CN description hierarchy (one entry per ancestor level), in the requested language."
          },
          "customs_code_label": {
            "type": "string",
            "title": "Customs Code Label",
            "description": "The code's display label (the deepest level's text).",
            "default": ""
          },
          "has_subcodes": {
            "type": "boolean",
            "title": "Has Subcodes",
            "description": "Whether the code has children in the current CN edition.",
            "default": false
          },
          "interpreted_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interpreted From",
            "description": "The raw input, when it was reformatted into customs_code (always the input as typed, never a note)."
          },
          "residual_kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_ResidualKind_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Residual class for residual spellings: 'xx' or 'letter' (reason groups report 'letter', the class of the codes they group)."
          },
          "residual_spelling": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_ResidualSpelling_"
              },
              {
                "type": "null"
              }
            ],
            "description": "The residual spelling's exact shape: 'xx', 'letter' or 'reason_group'."
          },
          "residual_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WireEnum_ResidualReason_"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reason letter of a letter code or reason group (S, Y, E, I, …)."
          },
          "in_eurostat_api": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "In Eurostat Api",
            "description": "For residual spellings: whether Eurostat's API serves the code as a PRODUCT value (XX codes only)."
          },
          "residual_customs_codes": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SubcodeRow"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Residual Customs Codes",
            "description": "Residual customs codes related to this code: those directly under a digit code (its XX code plus one reason group per reason letter), or the letter codes inside a reason group."
          },
          "in_current_cn": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "In Current Cn",
            "description": "For digit codes: whether the current CN edition lists the code. False for a code known only from its recorded history (expired or abolished)."
          },
          "segment_history": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SegmentHistoryPayload"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Segment History",
            "description": "Every recorded definition of the code, with direct recorded links; null when no classification history is recorded for it. Use these windows to compose windowed pieces (the basket request form)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customs_code"
        ],
        "title": "ValidateCustomsCodeResponse",
        "description": "GET /api/reference/validate-customs-code/{customs_code} — a validated\ncustoms code with its description hierarchy.  Also one batch item's\nsuccess shape."
      },
      "Vision": {
        "type": "string",
        "enum": [
          "normal",
          "deutan",
          "protan",
          "tritan"
        ],
        "title": "Vision",
        "description": "The viewers a palette is measured for: normal colour vision and the\nthree dichromacies (Machado et al. 2009, full severity)."
      },
      "VolatilityBar": {
        "properties": {
          "entity": {
            "type": "string",
            "title": "Entity",
            "description": "The entity (partner or reporter)."
          },
          "cv": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cv",
            "description": "Coefficient of variation (stdev/mean) over the window; higher = swings more relative to its typical level."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "entity",
          "cv"
        ],
        "title": "VolatilityBar",
        "description": "One entity's aggregate CV (0–∞, dimensionless): a row of the CV bars."
      },
      "VolatilityBars": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "ranked": {
            "items": {
              "$ref": "#/components/schemas/VolatilityBar"
            },
            "type": "array",
            "title": "Ranked",
            "description": "The per-entity CV bars, ranked."
          },
          "series": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Series",
            "description": "{entity: its period-aligned drill-down series; null = no figure}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ranked",
          "series"
        ],
        "title": "VolatilityBars",
        "description": "Per-entity CV bars with drill-down series, from\n``Presenter.volatility_bars``."
      },
      "VolatilityCombo": {
        "type": "string",
        "enum": [
          "imp-qty",
          "imp-price",
          "exp-qty",
          "exp-price"
        ],
        "title": "VolatilityCombo",
        "description": "A flow × indicator grid of ``/volatility`` (keys shared with the\nfrontend). The four grids differ only in post-load filtering, so one\ndata load serves them all."
      },
      "VolatilityGrid": {
        "properties": {
          "flow": {
            "$ref": "#/components/schemas/WireEnum_Flow_",
            "description": "'Imports' or 'Exports'."
          },
          "indicator": {
            "$ref": "#/components/schemas/WireEnum_Measure_",
            "description": "'quantity' or 'price'."
          },
          "bars": {
            "$ref": "#/components/schemas/VolatilityBars",
            "description": "The per-entity aggregate CV bars."
          },
          "heatmap": {
            "$ref": "#/components/schemas/VolatilityHeatmap",
            "description": "The entity × customs-code CV grid (empty when not requested)."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "flow",
          "indicator",
          "bars",
          "heatmap"
        ],
        "title": "VolatilityGrid",
        "description": "One flow × indicator CV view: bars + heatmap."
      },
      "VolatilityHeatmap": {
        "properties": {
          "periods": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Periods",
            "description": "The block's period axis (first day of each period); every array in this block is parallel to it."
          },
          "entities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Entities",
            "description": "The heatmap's row order (entities)."
          },
          "subcodes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Subcodes",
            "description": "The heatmap's column order (customs codes)."
          },
          "data": {
            "additionalProperties": {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "object"
            },
            "type": "object",
            "title": "Data",
            "description": "{entity: {customs_code: CV}} -- the heatmap grid; null = not computable."
          },
          "series": {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object",
            "title": "Series",
            "description": "{entity: its period-aligned drill-down series; null = no figure}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "VolatilityHeatmap",
        "description": "The entity × customs-code CV grid with drill-down series, from\n``Presenter.volatility_heatmap``."
      },
      "VolatilityPayload": {
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ResponseHeader",
            "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
          },
          "entity_level": {
            "$ref": "#/components/schemas/WireEnum_EntityLevel_",
            "description": "'partner' or 'reporter'."
          },
          "subcodes": {
            "items": {
              "$ref": "#/components/schemas/SubcodeRow"
            },
            "type": "array",
            "title": "Subcodes",
            "description": "The heatmap's sub-code series, with their labels and the definitions each reads."
          },
          "combos": {
            "additionalProperties": {
              "$ref": "#/components/schemas/VolatilityGrid"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/WireEnum_VolatilityCombo_"
            },
            "type": "object",
            "title": "Combos",
            "description": "{combo key ('imp-qty', 'imp-price', 'exp-qty', 'exp-price'): the CV grid}."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "header",
          "entity_level",
          "subcodes",
          "combos"
        ],
        "title": "VolatilityPayload",
        "description": "POST /api/volatility/volatility — keyed by combo (``imp-qty``,\n``imp-price``, ``exp-qty``, ``exp-price``); single-grid mode is a\none-entry ``combos`` map."
      },
      "WireEnum_ConsentDecision_": {
        "type": "string",
        "enum": [
          "approve",
          "deny"
        ],
        "title": "ConsentDecision",
        "description": "The user's answer on the OAuth consent page."
      },
      "WireEnum_CoverageKind_": {
        "type": "string",
        "enum": [
          "reporter_coverage",
          "total_only_period",
          "unmapped_country_code",
          "no_residuals_stored",
          "outliers_nulled",
          "supp_unit_mixed",
          "supp_coverage_gate",
          "partial_bucket",
          "component_empty",
          "negative_values",
          "cn8_residual_sibling",
          "group_residual_above"
        ],
        "title": "CoverageKind",
        "description": "The kinds of coverage note."
      },
      "WireEnum_CustomsCodeLevel_": {
        "type": "string",
        "enum": [
          "chapter",
          "heading",
          "subheading",
          "cn8",
          "total"
        ],
        "title": "CustomsCodeLevel"
      },
      "WireEnum_EntityLevel_": {
        "type": "string",
        "enum": [
          "partner",
          "reporter"
        ],
        "title": "EntityLevel",
        "description": "The geographic axis an analysis ranks or folds."
      },
      "WireEnum_ExposureIndicator_": {
        "type": "string",
        "enum": [
          "net_import_reliance",
          "trade_intensity",
          "export_propensity"
        ],
        "title": "ExposureIndicator",
        "description": "The three EU27 trade-exposure indicators."
      },
      "WireEnum_Flow_": {
        "type": "string",
        "enum": [
          "Imports",
          "Exports"
        ],
        "title": "Flow",
        "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports)."
      },
      "WireEnum_Frequency_": {
        "type": "string",
        "enum": [
          "month",
          "quarter",
          "year"
        ],
        "title": "Frequency",
        "description": "The resampling frequency of a series."
      },
      "WireEnum_Lang_": {
        "type": "string",
        "enum": [
          "bg",
          "cs",
          "da",
          "de",
          "el",
          "en",
          "es",
          "et",
          "fi",
          "fr",
          "ga",
          "hr",
          "hu",
          "it",
          "lt",
          "lv",
          "mt",
          "nl",
          "pl",
          "pt",
          "ro",
          "sk",
          "sl",
          "sv",
          "ja",
          "zh"
        ],
        "title": "Lang",
        "description": "Every language code the data or the published reports use. The value\nis the code itself: the same string in URLs, sqlite, JSON and file names.\n``JA`` and ``ZH`` have no metadata: their reports take English labels and\nexist as HTML pages only. Build a value with ``Lang(code)``, which raises\non any other code."
      },
      "WireEnum_LanguageSource_": {
        "type": "string",
        "enum": [
          "cookie",
          "accept-language",
          "default"
        ],
        "title": "LanguageSource",
        "description": "Where a first-time visitor's detected UI language came from."
      },
      "WireEnum_LinkMatch_": {
        "type": "string",
        "enum": [
          "matched",
          "unmatched"
        ],
        "title": "LinkMatch"
      },
      "WireEnum_Measure_": {
        "type": "string",
        "enum": [
          "value",
          "quantity",
          "price"
        ],
        "title": "Measure",
        "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only)."
      },
      "WireEnum_ProdcomCellFlag_": {
        "type": "string",
        "enum": [
          "confidential",
          "not_available",
          "low_quality",
          "not_applicable",
          "estimate",
          "rounded",
          "exact",
          "unflagged"
        ],
        "title": "ProdcomCellFlag",
        "description": "A DS-059358 cell's data-quality flag: the PRODCOM store's normalized\nform of Eurostat's raw flags. A value with an increasing reliability\ncaveat (``exact`` / ``rounded`` / ``estimate``), a value Eurostat\nattached no flag to (``unflagged``), or the reason Eurostat published no\nusable value (the suppressions; the cell's value is NaN).\n\nThe declaration order is the severity order (:attr:`severity`): the most\nsevere suppression first, the cleanest value last. Among the caveats an\n``estimate`` is worse than a ``rounded`` value: a rounded figure stays\nclose to the original, an estimate can diverge widely."
      },
      "WireEnum_ProdcomGap_": {
        "type": "string",
        "enum": [
          "gap_negative_apparent",
          "gap_zero_denominator",
          "gap_no_production",
          "gap_no_quantity",
          "gap_no_total_production"
        ],
        "title": "ProdcomGap",
        "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status."
      },
      "WireEnum_ProdcomIndicator_": {
        "type": "string",
        "enum": [
          "PRODVAL",
          "OWNPRODVAL",
          "SCPRODVAL",
          "IMPVAL",
          "EXPVAL",
          "PRODQNT",
          "OWNPRODQNT",
          "SCPRODQNT",
          "IMPQNT",
          "EXPQNT"
        ],
        "title": "ProdcomIndicator",
        "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one."
      },
      "WireEnum_ProdcomMappingStatus_": {
        "type": "string",
        "enum": [
          "exact",
          "fallback",
          "unavailable"
        ],
        "title": "ProdcomMappingStatus",
        "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data."
      },
      "WireEnum_ProdcomUnavailability_": {
        "type": "string",
        "enum": [
          "not_applicable",
          "no_mapping",
          "selection_required",
          "suppressed",
          "no_data"
        ],
        "title": "ProdcomUnavailability",
        "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable)."
      },
      "WireEnum_ProductionBasis_": {
        "type": "string",
        "enum": [
          "total",
          "own",
          "sub"
        ],
        "title": "ProductionBasis",
        "description": "The production basis axis: total sold production and its two\n2021-onward components, own-account and sub-contracted."
      },
      "WireEnum_RedirectKind_": {
        "type": "string",
        "enum": [
          "local",
          "vendor"
        ],
        "title": "RedirectKind",
        "description": "Why a callback is allowed: a loopback URI (local clients, RFC 8252)\nor an approved hosted vendor's documented callback."
      },
      "WireEnum_ReportRequestOutcome_": {
        "type": "string",
        "enum": [
          "done",
          "pending",
          "queued"
        ],
        "title": "ReportRequestOutcome",
        "description": "What POST /api/reports/request did: ``done`` -- a listed report\nalready exists; ``pending`` -- this report is already being generated;\n``queued`` -- generation was (re)queued."
      },
      "WireEnum_ReportStatus_": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "done",
          "failed"
        ],
        "title": "ReportStatus",
        "description": "Lifecycle of an on-demand report request: the web app enqueues, the\nworker claims (running), then closes it as done or failed."
      },
      "WireEnum_ResidualKind_": {
        "type": "string",
        "enum": [
          "xx",
          "letter"
        ],
        "title": "ResidualKind"
      },
      "WireEnum_ResidualReason_": {
        "type": "string",
        "enum": [
          "A",
          "B",
          "C",
          "E",
          "F",
          "I",
          "M",
          "P",
          "R",
          "S",
          "T",
          "V",
          "W",
          "Y"
        ],
        "title": "ResidualReason"
      },
      "WireEnum_ResidualShareUnavailable_": {
        "type": "string",
        "enum": [
          "switched_off",
          "multi_code",
          "mixed_codes",
          "pieced_basket",
          "residual_spelling",
          "total",
          "cn8_leaf",
          "no_partners",
          "no_store_data",
          "no_total_trade"
        ],
        "title": "ResidualShareUnavailable",
        "description": "Why a slice has no residual share (``ResidualShareNote.reason``)."
      },
      "WireEnum_ResidualSpelling_": {
        "type": "string",
        "enum": [
          "xx",
          "letter",
          "reason_group"
        ],
        "title": "ResidualSpelling"
      },
      "WireEnum_SearchSource_": {
        "type": "string",
        "enum": [
          "cn",
          "prodcom"
        ],
        "title": "SearchSource",
        "description": "The nomenclature a search ran over: the CN index, or the PRODCOM\nreverse mapping a dotted-notation query is answered from."
      },
      "WireEnum_SegmentKind_": {
        "type": "string",
        "enum": [
          "cn",
          "residual_xx",
          "letter_coded",
          "chapter_00",
          "other"
        ],
        "title": "SegmentKind",
        "description": "The ingest classification of one CN.txt identity."
      },
      "WireEnum_Severity_": {
        "type": "string",
        "enum": [
          "info",
          "warning"
        ],
        "title": "Severity"
      },
      "WireEnum_ShockBlockType_": {
        "type": "string",
        "enum": [
          "baseline",
          "exit",
          "disruption",
          "decline",
          "full_recovery",
          "partial_recovery",
          "depressed",
          "sporadic",
          "price spike",
          "price drop",
          "shock",
          "volatile trade",
          "price volatility",
          "volume volatility",
          "return to baseline",
          "post shock"
        ],
        "title": "ShockBlockType",
        "description": "One timeline phase of a detected shock (``ComextVolatility``): the\nbaseline, the shock itself, and the aftermath."
      },
      "WireEnum_ThemeMode_": {
        "type": "string",
        "enum": [
          "day",
          "night"
        ],
        "title": "ThemeMode",
        "description": "The two screen modes. Print is an export derivative, not a mode."
      },
      "WireEnum_VolatilityCombo_": {
        "type": "string",
        "enum": [
          "imp-qty",
          "imp-price",
          "exp-qty",
          "exp-price"
        ],
        "title": "VolatilityCombo",
        "description": "A flow × indicator grid of ``/volatility`` (keys shared with the\nfrontend). The four grids differ only in post-load filtering, so one\ndata load serves them all."
      },
      "WireEnum_OAuthErrorCode_": {
        "description": "The RFC 6749 §5.2 error codes the token endpoint answers.",
        "enum": [
          "unsupported_grant_type",
          "invalid_grant",
          "invalid_target",
          "invalid_request",
          "invalid_client_metadata",
          "invalid_redirect_uri"
        ],
        "title": "OAuthErrorCode",
        "type": "string"
      },
      "OAuthErrorBody": {
        "additionalProperties": false,
        "description": "The JSON body of a refused protocol request, at the top level of the\nresponse as RFC 6749 §5.2 and RFC 7591 §3.2.2 define it (not wrapped in\nFastAPI's ``detail``).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/WireEnum_OAuthErrorCode_",
            "description": "The RFC error code."
          },
          "error_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A human-readable explanation, for the developer.",
            "title": "Error Description"
          }
        },
        "required": [
          "error"
        ],
        "title": "OAuthErrorBody",
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "A personal API key (`eut_...`) or an OAuth 2.1 access token (see `/.well-known/oauth-authorization-server`).",
        "scheme": "bearer"
      },
      "apiKey": {
        "type": "apiKey",
        "description": "A personal API key (`eut_...`).",
        "in": "header",
        "name": "X-API-Key"
      },
      "session": {
        "type": "apiKey",
        "description": "The dashboard's sign-in session, set by `POST /api/auth/login`.",
        "in": "cookie",
        "name": "td_session"
      },
      "personalKey": {
        "type": "http",
        "description": "A personal API key (`eut_...`) sent as a bearer token. OAuth access tokens are refused here.",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "reference",
      "description": "Public reference data: country lists, UI language detection, customs-code validation/search and nomenclature trees."
    },
    {
      "name": "dashboard",
      "description": "Descriptive statistics for the main dashboard: overview totals, partner/reporter breakdowns, the map view and entity tables."
    },
    {
      "name": "subcodes",
      "description": "Cross-section views comparing sub-codes or several codes side by side."
    },
    {
      "name": "concentration",
      "description": "Concentration analysis via the Herfindahl-Hirschman Index (HHI): trade concentration across partners/Member States (overall, per sub-code and on the map) and intra-EU specialisation."
    },
    {
      "name": "volatility",
      "description": "Volatility and shock detection: coefficient-of-variation grids, sudden volume collapses, rapid price shifts and pattern shifts."
    },
    {
      "name": "vulnerability",
      "description": "Industrial-exposure indicators that join PRODCOM production with Comext trade data: Net Import Reliance, Trade Intensity and Export Propensity."
    },
    {
      "name": "autonomy",
      "description": "Industrial-autonomy indicators built on the PRODCOM sub-contracting / own-account split: how much of EU (and member-state) sold production is toll manufacturing for others."
    },
    {
      "name": "production",
      "description": "PRODCOM production volumes: EU27 and per-country production series, and how concentrated that production is across the reporting countries (HHI)."
    },
    {
      "name": "admin",
      "description": "Password-protected usage statistics."
    },
    {
      "name": "auth",
      "description": "Account lifecycle: register, email verification, login/logout, password reset and per-user preferences."
    },
    {
      "name": "searches",
      "description": "Account search lifecycle: record recent dashboard searches, save searches and remove saved searches."
    },
    {
      "name": "reports",
      "description": "On-demand report generation: request reports, list request history and trial usage, plus report-page PDF access and usefulness feedback."
    },
    {
      "name": "api-key",
      "description": "Self-service personal API key management: generate, rotate and revoke the Bearer credential used for headless/programmatic REST access."
    },
    {
      "name": "oauth",
      "description": "OAuth 2.1 authorization server backing MCP-client logins (e.g. an editor): dynamic client registration, the authorize/token/ revoke endpoints, and the account panel's connected-apps list/revoke."
    },
    {
      "name": "theme",
      "description": "The theme builder: an organisation's two brand colours in, chart palettes for day, night and print and the interface colours of day and night out. Registered users only."
    }
  ]
}