{
  "openapi": "3.1.0",
  "info": {
    "title": "Macro API",
    "description": "VandaMacro macroeconomic series - inflation, growth, labour, capital flows, CTA positioning and Vanda's macro models - with timeseries, latest values, coverage and a searchable catalog.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://dev.api.vanda-analytics.com",
      "description": "Development server"
    }
  ],
  "paths": {
    "/macro/timeseries": {
      "get": {
        "tags": [
          "Timeseries"
        ],
        "summary": "Observations for one or more series",
        "description": "Rows ordered by series, then time. Future-dated rows are kept: some series publish forecasts.\n\n`transformation`/`window` and `normalisation`/`normalisation_period` run in the shared transformation service over full history, for one series at a time; the result is under `transformation`. `window` counts observations, so on a monthly series `12` is a year.\n\n`invert` negates every value; `sum` collapses the series into one, summing values date-wise over the union of their dates (the combined rows carry no `series_id`; the sources are in `series_ids`); `cumulative_compounded` is a per-series running total of value×100 (null/NaN as 0). These are computed locally and cannot be combined with `transformation`/`normalisation`.",
        "operationId": "get_timeseries_macro_timeseries_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "series_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated series_ids from the catalogue. Ids that match no series are listed in `unresolved`.",
              "title": "Series Ids"
            },
            "description": "Comma-separated series_ids from the catalogue. Ids that match no series are listed in `unresolved`."
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\" (also 1 or v1). Omit for the latest per series.",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\" (also 1 or v1). Omit for the latest per series."
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "restated (default): the corrected history. point_in_time: values as first published. A series with no rows in that revision returns none.",
              "default": "restated"
            },
            "description": "restated (default): the corrected history. point_in_time: values as first published. A series with no rows in that revision returns none."
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated cadences (daily, weekly, monthly, ...); omit for all. Selects series, not rows: a series of another cadence is left out.",
              "title": "Frequency"
            },
            "description": "Comma-separated cadences (daily, weekly, monthly, ...); omit for all. Selects series, not rows: a series of another cadence is left out."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, ISO date or datetime",
              "title": "Start Date"
            },
            "description": "Inclusive, ISO date or datetime"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, ISO date or datetime",
              "title": "End Date"
            },
            "description": "Inclusive, ISO date or datetime"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "description": "Time order within each series",
              "default": "asc",
              "title": "Order"
            },
            "description": "Time order within each series"
          },
          {
            "name": "records_per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000,
              "minimum": 1,
              "description": "Rows per page",
              "default": 2000,
              "title": "Records Per Page"
            },
            "description": "Rows per page"
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "1-indexed",
              "default": 1,
              "title": "Page Number"
            },
            "description": "1-indexed"
          },
          {
            "name": "transformation",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TransformationEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Windowed transformation",
              "title": "Transformation"
            },
            "description": "Windowed transformation"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WindowEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Window in observations; required with transformation",
              "title": "Window"
            },
            "description": "Window in observations; required with transformation"
          },
          {
            "name": "normalisation",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NormalisationEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Applied after any transformation",
              "title": "Normalisation"
            },
            "description": "Applied after any transformation"
          },
          {
            "name": "normalisation_period",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NormalisationPeriodEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Lookback; required with normalisation",
              "title": "Normalisation Period"
            },
            "description": "Lookback; required with normalisation"
          },
          {
            "name": "invert",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Negate every value (×-1). Computed locally, not via the transformation service",
              "default": false,
              "title": "Invert"
            },
            "description": "Negate every value (×-1). Computed locally, not via the transformation service"
          },
          {
            "name": "sum",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Combine the series into one, summing values date-wise over the union of their dates. Computed locally; the combined rows carry no series_id (the sources are in the response's series_ids)",
              "default": false,
              "title": "Sum"
            },
            "description": "Combine the series into one, summing values date-wise over the union of their dates. Computed locally; the combined rows carry no series_id (the sources are in the response's series_ids)"
          },
          {
            "name": "cumulative_compounded",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Cumulative running total of value×100 per series, treating null/NaN as 0. Computed locally; with sum it runs over the combined series",
              "default": false,
              "title": "Cumulative Compounded"
            },
            "description": "Cumulative running total of value×100 per series, treating null/NaN as 0. Computed locally; with sum it runs over the combined series"
          }
        ],
        "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"
                }
              }
            }
          }
        }
      }
    },
    "/macro/latest": {
      "get": {
        "tags": [
          "Timeseries"
        ],
        "summary": "Newest observation per series",
        "description": "Newest row per series, optionally on or before `as_of`. Future-dated rows count.",
        "operationId": "get_latest_macro_latest_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "series_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated series_ids from the catalogue. Ids that match no series are listed in `unresolved`.",
              "title": "Series Ids"
            },
            "description": "Comma-separated series_ids from the catalogue. Ids that match no series are listed in `unresolved`."
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\" (also 1 or v1). Omit for the latest per series.",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\" (also 1 or v1). Omit for the latest per series."
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "restated (default): the corrected history. point_in_time: values as first published. A series with no rows in that revision returns none.",
              "default": "restated"
            },
            "description": "restated (default): the corrected history. point_in_time: values as first published. A series with no rows in that revision returns none."
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated cadences (daily, weekly, monthly, ...); omit for all. Selects series, not rows: a series of another cadence is left out.",
              "title": "Frequency"
            },
            "description": "Comma-separated cadences (daily, weekly, monthly, ...); omit for all. Selects series, not rows: a series of another cadence is left out."
          },
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Newest observation on or before this date",
              "title": "As Of"
            },
            "description": "Newest observation on or before this date"
          }
        ],
        "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"
                }
              }
            }
          }
        }
      }
    },
    "/macro/availability": {
      "get": {
        "tags": [
          "Timeseries"
        ],
        "summary": "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_macro_availability_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "series_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated series_ids from the catalogue. Ids that match no series are listed in `unresolved`.",
              "title": "Series Ids"
            },
            "description": "Comma-separated series_ids from the catalogue. Ids that match no series are listed in `unresolved`."
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Model version, e.g. \"V1\" (also 1 or v1). Omit for the latest per series.",
              "title": "Version"
            },
            "description": "Model version, e.g. \"V1\" (also 1 or v1). Omit for the latest per series."
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RevisionEnum",
              "description": "restated (default): the corrected history. point_in_time: values as first published. A series with no rows in that revision returns none.",
              "default": "restated"
            },
            "description": "restated (default): the corrected history. point_in_time: values as first published. A series with no rows in that revision returns none."
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated cadences (daily, weekly, monthly, ...); omit for all. Selects series, not rows: a series of another cadence is left out.",
              "title": "Frequency"
            },
            "description": "Comma-separated cadences (daily, weekly, monthly, ...); omit for all. Selects series, not rows: a series of another cadence is left out."
          }
        ],
        "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"
                }
              }
            }
          }
        }
      }
    },
    "/macro/catalog": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Browse the macro catalogue",
        "description": "Every series, with its metadata. Filter by any dimension from `/macro/catalog/facets` (comma-separated values), search series with `q`, keep only derived (`is_derived=true`) or source series, or look up many entries at once with `series_ids`.",
        "operationId": "list_catalog_macro_catalog_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Substring of the series_id",
              "title": "Q"
            },
            "description": "Substring of the series_id"
          },
          {
            "name": "is_derived",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true: only series Vanda computes from others; false: only the rest",
              "title": "Is Derived"
            },
            "description": "true: only series Vanda computes from others; false: only the rest"
          },
          {
            "name": "series_ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated series_ids, up to 500; ids that match no series are left out",
              "title": "Series Ids"
            },
            "description": "Comma-separated series_ids, up to 500; ids that match no series are left out"
          },
          {
            "name": "records_per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Rows per page",
              "default": 100,
              "title": "Records Per Page"
            },
            "description": "Rows per page"
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "1-indexed",
              "default": 1,
              "title": "Page Number"
            },
            "description": "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"
                }
              }
            }
          }
        }
      }
    },
    "/macro/catalog/facets": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Distinct values per catalogue dimension",
        "operationId": "get_facets_macro_catalog_facets_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "dimensions",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated, from: domain, entity_type, frequency, measure_class, metric, model, series_code, source, unit. Omit for all but series_code.",
              "title": "Dimensions"
            },
            "description": "Comma-separated, from: domain, entity_type, frequency, measure_class, metric, model, series_code, source, unit. Omit for all but series_code."
          }
        ],
        "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"
                }
              }
            }
          }
        }
      }
    },
    "/macro/catalog/{identifier}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "One catalogue entry",
        "description": "By series_id. Resolves to the series' latest version unless `version` names one.",
        "operationId": "get_catalog_entry_macro_catalog__identifier__get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "series_id",
              "title": "Identifier"
            },
            "description": "series_id"
          },
          {
            "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/CatalogEntryOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/macro/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_macro_users_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/macro/health": {
      "get": {
        "tags": [
          "Utility"
        ],
        "summary": "Health check endpoint",
        "operationId": "health_check_macro_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    },
    "/macro/test/token": {
      "post": {
        "tags": [
          "Testing"
        ],
        "summary": "Get Test Access Token",
        "description": "Generate access token for testing protected endpoints.\n    Available in local and development environments only.",
        "operationId": "get_test_token_macro_test_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Token generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials or Auth0 not configured"
          },
          "403": {
            "description": "Endpoint disabled in staging/production"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Auth0 unavailable"
          }
        },
        "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"
          },
          "series_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Series Ids"
          },
          "unresolved": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unresolved"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "default": 0
          },
          "revision": {
            "$ref": "#/components/schemas/RevisionEnum",
            "description": "The revision read",
            "default": "restated"
          }
        },
        "type": "object",
        "title": "AvailabilityResponse"
      },
      "CatalogEntryOut": {
        "properties": {
          "series_id": {
            "type": "string",
            "title": "Series Id",
            "description": "Stable series id, as a string; use it in `series_ids`"
          },
          "metric": {
            "type": "string",
            "title": "Metric"
          },
          "measure_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Measure Class"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "frequency": {
            "type": "string",
            "title": "Frequency"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date",
            "description": "Start of the series history"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Model version, e.g. \"V1\""
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "entity_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Type"
          },
          "series_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series Code",
            "description": "Series code; with `model`, groups the metrics of one series"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "vanda_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vanda Id"
          },
          "is_derived": {
            "type": "boolean",
            "title": "Is Derived",
            "description": "Precomputed by Vanda from other series, e.g. a model estimate minus the official figure",
            "default": false
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At",
            "description": "When the series' data was last loaded; null before any"
          }
        },
        "type": "object",
        "required": [
          "series_id",
          "metric",
          "frequency"
        ],
        "title": "CatalogEntryOut"
      },
      "CatalogResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CatalogEntryOut"
            },
            "type": "array",
            "title": "Data"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Entries in this page",
            "default": 0
          },
          "pagination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "CatalogResponse"
      },
      "FacetValue": {
        "properties": {
          "value": {
            "type": "string",
            "title": "Value"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "value",
          "count"
        ],
        "title": "FacetValue"
      },
      "FacetsResponse": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/FacetValue"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Facets"
          }
        },
        "type": "object",
        "title": "FacetsResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "LatestResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/MacroLatestPoint"
            },
            "type": "array",
            "title": "Data"
          },
          "series_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Series Ids"
          },
          "unresolved": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unresolved"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "default": 0
          },
          "revision": {
            "$ref": "#/components/schemas/RevisionEnum",
            "description": "The revision read",
            "default": "restated"
          }
        },
        "type": "object",
        "title": "LatestResponse"
      },
      "MacroLatestPoint": {
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Observation timestamp (UTC)"
          },
          "series_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series Id",
            "description": "Omitted on a summed series; its sources are in the response's series_ids"
          },
          "frequency": {
            "type": "string",
            "title": "Frequency"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Model version, e.g. \"V1\""
          },
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "frequency"
        ],
        "title": "MacroLatestPoint"
      },
      "MacroPoint": {
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Observation timestamp (UTC)"
          },
          "series_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series Id",
            "description": "Omitted on a summed series; its sources are in the response's series_ids"
          },
          "frequency": {
            "type": "string",
            "title": "Frequency"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Model version, e.g. \"V1\""
          },
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "frequency"
        ],
        "title": "MacroPoint"
      },
      "NormalisationEnum": {
        "type": "string",
        "enum": [
          "zscore",
          "percentile_rank"
        ],
        "title": "NormalisationEnum",
        "description": "Normalisations, applied after any transformation."
      },
      "NormalisationPeriodEnum": {
        "type": "string",
        "enum": [
          "3m",
          "6m",
          "1y",
          "2y",
          "5y",
          "Expanding",
          "All"
        ],
        "title": "NormalisationPeriodEnum",
        "description": "Lookback for a normalisation. A calendar range, so it means the same at any\ncadence: `1y` over a monthly series uses twelve observations.\n\n`All` is unbounded in both directions and so not causal — early values are\nnormalised using data from their future."
      },
      "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"
          },
          "has_previous": {
            "type": "boolean",
            "title": "Has Previous"
          }
        },
        "type": "object",
        "required": [
          "page_number",
          "records_per_page",
          "total_record_count",
          "total_pages",
          "has_next",
          "has_previous"
        ],
        "title": "PaginationMeta"
      },
      "RevisionEnum": {
        "type": "string",
        "enum": [
          "restated",
          "point_in_time"
        ],
        "title": "RevisionEnum",
        "description": "Which observations to read. Restated is the corrected history; point-in-time the values as first published."
      },
      "SeriesAvailability": {
        "properties": {
          "series_id": {
            "type": "string",
            "title": "Series Id"
          },
          "frequency": {
            "type": "string",
            "title": "Frequency"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Model version, e.g. \"V1\""
          },
          "first_ts": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Ts",
            "description": "First observation; null if none yet"
          },
          "last_ts": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Ts",
            "description": "Last observation; null if none yet"
          },
          "row_count": {
            "type": "integer",
            "title": "Row Count",
            "description": "Observations held",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "series_id",
          "frequency"
        ],
        "title": "SeriesAvailability"
      },
      "TimeseriesResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/MacroPoint"
            },
            "type": "array",
            "title": "Data"
          },
          "series_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Series Ids",
            "description": "Resolved series ids"
          },
          "unresolved": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unresolved",
            "description": "Identifiers that matched no series"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Rows in this page",
            "default": 0
          },
          "pagination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "$ref": "#/components/schemas/RevisionEnum",
            "description": "The revision read",
            "default": "restated"
          },
          "transformation": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transformation",
            "description": "The transformation service's result, when one was requested"
          }
        },
        "type": "object",
        "title": "TimeseriesResponse"
      },
      "TokenRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email",
            "description": "User email address"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "title": "Password",
            "description": "User password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "TokenRequest",
        "example": {
          "email": "basic@test.com",
          "password": "Test1234!"
        }
      },
      "TokenResponse": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token",
            "description": "JWT access token for API authentication"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type",
            "description": "Token type",
            "default": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In",
            "description": "Token expiration in seconds"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope",
            "description": "Granted scopes"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "expires_in"
        ],
        "title": "TokenResponse"
      },
      "TransformationEnum": {
        "type": "string",
        "enum": [
          "rolling_sum",
          "moving_avg"
        ],
        "title": "TransformationEnum",
        "description": "Windowed transformations. Allowed on every metric, whatever its measure_class."
      },
      "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",
          "2",
          "3",
          "4",
          "6",
          "8",
          "10",
          "12",
          "13",
          "21",
          "26",
          "52"
        ],
        "title": "WindowEnum",
        "description": "Window length in OBSERVATIONS — the upstream applies it with rowsBetween.\n\nThe names are daily-centric, shared with services that only publish daily\ndata. On a monthly series `M1` (20) means twenty months. Pick the value,\nnot the label. The OBS_ values are for weekly (4/13/26/52), bi-weekly\n(2/6/13/26), monthly (3/6/12) and quarterly (2/4/8/12) series.\n8, 10 and 21 are for charts carried over from Exante."
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}