{
  "openapi": "3.1.0",
  "info": {
    "title": "Vanda Analytics positioning API",
    "description": "High-performance positioning API with Auth0",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.vanda-analytics.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/positioning/timeseries": {
      "get": {
        "tags": [
          "Timeseries"
        ],
        "summary": "Get positioning timeseries",
        "description": "Observations for one or more series over a date range.\n\n**Cadence varies by series.** Most are daily, but some publish weekly, fortnightly or monthly, so a one-month window returns ~20 points for one series and 1 for another. Every observation the series has in the range is returned; there is no gap filling or resampling. The `frequency` field in the catalog states the intended cadence but does not always match what is published, so read the timestamps rather than assuming.\n\n`window` therefore counts **observations, not days** — `window=20` is 20 trading days on a daily series and 20 weeks on a weekly one.\n\n`transformation` and `normalisation` are computed over full history, not just the requested page, and returned under `transformation.results.data`.\n\n**`normalisation` defaults to `zscore` over `All` history.** Pass `normalisation=none` for the raw stored values.\n\nNormalisation applies to one series at a time. A multi-series request returns its rows unnormalised, with the reason under `transformation`; ask for the series individually to normalise them.\n\nTier limits apply to page size and series count.",
        "operationId": "get_timeseries_positioning_timeseries_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "series_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them.",
              "examples": [
                "BREQCOMB-ALL"
              ],
              "title": "Series Ids"
            },
            "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them."
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "restated = after later revisions; point_in_time = as known on the date. The values differ.",
              "default": "restated"
            },
            "description": "restated = after later revisions; point_in_time = as known on the date. The values differ."
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MetricEnum",
              "description": "Measure to return",
              "default": "combined_positioning"
            },
            "description": "Measure to return"
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\". Omit for the latest.",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\". Omit for the latest."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date (ISO)",
              "examples": [
                "2020-01-01"
              ],
              "title": "Start Date"
            },
            "description": "Start date (ISO)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date (ISO)",
              "examples": [
                "2024-12-31"
              ],
              "title": "End Date"
            },
            "description": "End date (ISO)"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SortDirectionEnum",
              "description": "Sort order by timestamp",
              "default": "desc"
            },
            "description": "Sort order by timestamp"
          },
          {
            "name": "records_per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000,
              "minimum": 1,
              "description": "Records per page",
              "default": 2000,
              "title": "Records Per Page"
            },
            "description": "Records per page"
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number, 1-indexed",
              "default": 1,
              "title": "Page Number"
            },
            "description": "Page number, 1-indexed"
          },
          {
            "name": "transformation",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TransformationEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Trailing-window transformation",
              "title": "Transformation"
            },
            "description": "Trailing-window transformation"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WindowEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Window in observations, not days — 20 is 20 weeks on a weekly series. Required with transformation",
              "title": "Window"
            },
            "description": "Window in observations, not days — 20 is 20 weeks on a weekly series. Required with transformation"
          },
          {
            "name": "normalisation",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/NormalisationEnum",
              "description": "Distribution normalisation. `none` returns the raw values",
              "default": "zscore"
            },
            "description": "Distribution normalisation. `none` returns the raw values"
          },
          {
            "name": "normalisation_period",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/NormalisationPeriodEnum",
              "description": "Lookback for normalisation",
              "default": "All"
            },
            "description": "Lookback for normalisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeseriesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/positioning/latest": {
      "get": {
        "tags": [
          "Timeseries"
        ],
        "summary": "Get the latest value per series",
        "description": "One row per series with the crowding signal already derived (crowded_long / neutral / crowded_short at +/-1.5 sigma).",
        "operationId": "get_latest_positioning_latest_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "series_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them.",
              "title": "Series Ids"
            },
            "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them."
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "restated = after later revisions; point_in_time = as known on the date. The values differ.",
              "default": "restated"
            },
            "description": "restated = after later revisions; point_in_time = as known on the date. The values differ."
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MetricEnum",
              "description": "Measure to return",
              "default": "combined_positioning"
            },
            "description": "Measure to return"
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\". Omit for the latest.",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\". Omit for the latest."
          },
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return the latest observation on or before this date, rather than overall",
              "title": "As Of"
            },
            "description": "Return the latest observation on or before this date, rather than overall"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LatestResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/positioning/availability": {
      "get": {
        "tags": [
          "Timeseries"
        ],
        "summary": "Get data coverage per series",
        "description": "First and last observation, and the number of observations, per series. A series with no data yet returns row_count 0 rather than being omitted.",
        "operationId": "get_availability_positioning_availability_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "series_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them.",
              "title": "Series Ids"
            },
            "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them."
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "restated = after later revisions; point_in_time = as known on the date. The values differ.",
              "default": "restated"
            },
            "description": "restated = after later revisions; point_in_time = as known on the date. The values differ."
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MetricEnum",
              "description": "Measure to report on",
              "default": "combined_positioning"
            },
            "description": "Measure to report on"
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\". Omit for the latest.",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\". Omit for the latest."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/positioning/timeseries/export": {
      "get": {
        "tags": [
          "Timeseries"
        ],
        "summary": "Export positioning timeseries",
        "description": "Full history as a downloadable file, unpaginated. Each row carries its identifiers, metric and revision so it can be joined back.",
        "operationId": "export_timeseries_positioning_timeseries_export_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "series_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them.",
              "title": "Series Ids"
            },
            "description": "Comma-separated identifiers. Accepts series_label (preferred), entity, legacy ID or series_id, and may mix them."
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "restated = after later revisions; point_in_time = as known on the date. The values differ.",
              "default": "restated"
            },
            "description": "restated = after later revisions; point_in_time = as known on the date. The values differ."
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MetricEnum",
              "description": "Measure to export",
              "default": "combined_positioning"
            },
            "description": "Measure to export"
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\". Omit for the latest.",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\". Omit for the latest."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date (ISO)",
              "title": "Start Date"
            },
            "description": "Start date (ISO)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date (ISO)",
              "title": "End Date"
            },
            "description": "End date (ISO)"
          },
          {
            "name": "export_format",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ExportFormat",
              "description": "json or csv",
              "default": "csv"
            },
            "description": "json or csv"
          },
          {
            "name": "compression",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/CompressionFormat",
              "description": "none, gzip or zip",
              "default": "none"
            },
            "description": "none, gzip or zip"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/positioning/catalog": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Browse the series catalog",
        "description": "Paged, filtered, searchable series metadata, grouped as identity, classification and the asset / geographic / investor dimensions.\n\nAn unrecognised filter is a 400, not a silent no-op.",
        "operationId": "list_catalog_positioning_catalog_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search over name, description and identifiers",
              "title": "Q"
            },
            "description": "Free-text search over name, description and identifiers"
          },
          {
            "name": "dataset_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "e.g. POS.BR.FI.V1",
              "title": "Dataset Id"
            },
            "description": "e.g. POS.BR.FI.V1"
          },
          {
            "name": "model_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "e.g. CFTC",
              "title": "Model Id"
            },
            "description": "e.g. CFTC"
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Product"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Domain"
            }
          },
          {
            "name": "universe",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Universe"
            }
          },
          {
            "name": "asset_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "EQ, FX, FI, COM",
              "title": "Asset Type"
            },
            "description": "EQ, FX, FI, COM"
          },
          {
            "name": "asset_subtype",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Asset Subtype"
            }
          },
          {
            "name": "benchmark_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Benchmark Code"
            }
          },
          {
            "name": "geography",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Geography"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Country"
            }
          },
          {
            "name": "dm_em",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "DM or EM",
              "title": "Dm Em"
            },
            "description": "DM or EM"
          },
          {
            "name": "investor_category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Investor Category"
            }
          },
          {
            "name": "investor_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Investor Type"
            }
          },
          {
            "name": "investor_origin",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Investor Origin"
            }
          },
          {
            "name": "investor_subtype",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Investor Subtype"
            }
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Sector"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Frequency"
            }
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Metric"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\"",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\""
          },
          {
            "name": "records_per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Records per page",
              "default": 100,
              "title": "Records Per Page"
            },
            "description": "Records per page"
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number, 1-indexed",
              "default": 1,
              "title": "Page Number"
            },
            "description": "Page number, 1-indexed"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/positioning/catalog/facets": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Distinct values per catalog dimension",
        "description": "Distinct values per dimension, for building filter UIs.",
        "operationId": "get_facets_positioning_catalog_facets_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "dimensions",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated dimensions. Defaults to all.",
              "title": "Dimensions"
            },
            "description": "Comma-separated dimensions. Defaults to all."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacetsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/positioning/catalog/{identifier}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Get one series' metadata and coverage",
        "description": "Metadata for a single series with its coverage attached. Accepts series_label, entity, legacy ID or series_id.",
        "operationId": "get_catalog_entry_positioning_catalog__identifier__get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Registry ID, entity, or legacy series ID",
              "title": "Identifier"
            },
            "description": "Registry ID, entity, or legacy series ID"
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "Which revision the reported coverage refers to",
              "default": "restated"
            },
            "description": "Which revision the reported coverage refers to"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogEntryDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/positioning/users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Current user's tier and request limits",
        "description": "The caller's tier and the request limits that follow from it.",
        "operationId": "get_me_positioning_users_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/positioning/health": {
      "get": {
        "tags": [
          "Utility",
          "Utility"
        ],
        "summary": "Health check endpoint",
        "operationId": "health_check_positioning_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "description": "Root endpoint providing service metadata.",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "schemas": {
      "AvailabilityResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SeriesAvailability"
            },
            "type": "array",
            "title": "Data",
            "description": "Coverage per series"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Measure the coverage refers to"
          },
          "revision": {
            "$ref": "#/components/schemas/RevisionEnum",
            "description": "Which revision the coverage is for"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of series returned"
          }
        },
        "type": "object",
        "required": [
          "data",
          "metric",
          "revision",
          "count"
        ],
        "title": "AvailabilityResponse",
        "description": "Coverage response, one row per series."
      },
      "CatalogEntry": {
        "properties": {
          "identity": {
            "$ref": "#/components/schemas/SeriesIdentity"
          },
          "classification": {
            "$ref": "#/components/schemas/SeriesClassification"
          },
          "asset": {
            "$ref": "#/components/schemas/SeriesAssetDimensions"
          },
          "geographic": {
            "$ref": "#/components/schemas/SeriesGeographicDimensions"
          },
          "investor": {
            "$ref": "#/components/schemas/SeriesInvestorDimensions"
          },
          "sector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "metric": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metric"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "identity",
          "classification",
          "asset",
          "geographic",
          "investor"
        ],
        "title": "CatalogEntry",
        "description": "One series' metadata, grouped as in the Unified Data Model."
      },
      "CatalogEntryDetail": {
        "properties": {
          "identity": {
            "$ref": "#/components/schemas/SeriesIdentity"
          },
          "classification": {
            "$ref": "#/components/schemas/SeriesClassification"
          },
          "asset": {
            "$ref": "#/components/schemas/SeriesAssetDimensions"
          },
          "geographic": {
            "$ref": "#/components/schemas/SeriesGeographicDimensions"
          },
          "investor": {
            "$ref": "#/components/schemas/SeriesInvestorDimensions"
          },
          "sector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "metric": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metric"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "availability": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SeriesAvailability"
              },
              {
                "type": "null"
              }
            ],
            "description": "Coverage; null if the series has no data yet"
          }
        },
        "type": "object",
        "required": [
          "identity",
          "classification",
          "asset",
          "geographic",
          "investor"
        ],
        "title": "CatalogEntryDetail",
        "description": "A catalog entry with its coverage in the fact table attached."
      },
      "CatalogResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CatalogEntry"
            },
            "type": "array",
            "title": "Data",
            "description": "Catalog entries"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Entries on this page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta",
            "description": "Pagination metadata"
          }
        },
        "type": "object",
        "required": [
          "data",
          "count",
          "pagination"
        ],
        "title": "CatalogResponse",
        "description": "Paged catalog listing."
      },
      "CompressionFormat": {
        "type": "string",
        "enum": [
          "none",
          "gzip",
          "zip"
        ],
        "title": "CompressionFormat",
        "description": "Compression format options for exports"
      },
      "ExportFormat": {
        "type": "string",
        "enum": [
          "json",
          "csv"
        ],
        "title": "ExportFormat",
        "description": "Export format options for API responses"
      },
      "FacetsResponse": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Facets",
            "description": "Dimension -> sorted distinct values"
          },
          "total_series": {
            "type": "integer",
            "title": "Total Series",
            "description": "Series the facets summarise"
          }
        },
        "type": "object",
        "required": [
          "facets",
          "total_series"
        ],
        "title": "FacetsResponse",
        "description": "Distinct values per filterable dimension."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "LatestResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PositioningLatestPoint"
            },
            "type": "array",
            "title": "Data",
            "description": "Latest observation per series"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Measure returned"
          },
          "revision": {
            "$ref": "#/components/schemas/RevisionEnum",
            "description": "Which revision this is"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of series returned"
          }
        },
        "type": "object",
        "required": [
          "data",
          "metric",
          "revision",
          "count"
        ],
        "title": "LatestResponse",
        "description": "Latest-observation response, one row per series."
      },
      "MetricEnum": {
        "type": "string",
        "enum": [
          "combined_positioning"
        ],
        "title": "MetricEnum",
        "description": "Measures available. Long-format table, so new measures drop in here."
      },
      "NormalisationEnum": {
        "type": "string",
        "enum": [
          "zscore",
          "percentile_rank",
          "none"
        ],
        "title": "NormalisationEnum",
        "description": "Distribution normalisations. Mirrors the transformation service, plus\nNONE, which is ours alone: it opts out of the default and is never sent."
      },
      "NormalisationPeriodEnum": {
        "type": "string",
        "enum": [
          "3m",
          "6m",
          "1y",
          "2y",
          "5y",
          "Expanding",
          "All"
        ],
        "title": "NormalisationPeriodEnum",
        "description": "Calendar lookbacks — WindowEnum counts rows. Values must stay identical\nto NormalisationPeriodEnum in the transformation service, which is what\nactually computes them."
      },
      "PaginationMeta": {
        "properties": {
          "page_number": {
            "type": "integer",
            "title": "Page Number",
            "description": "Current page, 1-indexed"
          },
          "records_per_page": {
            "type": "integer",
            "title": "Records Per Page",
            "description": "Records requested per page"
          },
          "total_record_count": {
            "type": "integer",
            "title": "Total Record Count",
            "description": "Total records matching the query"
          },
          "total_pages": {
            "type": "integer",
            "title": "Total Pages",
            "description": "Total pages available"
          },
          "has_next": {
            "type": "boolean",
            "title": "Has Next",
            "description": "Whether a further page exists"
          },
          "has_previous": {
            "type": "boolean",
            "title": "Has Previous",
            "description": "Whether a previous page exists"
          }
        },
        "type": "object",
        "required": [
          "page_number",
          "records_per_page",
          "total_record_count",
          "total_pages",
          "has_next",
          "has_previous"
        ],
        "title": "PaginationMeta",
        "description": "Pagination metadata attached to list responses."
      },
      "PositioningLatestPoint": {
        "properties": {
          "series_id": {
            "type": "integer",
            "title": "Series Id",
            "description": "Registry series ID"
          },
          "series_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series Label",
            "description": "dataset_id:entity:metric"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Model version, e.g. \"V1\""
          },
          "legacy_series_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Legacy Series Id",
            "description": "Legacy catalog ID"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Display name"
          },
          "asset_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Type",
            "description": "EQ, FX, FI, COM"
          },
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Timestamp of the latest observation"
          },
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value",
            "description": "Latest value"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit",
            "description": "Unit of the value"
          },
          "signal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SignalEnum"
              },
              {
                "type": "null"
              }
            ],
            "description": "Crowding bucket"
          }
        },
        "type": "object",
        "required": [
          "series_id",
          "ts"
        ],
        "title": "PositioningLatestPoint",
        "description": "Latest observation for one series, with name and signal for screening."
      },
      "PositioningPoint": {
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Observation timestamp (UTC)"
          },
          "series_id": {
            "type": "integer",
            "title": "Series Id",
            "description": "Registry series ID"
          },
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value",
            "description": "Observed value"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit",
            "description": "Unit of the value, e.g. zscore"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "series_id"
        ],
        "title": "PositioningPoint",
        "description": "A single positioning observation."
      },
      "RevisionEnum": {
        "type": "string",
        "enum": [
          "restated",
          "point_in_time"
        ],
        "title": "RevisionEnum",
        "description": "Which revision to return. Every observation is published twice and the\nvalues differ: restated is after later revisions, point_in_time is as\nknown on the date. Charts want restated, backtests point_in_time."
      },
      "SeriesAssetDimensions": {
        "properties": {
          "asset_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Type",
            "description": "EQ, FX, FI, COM"
          },
          "asset_subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Subtype"
          },
          "asset_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Code"
          },
          "benchmark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Benchmark"
          },
          "benchmark_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Benchmark Code"
          }
        },
        "type": "object",
        "title": "SeriesAssetDimensions"
      },
      "SeriesAvailability": {
        "properties": {
          "series_id": {
            "type": "integer",
            "title": "Series Id",
            "description": "Registry series ID"
          },
          "first_ts": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Ts",
            "description": "Earliest observation"
          },
          "last_ts": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Ts",
            "description": "Most recent observation"
          },
          "row_count": {
            "type": "integer",
            "title": "Row Count",
            "description": "Number of observations",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "series_id"
        ],
        "title": "SeriesAvailability",
        "description": "Coverage of one series in the fact table."
      },
      "SeriesClassification": {
        "properties": {
          "product": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product",
            "description": "Commercial surface"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain",
            "description": "Analytical domain"
          },
          "universe": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Universe",
            "description": "Market universe"
          },
          "dataset": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dataset",
            "description": "Logical dataset name"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model name"
          }
        },
        "type": "object",
        "title": "SeriesClassification",
        "description": "Classification block — the Unified Data Model hierarchy."
      },
      "SeriesGeographicDimensions": {
        "properties": {
          "geography": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geography"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Code"
          },
          "dm_em": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dm Em",
            "description": "DM or EM"
          }
        },
        "type": "object",
        "title": "SeriesGeographicDimensions"
      },
      "SeriesIdentity": {
        "properties": {
          "series_id": {
            "type": "integer",
            "title": "Series Id",
            "description": "Registry series ID"
          },
          "series_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series Label",
            "description": "dataset_id:entity:metric — the preferred handle"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Model version, e.g. \"V1\""
          },
          "dataset_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dataset Id",
            "description": "e.g. POS.BR.FI.V1"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id",
            "description": "Producing model, e.g. CFTC"
          },
          "entity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity",
            "description": "Entity, not unique on its own"
          },
          "legacy_series_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Legacy Series Id",
            "description": "Pre-registry catalog ID"
          },
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Aliases",
            "description": "Other resolvable identifiers"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Display name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "What the series measures"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date",
            "description": "First expected data date"
          },
          "frequency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Frequency",
            "description": "Publication frequency"
          },
          "lag": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lag",
            "description": "Publication lag in days"
          },
          "update_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Update Time",
            "description": "Expected publication time"
          }
        },
        "type": "object",
        "required": [
          "series_id"
        ],
        "title": "SeriesIdentity",
        "description": "Identity block of a catalog entry."
      },
      "SeriesInvestorDimensions": {
        "properties": {
          "investor_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Investor Category"
          },
          "investor_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Investor Type"
          },
          "investor_origin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Investor Origin"
          },
          "investor_subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Investor Subtype"
          }
        },
        "type": "object",
        "title": "SeriesInvestorDimensions"
      },
      "SignalEnum": {
        "type": "string",
        "enum": [
          "crowded_long",
          "neutral",
          "crowded_short"
        ],
        "title": "SignalEnum",
        "description": "Crowding bucket. Threshold matches SIGNAL_THRESHOLD_SIGMA in\napp/frontend/src/app/us-equities/positioning.ts, so API and chart agree."
      },
      "SortDirectionEnum": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ],
        "title": "SortDirectionEnum",
        "description": "Sort direction enumeration."
      },
      "TimeseriesResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PositioningPoint"
            },
            "type": "array",
            "title": "Data",
            "description": "Observations, one per timestamp per series"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Measure returned"
          },
          "revision": {
            "$ref": "#/components/schemas/RevisionEnum",
            "description": "Which revision this is"
          },
          "series_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Series Ids",
            "description": "Series included in this response"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Version returned; null if series span versions"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of records on this page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta",
            "description": "Pagination metadata"
          },
          "transformation": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transformation",
            "description": "Transformation results, when requested"
          }
        },
        "type": "object",
        "required": [
          "data",
          "metric",
          "revision",
          "series_ids",
          "count",
          "pagination"
        ],
        "title": "TimeseriesResponse",
        "description": "Positioning timeseries response."
      },
      "TransformationEnum": {
        "type": "string",
        "enum": [
          "rolling_sum",
          "moving_avg"
        ],
        "title": "TransformationEnum",
        "description": "Trailing-window transformations. Mirrors the transformation service."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WindowEnum": {
        "type": "string",
        "enum": [
          "5",
          "20",
          "30",
          "60",
          "90",
          "120",
          "252"
        ],
        "title": "WindowEnum",
        "description": "Window in trading days (rows). Matches the transformation service."
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}