{
  "openapi": "3.1.0",
  "info": {
    "title": "BFF read API",
    "version": "3.2.18",
    "description": "What the screens, and people's tools, read of the platform's record. A caller needs `data:read`: a person by the realm role `trader` or `analyst`, a client by its scope. It reads every registered feeder's series and every forecast's copy; a person also its own (`ext.{username}.…`); never another person's. A series it may not read is answered as one that does not exist. It also computes indicators on those series (`/v1/indicators`), as known at a cut-off, on the caller's parameters, and returns them without storing them."
  },
  "servers": [
    {
      "url": "http://localhost:8620",
      "description": "Development"
    }
  ],
  "security": [
    {
      "oauth2": [
        "data:read"
      ]
    }
  ],
  "paths": {
    "/v1/series": {
      "get": {
        "operationId": "listSeries",
        "summary": "The series the caller may read",
        "description": "The catalog, in the order of the series' names: those the caller may read, as known at `as_of`, a series first known after it left out. Read by pages, at most 1,000 series a page. With `view=basic` each series is its name, kind, unit, currency, market, product and origin; with `view=full`, also its lineage, its description, its source, what defines it, the card in force for its last value (with when it was set), and its first and last valid times and latest known time, as of the cut. A forecast's copy takes its target's market and product. `filter` takes `name`, `description`, `namespace`, `market`, `product`, `origin` and `lineage`, as in `market = \"DE-LU\" AND origin = \"fetched\"`; `:` searches a text, as `name:\"de_lu\" OR description:\"day-ahead\"`, its case as written. The parameters before 3.2.18, `market`, `product`, `source` and `q`, are refused (`invalid_request`), saying what replaces each.",
        "parameters": [
          {
            "$ref": "#/components/parameters/filter"
          },
          {
            "$ref": "#/components/parameters/view"
          },
          {
            "$ref": "#/components/parameters/as_of"
          },
          {
            "name": "timeline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "live"
            },
            "description": "The timeline read: `live` (the default), the platform's one real timeline; or a simulation of the caller's own (`tara.backtest`), seen with `live`. No other timeline is seen (`timeline_not_allowed`)."
          },
          {
            "$ref": "#/components/parameters/series_limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesList"
                },
                "example": {
                  "series": [
                    {
                      "name": "entsoe.de_lu_load_forecast",
                      "kind": "number",
                      "unit": "MW",
                      "currency": null,
                      "market": "DE-LU",
                      "product": "day-ahead",
                      "origin": "fetched"
                    },
                    {
                      "name": "entsoe.de_lu_price",
                      "kind": "number",
                      "unit": "EUR/MWh",
                      "currency": "EUR",
                      "market": "DE-LU",
                      "product": "day-ahead",
                      "origin": "fetched"
                    }
                  ],
                  "next_cursor": "eyJrIjpbImVudHNvZS5kZV9sdV9wcmljZSJdLCJsIjoic2VyaWVzIiwicSI6IjJkYTIyOWUwYmQ0NTA2ZWIiLCJ2IjoxfQ"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_filter`: a `filter` that does not read, or names a field this list does not have; `invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_time`: an `as_of` without its offset; `invalid_request`: a `limit` that is no whole number from 1, a `view` that is neither `basic` nor `full`, or a parameter of the catalog before 3.2.18",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`, or another's simulation (`timeline_not_allowed`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/series/{name}": {
      "get": {
        "operationId": "getSeries",
        "summary": "One series",
        "description": "Its description, which never changes; its source; its lineage; the card in force at `valid_at` (for its last value, if absent); and its first and last valid times and latest known time, as of the cut.\nErrors: `unknown_series`, `invalid_time`, `timeline_not_allowed`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/series_name"
          },
          {
            "name": "valid_at",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "The valid time whose card is wanted; the last value's if absent.",
            "required": false
          },
          {
            "$ref": "#/components/parameters/as_of"
          },
          {
            "name": "timeline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "live"
            },
            "description": "The timeline read: `live` (the default), the platform's one real timeline; or a simulation of the caller's own (`tara.backtest`), seen with `live`. No other timeline is seen (`timeline_not_allowed`)."
          }
        ],
        "responses": {
          "200": {
            "description": "The series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Series"
                },
                "example": {
                  "name": "entsoe.de_lu_price",
                  "kind": "number",
                  "unit": "EUR/MWh",
                  "currency": "EUR",
                  "market": "DE-LU",
                  "product": "day-ahead",
                  "origin": "fetched",
                  "lineage": "RAW-01",
                  "description": "Day-ahead price, DE-LU (DE-AT-LU before October 2018), in the steps the source publishes. ENTSO-E Transparency Platform.",
                  "source": {
                    "kind": "feeder",
                    "id": "feeder.entsoe",
                    "description": "ENTSO-E Transparency Platform",
                    "status": "active"
                  },
                  "definition": null,
                  "card": {
                    "valid_from": "2025-09-30T22:00:00Z",
                    "set_at": "2026-11-02T09:14:07Z",
                    "grid": "PT15M",
                    "zone": "Europe/Berlin",
                    "publishes": {
                      "day_before": "13:00"
                    },
                    "revises": false,
                    "origin": "fetched",
                    "lineage": "RAW-01"
                  },
                  "first_valid_at": "2018-09-30T22:00:00Z",
                  "last_valid_at": "2026-11-20T22:45:00Z",
                  "latest_known_at": "2026-11-19T12:00:00Z"
                }
              }
            }
          },
          "400": {
            "description": "`unknown_series`: a series that does not exist or that the caller may not read; `invalid_time`: a `valid_at` or `as_of` without its offset",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`, or another's simulation (`timeline_not_allowed`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/series/{name}/cards": {
      "get": {
        "operationId": "listSeriesCards",
        "summary": "Every version of a series' card",
        "description": "Every version of a series' card in force from its valid time, by `valid_from`, the first from the beginning of time, each with when it was set. A series whose step changed (the day-ahead price, hours until Oct. 1, 2025 and quarter-hours since) has a card for each. A series without a card has none.",
        "parameters": [
          {
            "$ref": "#/components/parameters/series_name"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The cards, by `valid_from`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardList"
                },
                "example": {
                  "cards": [
                    {
                      "set_at": "2026-11-02T09:14:07Z",
                      "grid": "PT1H",
                      "zone": "Europe/Berlin",
                      "publishes": {
                        "day_before": "13:00"
                      },
                      "revises": false,
                      "origin": "fetched",
                      "lineage": "RAW-01"
                    },
                    {
                      "valid_from": "2025-09-30T22:00:00Z",
                      "set_at": "2026-11-02T09:14:07Z",
                      "grid": "PT15M",
                      "zone": "Europe/Berlin",
                      "publishes": {
                        "day_before": "13:00"
                      },
                      "revises": false,
                      "origin": "fetched",
                      "lineage": "RAW-01"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "`unknown_series`: a series that does not exist or that the caller may not read; `invalid_cursor`: a `cursor` that this list did not give for this request; `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/series/{name}/versions": {
      "get": {
        "operationId": "listValueVersions",
        "summary": "Every version of a series' values in a range",
        "description": "What was said of each valid time, and when: each version known at `as_of` with its value, status and three times, every column, oldest first within a valid time. A forecast's earlier runs, a price's preliminary and final, a value and its withdrawal. Read by pages, in the order of valid time, then of known time; a cursor carries the cut the read began with.",
        "parameters": [
          {
            "$ref": "#/components/parameters/series_name"
          },
          {
            "$ref": "#/components/parameters/start"
          },
          {
            "$ref": "#/components/parameters/end"
          },
          {
            "$ref": "#/components/parameters/as_of"
          },
          {
            "name": "timeline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "live"
            },
            "description": "The timeline read: `live` (the default), the platform's one real timeline; or a simulation of the caller's own (`tara.backtest`), seen with `live`. No other timeline is seen (`timeline_not_allowed`)."
          },
          {
            "$ref": "#/components/parameters/rows_limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of versions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValuesPage"
                },
                "example": {
                  "as_of": "2026-11-19T14:00:00Z",
                  "recorded_as_of": null,
                  "series": {
                    "entsoe.de_lu_load_forecast": {
                      "kind": "number",
                      "unit": "MW",
                      "valid_at": [
                        "2026-11-20T11:00:00Z",
                        "2026-11-20T11:00:00Z"
                      ],
                      "known_at": [
                        "2026-11-19T09:00:00Z",
                        "2026-11-19T13:31:09Z"
                      ],
                      "recorded_at": [
                        "2026-11-19T09:01:12Z",
                        "2026-11-19T13:31:40Z"
                      ],
                      "published_at": [
                        null,
                        null
                      ],
                      "known_by": [
                        "due",
                        "revision"
                      ],
                      "value": [
                        61234.0,
                        61980.0
                      ],
                      "status": [
                        null,
                        null
                      ],
                      "flags": [
                        [],
                        []
                      ],
                      "flag_reason": [
                        null,
                        null
                      ],
                      "run_id": [
                        null,
                        null
                      ]
                    }
                  },
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "`unknown_series`: a series that does not exist or that the caller may not read; `invalid_time`: a time without its offset; `invalid_cursor`: a `cursor` that this list did not give for this request; `invalid_request`: `start` not before `end`, or a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`, or another's simulation (`timeline_not_allowed`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/values": {
      "get": {
        "operationId": "readValues",
        "summary": "Series' values, as known at a moment",
        "description": "For each series and each valid time in [`start`, `end`), the latest version known at `as_of`, with its status and its three times. Without `fill`, the times the store holds. With `fill=step`, every step of each series' grid in the range, by its card, joins them: a step without a value is null, and says why in `status`, as of the cut (the trading plan's 2.4: the publication calendars as known then, the reads of the source made by then). A series whose card states no grid has its stored times alone; a value off the grid is never left out. A card is read as stored now: a correction of it is a correction of what was always expected.\n\nRead by pages, in the order of the series named and then of valid time: `limit` rows a page, a filled step among them, and at most what the read API holds in one read (`PF_API_MAX_ROWS`). A cursor carries the cut the read began with, so the pages of one read agree, however long it runs, and any copy of the API answers any page. A page names each series its rows reach; a series whose rows run over two pages is on both, and its columns are joined page after page.\n\nA function's read through the run listener is given whole, in one answer, at the call's cut-off; a read of more than the read API holds in one read is refused there (`payload_too_large`).\n\nAsked as columns (`Accept: application/vnd.apache.arrow.stream`), a page is one Arrow stream: a column a field of `Values`, by the same names, a row a value or a filled step, the series' name in `series`; and `series` may name up to 500. Columns hold numbers: a series of text or of arrays is read as JSON (`invalid_request`).",
        "parameters": [
          {
            "name": "series",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1,
              "maxItems": 500
            },
            "style": "form",
            "explode": false,
            "description": "The series, by their names, separated by commas or repeated: at most 20 as JSON, more refused (`invalid_request`); at most 500 as columns.",
            "example": [
              "entsoe.de_lu_price",
              "jao.auction_price_hu_rs"
            ]
          },
          {
            "$ref": "#/components/parameters/start"
          },
          {
            "$ref": "#/components/parameters/end"
          },
          {
            "$ref": "#/components/parameters/as_of"
          },
          {
            "name": "recorded_as_of",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "A second cut, by `recorded_at`: only what the platform held by then. It reaches at most to now less the longest a push may take, so that the same cut answers the same later; a later one is refused (`invalid_time`).",
            "required": false
          },
          {
            "name": "as_of_offset",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^-P\\d+D@[0-2][0-9]:[0-5][0-9]$"
            },
            "example": "-P1D@10:40",
            "description": "Planned for 3.3; refused until then (`invalid_request`). A cut relative to each delivery day: each day's values as known at that clock time, so many days before it, in the series' zone. In place of `as_of`.",
            "required": false
          },
          {
            "name": "timeline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "live"
            },
            "description": "The timeline read: `live` (the default), the platform's one real timeline; or a simulation of the caller's own (`tara.backtest`), seen with `live`. No other timeline is seen (`timeline_not_allowed`)."
          },
          {
            "name": "fill",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "none",
                "step"
              ],
              "default": "none"
            },
            "description": "`step`: every step of the grid, the missing ones with their reason; `none`, the times the store holds. The filled steps count against `limit`.",
            "required": false
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "basic",
                "full"
              ],
              "default": "basic"
            },
            "description": "`basic`: `kind`, `unit`, `valid_at`, `value`, `status` and `known_at`; `full`: every column, the error estimates among them (`estimates`).",
            "required": false
          },
          {
            "$ref": "#/components/parameters/rows_limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of values",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValuesPage"
                },
                "example": {
                  "as_of": "2026-11-19T14:00:00Z",
                  "recorded_as_of": null,
                  "series": {
                    "entsoe.de_lu_price": {
                      "kind": "number",
                      "unit": "EUR/MWh",
                      "valid_at": [
                        "2026-11-19T23:00:00Z",
                        "2026-11-19T23:15:00Z",
                        "2026-11-19T23:30:00Z",
                        "2026-11-19T23:45:00Z"
                      ],
                      "known_at": [
                        "2026-11-19T12:00:00Z",
                        "2026-11-19T12:00:00Z",
                        "2026-11-19T12:00:00Z",
                        "2026-11-19T12:00:00Z"
                      ],
                      "value": [
                        96.12,
                        91.4,
                        88.03,
                        85.77
                      ],
                      "status": [
                        null,
                        null,
                        null,
                        null
                      ]
                    },
                    "jao.auction_price_hu_rs": {
                      "kind": "number",
                      "unit": "EUR/MWh",
                      "valid_at": [
                        "2026-11-19T23:00:00Z"
                      ],
                      "known_at": [
                        "2026-11-19T08:35:00Z"
                      ],
                      "value": [
                        null
                      ],
                      "status": [
                        "cancelled"
                      ]
                    }
                  },
                  "next_cursor": null
                }
              },
              "application/vnd.apache.arrow.stream": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "One stream of one record batch. Its columns: `series` (text), `valid_at` and `known_at` (instants in microseconds, UTC), `value` (a double), `status` (text); in `full`, also `valid_until`, `recorded_at` and `published_at` (instants), `known_by`, `flag_reason` and `run_id` (text), `flags` (a list of texts), and `estimates.{name}` (a double) for each error estimate a series of the page declares. The schema's metadata holds, under `bff`, as JSON, what is the page's: `as_of`, `recorded_as_of`, `next_cursor`, and each series' `kind` and `unit`."
                }
              }
            }
          },
          "400": {
            "description": "A bad request: `invalid_request` (no series, more than 20, `start` not before `end`, a `fill` or `view` that is none of its own, `as_of_offset`, which is planned for 3.3, a `limit` that is no whole number from 1), `invalid_time` (a time without its offset, or a `recorded_as_of` later than the clock less twice the longest a push may take), `invalid_cursor` (a `cursor` that this list did not give for this request), or `unknown_series` for a series that does not exist or that the caller may not read",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`, or another's simulation (`timeline_not_allowed`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "A function's read, through the run listener, of more rows than one read holds (`payload_too_large`): ask for less",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          },
          {
            "runToken": []
          }
        ]
      }
    },
    "/v1/coverage": {
      "get": {
        "operationId": "readCoverage",
        "summary": "How much of a range has values, and why the rest has none",
        "description": "For each series and the range, as of the cut: the steps its grid has, with the times the store holds off it, how many hold a value, and how many are missing by each reason (the trading plan's 2.4). It counts what `GET /v1/values` with `fill=step` lists, and the two agree at every cut. A series whose card states no grid counts its stored times alone. Not paged: a series a count.",
        "parameters": [
          {
            "name": "series",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1,
              "maxItems": 500
            },
            "style": "form",
            "explode": false,
            "description": "The series, by their names, separated by commas or repeated; at most 500, more refused (`invalid_request`).",
            "example": [
              "entsoe.de_lu_price",
              "entsoe.de_lu_load_forecast"
            ]
          },
          {
            "$ref": "#/components/parameters/start"
          },
          {
            "$ref": "#/components/parameters/end"
          },
          {
            "$ref": "#/components/parameters/as_of"
          },
          {
            "name": "timeline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "live"
            },
            "description": "The timeline read: `live` (the default), the platform's one real timeline; or a simulation of the caller's own (`tara.backtest`), seen with `live`. No other timeline is seen (`timeline_not_allowed`)."
          }
        ],
        "responses": {
          "200": {
            "description": "The counts, a series each",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coverage"
                },
                "example": {
                  "as_of": "2026-11-19T14:00:00Z",
                  "series": {
                    "entsoe.de_lu_price": {
                      "steps": 96,
                      "has_value": 96,
                      "missing": {}
                    },
                    "entsoe.de_lu_load_forecast": {
                      "steps": 96,
                      "has_value": 84,
                      "missing": {
                        "source_down": 12
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad request: `invalid_request` (no series, more than 500, a missing `start` or `end`, `start` not before `end`), `invalid_time` (a time without its offset), or `unknown_series` for a series that does not exist or that the caller may not read",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`, or another's simulation (`timeline_not_allowed`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Who the caller is, and what it reads",
        "description": "Anyone signed in may ask, even with no right to read: `reads` then says they read nothing, and `scopes` what they may do instead. Any valid token may ask, with no scope.",
        "responses": {
          "200": {
            "description": "The caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`program_refused`: a program that is suspended, has no record, or whose owner may no longer read. Any route answers so to such a program.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ],
        "parameters": []
      }
    },
    "/v1/meta": {
      "get": {
        "operationId": "getMeta",
        "summary": "The release that runs",
        "description": "The product's version and each unit's: a unit is what one team releases (the read API, a feeder, the runtime), and its version is the product's version in which it last changed. Anyone signed in may ask. A stack that no deployment wrote a manifest for (a developer's) answers `product: null` and no units. Any valid token may ask, with no scope.",
        "responses": {
          "200": {
            "description": "The release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Release"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ],
        "parameters": []
      }
    },
    "/v1/freshness": {
      "get": {
        "operationId": "readFreshness",
        "summary": "Which series are late",
        "description": "For each series a feeder keeps feeding whose card says its grid and when it publishes: the latest time it has, the time it owes first, when that was due, and whether it is late and why. For anyone who may read the series, and for an operator, who sees the same on Operations (`ext:admin`). A series is late when a time of the last week, or after its latest value, is missing past its due time by more than its card's grace: a hole inside the series as well as at its end. A stated absence (a cancelled auction) counts as present; a withdrawn value is gone; a time its card does not cover, or that its publication calendar does not publish on, is never owed. Why: the last read of the source that covered the time failed or was refused (`source_down`), its push was refused for its data (`rejected`), or it was read without it, or not read (`late`). Filtered by `name`, `namespace`, `feeder`, `market`, `product`, `is_late`, `status`, `last_valid_at`, `next_valid_at` and `due_at`. In the order of the series' names. Read by pages, every page judged at the first page's moment: `limit` says how many a page holds, `cursor` is the `next_cursor` of the page before, and `next_cursor` is null on the last page.",
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          },
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/filter"
          },
          {
            "name": "is_late",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Only those that are late (`true`), or only those that are not (`false`)."
          },
          {
            "$ref": "#/components/parameters/series_limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the watched series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreshnessList"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_filter`: a `filter` that does not read, or names a field this list does not have; `invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_request`: a `limit` that is no whole number from 1, or an `is_late` that is neither `true` nor `false`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/catalogue": {
      "get": {
        "operationId": "getCatalogue",
        "summary": "The data catalogue",
        "description": "The data catalogue, as it was written for this release, byte for byte: every provider the desk and the platform use, its datasets (a dataset is a family of series with one meaning, unit and step, such as ENTSO-E's day-ahead price by zone), how each reaches the platform, and the names its series have here. It follows W3C's DCAT 3, SDMX and the Open Data Contract Standard. A provider whose licence is for internal use says so, as `licence`; the catalogue is read only by those signed in. It changes only with a release of the read API.",
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The catalogue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalogue"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/sources": {
      "get": {
        "operationId": "listSources",
        "summary": "The data sources and their status",
        "description": "Each provider of the data catalogue, in the catalogue's order, with what the catalogue says of it and its status, which the platform works out so that a screen counts nothing. A provider's series are those of its datasets that the platform reads; freshness (`GET /v1/freshness`) says which of them it watches, which are late, and why, all judged at one moment, `checked_at`. The status is the first that holds: `not_on_platform`, the platform reads none of its series; `not_watched`, it reads some and watches none, as none states when it publishes; `source_down`, a late one's last read failed or was refused; `rejected`, a late one's push was refused for its data; `late`, any is late; `on_time`, none is. The providers are the release's, so the list is whole, not paged.",
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceList"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/reference/calendars/{zone}/{market}/{product}": {
      "get": {
        "operationId": "readCalendar",
        "summary": "A market's delivery days and their periods",
        "description": "Each delivery day in [`start`, `end`), from local midnight to the next, with every period in order: its times, its local clock time and the desk's label (`H1` to `H25`, `H3 Q2`). The days of 23 and 25 hours come out as the market trades them. As known at `as_of`: the rules are claims, valid for a range of days and known from a moment, so a day reads as it was known (Oct. 26, 2025 of DE-LU's DA was hourly until the 15-minute MTU was confirmed on Sept. 12, 2025). Reference data: every reader may read it. A read of values fills by its card's grid in the card's zone, which steps as these periods do, and its fill reads the publication calendars of the same rows, as of its cut.",
        "parameters": [
          {
            "name": "zone",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "DE-LU",
            "description": "The bidding zone, as the calendar names it."
          },
          {
            "name": "market",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "DA",
            "description": "The market of the zone, such as `DA` or `IDA3`."
          },
          {
            "name": "product",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "auction",
            "description": "What is traded on the market, such as `auction`."
          },
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The first delivery day, included."
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The last delivery day, excluded. At most 62 days from `start`; more is refused (`invalid_request`)."
          },
          {
            "$ref": "#/components/parameters/as_of"
          }
        ],
        "responses": {
          "200": {
            "description": "The days",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Calendar"
                },
                "example": {
                  "zone": "DE-LU",
                  "market": "DA",
                  "product": "auction",
                  "time_zone": "Europe/Berlin",
                  "days": [
                    {
                      "date": "2024-10-27",
                      "starts_at": "2024-10-26T22:00:00Z",
                      "ends_at": "2024-10-27T23:00:00Z",
                      "mtu": "PT1H",
                      "dst": "long",
                      "periods": [
                        {
                          "starts_at": "2024-10-26T22:00:00Z",
                          "ends_at": "2024-10-26T23:00:00Z",
                          "local_time": "00:00",
                          "label": "H1",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-26T23:00:00Z",
                          "ends_at": "2024-10-27T00:00:00Z",
                          "local_time": "01:00",
                          "label": "H2",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T00:00:00Z",
                          "ends_at": "2024-10-27T01:00:00Z",
                          "local_time": "02:00",
                          "label": "H3",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T01:00:00Z",
                          "ends_at": "2024-10-27T02:00:00Z",
                          "local_time": "02:00",
                          "label": "H4",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T02:00:00Z",
                          "ends_at": "2024-10-27T03:00:00Z",
                          "local_time": "03:00",
                          "label": "H5",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T03:00:00Z",
                          "ends_at": "2024-10-27T04:00:00Z",
                          "local_time": "04:00",
                          "label": "H6",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T04:00:00Z",
                          "ends_at": "2024-10-27T05:00:00Z",
                          "local_time": "05:00",
                          "label": "H7",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T05:00:00Z",
                          "ends_at": "2024-10-27T06:00:00Z",
                          "local_time": "06:00",
                          "label": "H8",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T06:00:00Z",
                          "ends_at": "2024-10-27T07:00:00Z",
                          "local_time": "07:00",
                          "label": "H9",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T07:00:00Z",
                          "ends_at": "2024-10-27T08:00:00Z",
                          "local_time": "08:00",
                          "label": "H10",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T08:00:00Z",
                          "ends_at": "2024-10-27T09:00:00Z",
                          "local_time": "09:00",
                          "label": "H11",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T09:00:00Z",
                          "ends_at": "2024-10-27T10:00:00Z",
                          "local_time": "10:00",
                          "label": "H12",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T10:00:00Z",
                          "ends_at": "2024-10-27T11:00:00Z",
                          "local_time": "11:00",
                          "label": "H13",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T11:00:00Z",
                          "ends_at": "2024-10-27T12:00:00Z",
                          "local_time": "12:00",
                          "label": "H14",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T12:00:00Z",
                          "ends_at": "2024-10-27T13:00:00Z",
                          "local_time": "13:00",
                          "label": "H15",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T13:00:00Z",
                          "ends_at": "2024-10-27T14:00:00Z",
                          "local_time": "14:00",
                          "label": "H16",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T14:00:00Z",
                          "ends_at": "2024-10-27T15:00:00Z",
                          "local_time": "15:00",
                          "label": "H17",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T15:00:00Z",
                          "ends_at": "2024-10-27T16:00:00Z",
                          "local_time": "16:00",
                          "label": "H18",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T16:00:00Z",
                          "ends_at": "2024-10-27T17:00:00Z",
                          "local_time": "17:00",
                          "label": "H19",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T17:00:00Z",
                          "ends_at": "2024-10-27T18:00:00Z",
                          "local_time": "18:00",
                          "label": "H20",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T18:00:00Z",
                          "ends_at": "2024-10-27T19:00:00Z",
                          "local_time": "19:00",
                          "label": "H21",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T19:00:00Z",
                          "ends_at": "2024-10-27T20:00:00Z",
                          "local_time": "20:00",
                          "label": "H22",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T20:00:00Z",
                          "ends_at": "2024-10-27T21:00:00Z",
                          "local_time": "21:00",
                          "label": "H23",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T21:00:00Z",
                          "ends_at": "2024-10-27T22:00:00Z",
                          "local_time": "22:00",
                          "label": "H24",
                          "is_covered": true
                        },
                        {
                          "starts_at": "2024-10-27T22:00:00Z",
                          "ends_at": "2024-10-27T23:00:00Z",
                          "local_time": "23:00",
                          "label": "H25",
                          "is_covered": true
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`unknown_calendar`: no calendar for the zone, market and product; `outside_calendar`: a day no rule of theirs holds; `invalid_time`: a day that is no date, or an `as_of` without its offset; `invalid_request`: a missing `start` or `end`, `start` not before `end`, or more than 62 days",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Whether the process runs (liveness)",
        "description": "Whether the process runs (liveness): always 200 while it does. Whether it can serve is `/ready`.",
        "security": [],
        "responses": {
          "200": {
            "description": "It runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "ok"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/v1/indicators": {
      "get": {
        "operationId": "listIndicators",
        "summary": "Every indicator",
        "description": "Each at its newest version, with every version it computes, its inputs, outputs and their columns, the history it reads before the period, and the parameters a caller may set, each with its type, default and allowed range. A released version never changes: the same call answers the same, with the same parameters and defaults.",
        "responses": {
          "200": {
            "description": "The indicators",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "indicators"
                  ],
                  "properties": {
                    "indicators": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Indicator"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          },
          {
            "runToken": []
          }
        ],
        "parameters": []
      }
    },
    "/v1/indicators/{id}": {
      "get": {
        "operationId": "getIndicator",
        "summary": "One indicator",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "rolling-mean",
            "description": "The indicator."
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1",
            "description": "A version it computes; the newest if absent."
          }
        ],
        "responses": {
          "200": {
            "description": "The indicator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Indicator"
                }
              }
            }
          },
          "400": {
            "description": "No such indicator (`unknown_function`), or no such version (`unknown_version`, with `versions` in its details)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "description": "Its newest version, or the one `version` names.",
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          },
          {
            "runToken": []
          }
        ]
      }
    },
    "/v1/indicators/{id}/compute": {
      "post": {
        "operationId": "computeIndicator",
        "summary": "Compute an indicator, at once",
        "description": "On series the caller may read, as known at `as_of` (now if absent), over [start, end), in the series' own steps or in `step` (the mean of each step). At the version the call names, or the newest: name it, and the same call answers the same for as long as 3.x lasts. A call outside the declared parameters is refused before anything is read. The answer says which version computed, the parameters with their defaults filled in, what was read, each input's step and the gaps found in it, and each output with its unit and columns. It is returned, never stored or announced. A field of the wrong type (a `step` or a time sent as a number) is refused with `invalid_request`, never passed over.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "rolling-mean",
            "description": "The indicator."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Compute"
              },
              "example": {
                "version": "2",
                "inputs": {
                  "series": "ec.price"
                },
                "start": "2026-11-12T23:00:00Z",
                "end": "2026-11-13T23:00:00Z",
                "step": "PT1H",
                "as_of": "2026-11-12T12:00:00Z",
                "parameters": {
                  "window": 24
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Computed"
                }
              }
            }
          },
          "400": {
            "description": "A bad call: `unknown_function`, `unknown_version`, `invalid_parameter`, `invalid_request`, `invalid_time`, `invalid_duration` for a `step` that is no ISO 8601 duration, `invalid_input` for an input that is not a series of numbers, inputs in different units, or values a version cannot take, or `unknown_series` for a series that does not exist or that the caller may not read",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`, or another's simulation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "More rows than one read holds",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store cannot be reached",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          },
          {
            "runToken": []
          }
        ]
      }
    },
    "/ready": {
      "get": {
        "operationId": "getReadiness",
        "summary": "Whether it can serve: the database answers within 2 seconds (readiness)",
        "description": "Whether it can serve (readiness): 200 while the database answers within 2 seconds, and `store_unavailable`, 503, while it does not. Docker reads it, and what waits for the service waits for this.",
        "security": [],
        "responses": {
          "200": {
            "description": "Ready",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "ok"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The database does not answer (`store_unavailable`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/v1/me/charts": {
      "get": {
        "operationId": "listCharts",
        "summary": "The caller's charts",
        "description": "Each chart the caller keeps for a screen, in its order: a name, a position and the screen's spec of it (series, indicators, drawing, period). Kept for the person signed in, by subject; no one else reads them.",
        "responses": {
          "200": {
            "description": "The charts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Charts"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/v1/me/charts/{id}": {
      "put": {
        "operationId": "putChart",
        "summary": "Keep a chart",
        "description": "Adds the chart, or replaces the caller's chart of this id. At most 32 charts; a spec of 64 KiB at most. The API keeps the spec whole and reads nothing in it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
            },
            "example": "0b4a2c3e-5d6f-4a1b-8c9d-0e1f2a3b4c5d",
            "description": "The chart: 1 to 40 lowercase letters, digits and dashes; a screen makes a UUID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChartIn"
              },
              "example": {
                "name": "Power DE",
                "position": 0,
                "spec": {
                  "version": 1,
                  "series": [
                    "entsoe.de_lu_price",
                    "entsoe.de_lu_load_forecast"
                  ],
                  "period": {
                    "days": 7
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The chart, as kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chart"
                }
              }
            }
          },
          "400": {
            "description": "A bad chart: `invalid_chart` (with the `field`), or `too_many_charts`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "A spec over 64 KiB",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "deleteChart",
        "summary": "Remove a chart",
        "description": "Removes one of the caller's charts, by its id. The others keep their positions. A chart that is not there is `not_found`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
            },
            "example": "0b4a2c3e-5d6f-4a1b-8c9d-0e1f2a3b4c5d",
            "description": "The chart: 1 to 40 lowercase letters, digits and dashes; a screen makes a UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "removed"
                  ],
                  "properties": {
                    "removed": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_chart`: not an id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: no such chart of the caller's",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "streamEvents",
        "summary": "What changes, as it changes",
        "description": "A stream of server-sent events (text/event-stream): which series the caller may read have new values, a second's announcements at a time, one change a series. The read API follows the bus for its callers; people never join it.\n\nEach event's `data:` is a CloudEvent 1.0, whole, as JSON (`StreamEvent`); its `event:` is the last part of the CloudEvent's `type`, and what it says is in the CloudEvent's `data`. `contracts/events.schema.json` holds each type's schema.\n\n- `ready` (`bff.stream.ready`), first, and again when the bus is followed again after `paused`: `{\"is_following\": true}` while the bus is followed.\n- `changed` (`bff.stream.changed`): `{\"series\": [Change]}`.\n- `paused` (`bff.stream.paused`): the bus is not followed for now; changes are not told until the next `ready`.\n- `missed` (`bff.stream.missed`): `{\"since\": time or null}`. Changes were not told: read again what is shown. `since` is when the last announcement the caller was told was published; null when the read API cannot say.\n- `expired` (`bff.stream.expired`), last: the token the stream was opened with has expired; open it again with a new one.\n\n**Resuming.** An event's `id:` is a place on the bus: everything announced before it that the caller may see has been told. A client keeps the last `id:` it saw and, when it opens the stream again, sends it as `Last-Event-ID`: it is then told what was announced after that place, once, by whichever copy of the read API answers. The read API keeps the changes of the last five minutes for this; a client further behind, or one that sends an id that is no place, is told `missed` instead. A stream opened without `Last-Event-ID` begins now: its `ready` carries the place. A client treats an id as opaque text.\n\nA comment every 15 seconds keeps a quiet stream open; it carries an `id:` when the place has moved with nothing to tell the caller. A client ignores an event whose name it does not know. A person may hold 8 streams open at once, and the read API 2,000 in all, counted across every copy of the read API: a stream closed on one copy frees its place on every other.",
        "parameters": [
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The last `id:` the client saw on this stream. The stream goes on from that place: what was announced after it is told first. Without it the stream begins now.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "example": "1795089601480-15.8.0.0.3.0.0.0.0.0.0.2"
          }
        ],
        "responses": {
          "200": {
            "description": "The stream, until the token expires",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: ready\nid: 1795089600123-15.7.0.0.3.0.0.0.0.0.0.2\ndata: {\"specversion\":\"1.0\",\"id\":\"5d1f0a52-6f0e-4d0c-9a51-0f2a8f5a7c11\",\"source\":\"api/3.0\",\"type\":\"bff.stream.ready\",\"time\":\"2026-11-15T12:00:00.250000+00:00\",\"datacontenttype\":\"application/json\",\"dataschema\":\"https://bff.invalid/contracts/events.schema.json#/$defs/bff.stream.ready\",\"schemaversion\":\"1.0.0\",\"data\":{\"is_following\":true}}\n\nevent: changed\nid: 1795089601480-15.8.0.0.3.0.0.0.0.0.0.2\ndata: {\"specversion\":\"1.0\",\"id\":\"a3c1b6de-1b0c-4a55-8a0e-52b7c6b0d9e4\",\"source\":\"api/3.0\",\"type\":\"bff.stream.changed\",\"time\":\"2026-11-15T12:00:02.000000+00:00\",\"datacontenttype\":\"application/json\",\"dataschema\":\"https://bff.invalid/contracts/events.schema.json#/$defs/bff.stream.changed\",\"schemaversion\":\"1.0.0\",\"data\":{\"series\":[{\"name\":\"entsoe.de_lu_price\",\"from\":\"2026-11-15T23:00:00+00:00\",\"to\":\"2026-11-16T22:45:00+00:00\",\"known_at\":\"2026-11-15T12:00:00+00:00\"}]}}\n\n"
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: the caller holds as many streams as one person may, or the read API holds as many as it may in all, on whichever of its copies they are open. `details.limit` is the limit that was met, and `details.of` whose: `person` (close a stream) or `all` (try again later).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`events_unavailable`: this read API follows no bus",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}": {
      "put": {
        "operationId": "putFunction",
        "summary": "Make a function, or better its words",
        "description": "Make a function of the caller's own, its kind said once, or better its words. Makes the caller's entry, so variables can be set before the first upload, or changes its title, description and README. A name is the owner's once, across kinds.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          }
        ],
        "responses": {
          "200": {
            "description": "The function",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entry"
                }
              }
            }
          },
          "400": {
            "description": "A bad name or field: `invalid_name`, `invalid_request`; the name is another kind's or person's: `name_taken`; `too_many_functions`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "indicator",
                      "model"
                    ],
                    "description": "What it is, said once, when it is made: a new function without it is refused (`invalid_request`), and one of another kind than its own (`name_taken`). Absent, the function's own"
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "readme": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "example": {
                "kind": "model",
                "title": "Last week's price, with a band"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getFunction",
        "summary": "A person's function",
        "description": "At its newest released version, or the one `?version=` names; its owner may name one that is ready. One the caller may not call is answered as one that does not exist.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The function",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Function"
                }
              }
            }
          },
          "400": {
            "description": "`unknown_function`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`version_suspended`, with its reason; no `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer (`store_unavailable`). These routes read the store alone, and need no runner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "deleteFunction",
        "summary": "Delete one of your functions",
        "description": "Every version stops answering, and the function leaves every list and your limit of functions. Its runs and the audit are kept for their days. Its name is free again: a function made again under it numbers its versions on from the deleted one's, so a version a chart saved never names other code.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted, with how many of its versions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "object",
                      "required": [
                        "kind",
                        "name",
                        "versions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "model",
                            "indicator"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "versions": {
                          "type": "integer",
                          "format": "int64"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad name or field: `invalid_name`, `invalid_request`; the name is another kind's or person's: `name_taken`; `too_many_functions`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/versions": {
      "get": {
        "operationId": "listFunctionVersions",
        "summary": "The function's versions",
        "description": "Every version but deleted drafts, with its state.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          }
        ],
        "responses": {
          "200": {
            "description": "The versions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "versions"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "versions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Version"
                      }
                    },
                    "limit": {
                      "type": "integer",
                      "format": "int32",
                      "example": 50
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "uploadFunctionVersion",
        "summary": "Upload a version",
        "description": "A Python file (`text/x-python`), kept as `main.py`, or a zip of a folder (`application/zip`), at most 50 MiB, 1,000 files and 200 MiB unpacked. Makes the entry if it is new. The version is `checking` until the checks say otherwise.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "runtime",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "python-1",
            "description": "The runtime; the newest in use if absent"
          },
          {
            "name": "release",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "on-pass"
              ]
            },
            "description": "Release the version when its checks pass"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "indicator",
                "model"
              ]
            },
            "description": "A new function's kind, which its first upload says, as its path did before 3.2.18: a new function without it is refused (`invalid_request`). Absent, the function's own; another than its own is refused (`name_taken`)",
            "example": "model"
          }
        ],
        "responses": {
          "202": {
            "description": "The new version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "version"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad upload: `invalid_upload`, `invalid_name`, `unknown_runtime`, `name_taken`, `too_many_functions`, `too_many_versions`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "Over 50 MiB, or over 200 MiB unpacked: `payload_too_large`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "text/x-python": {
              "schema": {
                "type": "string"
              }
            },
            "application/zip": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/versions/{version}": {
      "get": {
        "operationId": "getFunctionVersion",
        "summary": "A version",
        "description": "One version, with its manifest and the checks' report.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "A version's number",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "version"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "deleteFunctionVersion",
        "summary": "Delete a draft, or a deprecated version",
        "description": "A version waiting, failed or ready; or one that is deprecated. A released version is deprecated first, so that its callers are pointed to the newest before it goes. The version's code, its declaration and its report are removed; its runs are kept. Its number is not given again, and a call that names it is answered `unknown_version`.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "A version's number",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The version, deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "version"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Neither a draft nor deprecated: `invalid_status_change`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/versions/{version}/upload": {
      "get": {
        "operationId": "getFunctionVersionUpload",
        "summary": "A version's code",
        "description": "The files a version was uploaded with, as a zip, for its owner alone: to edit what is deployed and push the next version. Each reading is recorded.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "A version's number",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The version's files, zipped, each at its path in the upload",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/versions/{version}/release": {
      "post": {
        "operationId": "releaseFunctionVersion",
        "summary": "Release a version",
        "description": "A version that is ready becomes released: fixed for good, callable by those the access list names.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "A version's number",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "version"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Not allowed from its state: `invalid_status_change`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/versions/{version}/deprecate": {
      "post": {
        "operationId": "deprecateFunctionVersion",
        "summary": "Deprecate a version",
        "description": "A released version still answers, and points to the newest.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "A version's number",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "version"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Not allowed from its state: `invalid_status_change`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/access": {
      "get": {
        "operationId": "getFunctionAccess",
        "summary": "Who may call it",
        "description": "The function's grants; the owner always may.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          }
        ],
        "responses": {
          "200": {
            "description": "The grants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "grants"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^(user:[a-z][a-z0-9_]{0,31}|role:(trader|analyst)|everyone)$"
                      },
                      "example": [
                        "user:tess",
                        "role:analyst"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "operationId": "putFunctionAccess",
        "summary": "Say who may call it",
        "description": "Replaces the grants, whole: `user:{username}`, `role:trader`, `role:analyst` or `everyone`, at most 100. Every change is recorded.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          }
        ],
        "responses": {
          "200": {
            "description": "The grants, as kept",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "grants"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^(user:[a-z][a-z0-9_]{0,31}|role:(trader|analyst)|everyone)$"
                      },
                      "example": [
                        "user:tess",
                        "role:analyst"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad grant: `invalid_grant`, `too_many_grants`; or `not_found`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "grants"
                ],
                "properties": {
                  "grants": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^(user:[a-z][a-z0-9_]{0,31}|role:(trader|analyst)|everyone)$"
                    },
                    "example": [
                      "user:tess",
                      "role:analyst"
                    ]
                  }
                }
              },
              "example": {
                "grants": [
                  "user:tess"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/env": {
      "get": {
        "operationId": "listFunctionVariables",
        "summary": "The function's variables",
        "description": "Their names and when each was set; never their values.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          }
        ],
        "responses": {
          "200": {
            "description": "The variables",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "env"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "env": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "set_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "limit": {
                      "type": "integer",
                      "format": "int32",
                      "example": 20
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/env/{variable}": {
      "put": {
        "operationId": "putFunctionVariable",
        "summary": "Set a variable",
        "description": "Sealed with AES-256-GCM, and given to the function's process when it starts. At most 20, 4 KiB each; never the platform's own names. A version waiting for variables checks again.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "variable",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
            },
            "description": "An environment variable's name",
            "example": "ANTHROPIC_API_KEY"
          }
        ],
        "responses": {
          "200": {
            "description": "Set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "is_set": {
                      "type": "boolean",
                      "description": "Whether the variable is set: true, once it is (3.2.18: `set` before)"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_env`, `too_many_variables`, `not_found`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "A value over 4 KiB",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "value"
                ],
                "properties": {
                  "value": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "value": "…"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteFunctionVariable",
        "summary": "Remove a variable",
        "description": "Unless a released version declares it.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "variable",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
            },
            "description": "An environment variable's name",
            "example": "ANTHROPIC_API_KEY"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "A released version declares it: `conflict`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions/{owner}/{name}/runs": {
      "get": {
        "operationId": "listFunctionRuns",
        "summary": "The function's runs",
        "description": "The newest first: the owner's own calls and the checks in full; others' calls as when, version, duration and outcome alone, never who. Runs that started at one instant are in the order of their ids. A run is kept for 30 days. Read by pages: `limit` says how many a page holds, `cursor` is the `next_cursor` of the page before, and `next_cursor` is null on the last page.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "runs",
                    "next_cursor"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Run"
                      }
                    },
                    "next_cursor": {
                      "$ref": "#/components/schemas/NextCursor"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not one of the caller's functions, versions or variables: `not_found`, `unknown_version`; `invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/runs/{id}/log": {
      "get": {
        "operationId": "getRunLog",
        "summary": "A run's log",
        "description": "The log of one of the owner's own calls, or of a check: at most 64 KiB.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A run's id",
            "example": "0b4a2c3e-5d6f-4a1b-8c9d-0e1f2a3b4c5d"
          }
        ],
        "responses": {
          "200": {
            "description": "The log",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "log"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "log": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not a run of the caller's: `not_found`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/runs/{id}": {
      "get": {
        "operationId": "getRun",
        "summary": "One run of a person's function",
        "description": "Its function, and its record as the function's runs list it: to the function's owner, every run of it, another caller's call by its facts alone (never who called, nor what it read); to a caller, a run of its own call, whole. To anyone else, none: `not_found`, the same answer as no run (3.2.18).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A run's id",
            "example": "0b4a2c3e-5d6f-4a1b-8c9d-0e1f2a3b4c5d"
          }
        ],
        "responses": {
          "200": {
            "description": "The run",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "run"
                  ],
                  "description": "A run, and the function it ran",
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "run": {
                      "$ref": "#/components/schemas/Run"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not a run of the caller's: `not_found`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ]
      }
    },
    "/v1/libraries": {
      "get": {
        "operationId": "listOwnLibraryRequests",
        "summary": "The caller's library requests",
        "description": "And their answers, the newest first. Read by pages: `limit` says how many a page holds, `cursor` is the `next_cursor` of the page before, and `next_cursor` is null on the last page.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requests": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LibraryRequest"
                      }
                    },
                    "next_cursor": {
                      "$ref": "#/components/schemas/NextCursor"
                    }
                  },
                  "required": [
                    "requests",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ]
      },
      "post": {
        "operationId": "createLibraryRequest",
        "summary": "Ask for a library",
        "description": "One the runtime lacks; an operator answers it.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:deploy"
            ]
          }
        ],
        "responses": {
          "201": {
            "description": "The request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryRequest"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `not_found`, `too_many_requests`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:deploy`, or another person's path: `access_denied`; a user name that cannot own functions: `invalid_username`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "library",
                  "why"
                ],
                "properties": {
                  "library": {
                    "type": "string"
                  },
                  "why": {
                    "type": "string"
                  },
                  "function": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "library": "lightgbm",
                "why": "Gradient boosting for the hourly model.",
                "function": "weekly_naive"
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/v1/runtimes": {
      "get": {
        "operationId": "listRuntimes",
        "summary": "The runtimes",
        "description": "Each runtime in use, and its libraries and their versions.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The runtimes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "runtimes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Runtime"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/v1/admin/functions": {
      "get": {
        "operationId": "listAllFunctions",
        "summary": "Every person's functions",
        "description": "With their versions' states, and each one's calls of the last 24 hours: how many, how many failed, and the latest failure. In the order of the owner's user name, then the function's name. The workers and the last backup are on every page. Read by pages: `limit` says how many a page holds, `cursor` is the `next_cursor` of the page before, and `next_cursor` is null on the last page.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The functions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "functions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entry"
                      }
                    },
                    "workers": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The workers people's functions run on, by pool, as the runner counts them; null when the runner does not answer.",
                      "properties": {
                        "call": {
                          "type": "object",
                          "properties": {
                            "joined": {
                              "type": "integer",
                              "format": "int64",
                              "description": "The workers that have joined the runner."
                            },
                            "meant": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "format": "int64",
                              "description": "How many the pool is meant to have; null where no number is set."
                            },
                            "short_for_seconds": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "format": "int64",
                              "description": "For how long the pool has had fewer than it is meant to, once that is longer than a worker's restart takes (a minute); null otherwise."
                            }
                          }
                        },
                        "check": {
                          "type": "object",
                          "properties": {
                            "joined": {
                              "type": "integer",
                              "format": "int64",
                              "description": "The workers that have joined the runner."
                            },
                            "meant": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "format": "int64",
                              "description": "How many the pool is meant to have; null where no number is set."
                            },
                            "short_for_seconds": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "format": "int64",
                              "description": "For how long the pool has had fewer than it is meant to, once that is longer than a worker's restart takes (a minute); null otherwise."
                            }
                          }
                        }
                      }
                    },
                    "backup": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The last backup of the platform's data, as the server's backup recorded it; null where this read API is told of no backups (a developer's stack).",
                      "properties": {
                        "ok": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Whether it went well; null when none has run."
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When it ended."
                        },
                        "place": {
                          "type": "string",
                          "description": "Where the backups are kept, in words: the server's own disk, a bucket."
                        },
                        "message": {
                          "type": "string",
                          "description": "What happened, in a sentence."
                        },
                        "snapshot": {
                          "type": "string",
                          "description": "The backup's id in the repository."
                        },
                        "values": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "format": "int64",
                          "description": "How many values the store held."
                        },
                        "age_hours": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "format": "int64",
                          "description": "How old it is now, in hours."
                        }
                      }
                    },
                    "next_cursor": {
                      "$ref": "#/components/schemas/NextCursor"
                    }
                  },
                  "required": [
                    "functions",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ]
      }
    },
    "/v1/admin/hosts": {
      "get": {
        "operationId": "listHosts",
        "summary": "The outside hosts asked for",
        "description": "In the order of their names; each says its state, and a reader that wants those waiting first sorts them. Read by pages: `limit` says how many a page holds, `cursor` is the `next_cursor` of the page before, and `next_cursor` is null on the last page.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The hosts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hosts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/HostRequest"
                      }
                    },
                    "next_cursor": {
                      "$ref": "#/components/schemas/NextCursor"
                    }
                  },
                  "required": [
                    "hosts",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ]
      }
    },
    "/v1/admin/hosts/{host}": {
      "post": {
        "operationId": "decideHost",
        "summary": "Decide a host",
        "description": "Approve, decline or withdraw. Approval lets the versions waiting for it check again; withdrawal suspends every version that declares it.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The host",
            "example": "api.anthropic.com"
          }
        ],
        "responses": {
          "200": {
            "description": "The host",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "versions": {
                      "type": "integer",
                      "format": "int64"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `not_found`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Not from its state: `invalid_status_change`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "decision"
                ],
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "decline",
                      "withdraw"
                    ]
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/libraries": {
      "get": {
        "operationId": "listAllLibraryRequests",
        "summary": "Every library request",
        "description": "In the order they were made, the oldest first; each says its state, and a reader that wants the open ones first sorts them. Read by pages: `limit` says how many a page holds, `cursor` is the `next_cursor` of the page before, and `next_cursor` is null on the last page.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requests": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LibraryRequest"
                      }
                    },
                    "next_cursor": {
                      "$ref": "#/components/schemas/NextCursor"
                    }
                  },
                  "required": [
                    "requests",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ]
      }
    },
    "/v1/admin/libraries/{id}": {
      "post": {
        "operationId": "answerLibraryRequest",
        "summary": "Answer a library request",
        "description": "Accept, decline, or say in which runtime it is available.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The request's id",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `not_found`, `unknown_runtime`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Not from its state: `invalid_status_change`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "decision"
                ],
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "accept",
                      "decline",
                      "available"
                    ]
                  },
                  "note": {
                    "type": "string"
                  },
                  "runtime": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/functions/{owner}/{name}/versions/{version}/suspend": {
      "post": {
        "operationId": "suspendFunctionVersion",
        "summary": "Suspend a version",
        "description": "It stops answering, with the reason its owner and callers read.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "A version's number",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "version"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `unknown_function`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Not from its state: `invalid_status_change`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "reason": "It sends data to a host it does not declare."
              }
            }
          }
        }
      }
    },
    "/v1/admin/functions/{owner}/{name}/versions/{version}/lift": {
      "post": {
        "operationId": "liftFunctionVersionSuspension",
        "summary": "Lift a suspension",
        "description": "It returns to the state it left.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name: one series segment",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "A version's number",
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "The version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "function",
                    "version"
                  ],
                  "properties": {
                    "function": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `unknown_function`, `unknown_version`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Not from its state: `invalid_status_change`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/admin/runtimes/{name}/withdraw": {
      "post": {
        "operationId": "withdrawRuntime",
        "summary": "Withdraw a runtime",
        "description": "At once, or from a date (`at`). At once, its drafts fail and its versions that answer are suspended.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The runtime",
            "example": "python-1"
          }
        ],
        "responses": {
          "200": {
            "description": "The runtime",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "runtime": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "suspended": {
                      "type": "integer",
                      "format": "int64"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `invalid_time`, `unknown_runtime`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string"
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/runs/{id}/log": {
      "get": {
        "operationId": "getAnyRunLog",
        "summary": "Any run's log",
        "description": "For support; each reading is recorded.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A run's id",
            "example": "0b4a2c3e-5d6f-4a1b-8c9d-0e1f2a3b4c5d"
          }
        ],
        "responses": {
          "200": {
            "description": "The run and its log",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "log",
                    "run"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "log": {
                      "type": "string"
                    },
                    "run": {
                      "type": "object",
                      "description": "The run itself: a run refused before a worker took it wrote no log, and this is then all there is.",
                      "required": [
                        "version",
                        "purpose",
                        "started_at"
                      ],
                      "properties": {
                        "version": {
                          "type": "string"
                        },
                        "purpose": {
                          "type": "string",
                          "enum": [
                            "call",
                            "check",
                            "retest"
                          ]
                        },
                        "started_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "took_ms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "format": "int32"
                        },
                        "cold": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "outcome": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "ok",
                            "failed",
                            null
                          ]
                        },
                        "error_code": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`not_found`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: the caller has no function of that name, or it has no such version, variable or run",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/functions": {
      "get": {
        "operationId": "listFunctions",
        "summary": "People's functions: those the caller may call, or the caller's own",
        "description": "One list for the three before 3.2.18 (`/v1/ext/models`, `/v1/ext/indicators`, `/v1/ext/me/functions`). `filter` takes `kind`, `owner`, `state` and `lineage`, as in `kind = \"model\" AND owner = \"tara\"`. The functions the caller may call, both kinds, each at its newest released version (`Function`), in the order of their owners and names, by pages. With `owner = \"me\"`, the caller's own functions instead, drafts among them, each with its versions' states (`Entry`), as one's own list answered them: at most 20, the one page (it needs `ext:deploy`). No function names a lineage yet. A person's list: a client is refused (`access_denied`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/filter"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of functions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "functions": {
                      "type": "array",
                      "description": "The functions: each a `Function` the caller may call, or, with `owner = \"me\"`, an `Entry` of the caller's own",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/Function"
                          },
                          {
                            "$ref": "#/components/schemas/Entry"
                          }
                        ]
                      }
                    },
                    "next_cursor": {
                      "$ref": "#/components/schemas/NextCursor"
                    }
                  },
                  "required": [
                    "functions",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_filter`: a `filter` that does not read, or names a field this list does not have; `invalid_cursor`: a `cursor` that this list did not give for this request; `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `data:read`, or a client: `access_denied`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer (`store_unavailable`). These routes read the store alone, and need no runner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ]
      }
    },
    "/v1/functions/{owner}/{name}/versions/{version}/compute": {
      "post": {
        "operationId": "computeFunction",
        "summary": "Call a person's function",
        "description": "A call of a person's function, at the version its path names: so the same call answers the same (3.2.18; before, the body named the version, or took the newest). A body that names a version is refused (`invalid_request`). The function runs in a sandboxed worker, reading the caller's data as known at `as_of` (now if absent), and its answer is checked against its manifest. An `as_of` later than now is taken as now: a function cannot read what is not yet known.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$"
            },
            "description": "The owner's user name: one segment of at most 32 characters; another is refused (`invalid_username`)",
            "example": "tara"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "description": "The function's name",
            "example": "weekly_naive"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A version of the function, as its list of versions names it. A released version never changes",
            "example": "1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "start",
                  "end"
                ],
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "end": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "as_of": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "parameters": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "start": "2017-06-01T22:00:00Z",
                "end": "2017-06-02T22:00:00Z",
                "as_of": "2017-06-01T08:00:00Z",
                "parameters": {
                  "days": 56
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answered"
                }
              }
            }
          },
          "400": {
            "description": "`unknown_function`, `unknown_version`, `invalid_parameter`, `unknown_series`, `invalid_request`, `invalid_time`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`version_suspended`; no `data:read`; `access_denied` for a token that is no person's: people call people's functions, a client may not.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store or the runner did not answer: `runner_unavailable`, `runner_busy`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: over the calls a minute an operator has set (`PF_EXT_RATE_LIMIT`), counted across every copy of the read API. None is set unless an operator sets one: what bounds a flood is the workers, which answer `runner_busy`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "The function failed: `model_failed`, or its answer broke its manifest: `invalid_answer` (`ModelError`, with the run's id)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "Over its time: `model_timeout`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/me/programs": {
      "get": {
        "operationId": "listPrograms",
        "summary": "Your programs",
        "description": "The programs you keep, and how many you may. A person keeps a few, by that limit: the list is whole, not paged.",
        "tags": [
          "Programs"
        ],
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Your programs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Programs"
                }
              }
            }
          },
          "401": {
            "description": "No token, or one that is not valid: `unauthenticated`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope` without `data:read`; `access_denied` for a client or a program, which keep no programs; `invalid_username` for a user name that cannot own one",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`programs_unavailable`: the registry that keeps programs does not answer; `provider_failed`: the identity provider does not; `store_unavailable`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "operationId": "createProgram",
        "summary": "Make a program",
        "description": "Makes a client `program.{you}.{name}` in the identity provider, with the public half of the key you send. The program then signs in by the client credentials grant with a signed assertion (`private_key_jwt`), and reads and calls as you do. Whose program it is comes from your token, never from the body.",
        "tags": [
          "Programs"
        ],
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "public_key"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "public_key": {
                    "$ref": "#/components/schemas/PublicKey"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The program",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Program"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_program`: a name that is none; `invalid_key`: not the public half of an RSA key of 2,048 bits or more, with an id; `too_many_programs`: over the limit; `invalid_request`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`program_exists`: you have a program of that name",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No token, or one that is not valid: `unauthenticated`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope` without `data:read`; `access_denied` for a client or a program, which keep no programs; `invalid_username` for a user name that cannot own one",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`programs_unavailable`: the registry that keeps programs does not answer; `provider_failed`: the identity provider does not; `store_unavailable`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/v1/me/programs/{name}": {
      "delete": {
        "operationId": "deleteProgram",
        "summary": "Remove a program",
        "description": "Its client is deleted, and it signs in no more. The name is free again.",
        "tags": [
          "Programs"
        ],
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "removed"
                  ],
                  "properties": {
                    "removed": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "client_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_program`: a name that is none",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_program`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No token, or one that is not valid: `unauthenticated`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope` without `data:read`; `access_denied` for a client or a program, which keep no programs; `invalid_username` for a user name that cannot own one",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`programs_unavailable`: the registry that keeps programs does not answer; `provider_failed`: the identity provider does not; `store_unavailable`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/me/programs/{name}/key": {
      "post": {
        "operationId": "renewProgramKey",
        "summary": "Renew a program's key",
        "description": "The new key replaces the old, which signs in no more.",
        "tags": [
          "Programs"
        ],
        "security": [
          {
            "oauth2": [
              "data:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "public_key"
                ],
                "properties": {
                  "public_key": {
                    "$ref": "#/components/schemas/PublicKey"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The program",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Program"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_key`, `invalid_program`, `invalid_request`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_program`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No token, or one that is not valid: `unauthenticated`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope` without `data:read`; `access_denied` for a client or a program, which keep no programs; `invalid_username` for a user name that cannot own one",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`programs_unavailable`: the registry that keeps programs does not answer; `provider_failed`: the identity provider does not; `store_unavailable`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/admin/programs": {
      "get": {
        "operationId": "listAllPrograms",
        "summary": "Every person's programs",
        "description": "With their owners, for an operator. In the order of their ids (`program.{owner}.{name}`). Read by pages: `limit` says how many a page holds, `cursor` is the `next_cursor` of the page before, and `next_cursor` is null on the last page.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The programs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllPrograms"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: a `cursor` that this list did not give for this request (another list's, the same list's asked with other parameters, one of another release, or none at all); `invalid_request`: a `limit` that is no whole number from 1",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ]
      }
    },
    "/v1/admin/programs/{id}/suspension": {
      "post": {
        "operationId": "setProgramSuspension",
        "summary": "Suspend a program, or lift its suspension",
        "description": "Suspended, its client is disabled and the read API refuses it at its next call, whatever its token says. A suspension gives its reason, which its owner reads.",
        "tags": [
          "People's functions"
        ],
        "security": [
          {
            "oauth2": [
              "ext:admin"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The program's client id: `program.{owner}.{name}`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "is_suspended"
                ],
                "properties": {
                  "is_suspended": {
                    "type": "boolean",
                    "description": "Whether the program is to be suspended: true suspends it, with its reason; false lifts its suspension (3.2.18: `suspended` before)"
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The program",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Program"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`; `invalid_parameter`: a suspension without its reason",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_program`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No `ext:admin`: `insufficient_scope`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "No valid token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The store did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "Tokens from the platform's Keycloak, with the audience `bff-api`: a person signs in through a screen's client (Blue Valley's: the authorization code with PKCE), or, from a program or the SDK's command line, through the device flow (the public client `bff-sdk`, with PKCE): the token carries the scopes of the person's roles, so a trader's reads data and an author's also deploys.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "http://localhost:8180/realms/bff/protocol/openid-connect/auth",
            "tokenUrl": "http://localhost:8180/realms/bff/protocol/openid-connect/token",
            "scopes": {
              "data:read": "Read the platform's series",
              "ext:deploy": "Deploy and manage functions of one's own (the realm role author)",
              "ext:admin": "Look after people's functions (the realm role operator)"
            }
          }
        }
      },
      "runToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "A run token, `run.` and 64 characters of hexadecimal (32 random bytes): what a person's function reads with while one call runs, with its caller's rights and the call's cut-off. Taken on the read API's run listener (`PF_API_RUN_ADDR`, on the workers' network) alone, and on these five routes alone; the public listener refuses it."
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "class",
          "details"
        ],
        "description": "An error, as RFC 9457 writes it (`application/problem+json`), with the platform's three members: `code` for programs, `class` for who is at fault, `details` for debugging. `detail` is for people, and may be reworded.",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference",
            "description": "`/problems/` and the code with dashes for its underscores: the page that explains the code.",
            "examples": [
              "/problems/unknown-series"
            ]
          },
          "title": {
            "type": "string",
            "description": "The code in words. The same for every occurrence of the code.",
            "examples": [
              "Unknown series"
            ]
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "The HTTP status the problem is answered with.",
            "examples": [
              400
            ]
          },
          "detail": {
            "type": "string",
            "description": "What went wrong this time, for a person.",
            "examples": [
              "Unknown series ['wind']."
            ]
          },
          "instance": {
            "type": "string",
            "format": "uri-reference",
            "description": "The occurrence: the path of the request that was refused, without its query.",
            "examples": [
              "/v1/values"
            ]
          },
          "code": {
            "type": "string",
            "description": "The stable code a program tests. An open list: a client treats a code it does not know by its `status`.",
            "examples": [
              "unknown_series"
            ]
          },
          "class": {
            "type": "string",
            "description": "Who is at fault, which decides the status: `InvalidRequest`, `AccessDenied`, `DataContractError`, `SourceError`, `InternalError`, `RemoteError`, `ServiceError`, `ModelError`. An open list.",
            "examples": [
              "InvalidRequest"
            ]
          },
          "details": {
            "type": "object",
            "description": "Facts for a debugger, by name. They differ by code.",
            "additionalProperties": true
          }
        }
      },
      "Source": {
        "type": "object",
        "required": [
          "kind"
        ],
        "description": "Where a series comes from, as the built contract's `Source`.",
        "properties": {
          "kind": {
            "type": "string",
            "x-extensible-enum": [
              "feeder",
              "forecast",
              "person"
            ],
            "description": "A feeder's series, a forecast's copy, or a person's own."
          },
          "id": {
            "type": "string",
            "description": "The feeder, such as feeder.entsoe."
          },
          "description": {
            "type": "string",
            "description": "The feeder's description."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "x-extensible-enum": [
              "active",
              "suspended",
              "retired"
            ],
            "description": "The feeder's status in its registry; null for a series that is no feeder's."
          },
          "model": {
            "type": "string",
            "description": "The model a forecast's copy is of."
          },
          "version": {
            "type": "string",
            "description": "The version of that model."
          },
          "target": {
            "type": "string",
            "description": "What a copy forecasts, such as entsoe.de_lu_price."
          },
          "owner": {
            "type": "string",
            "description": "The person whose series it is, by user name."
          }
        }
      },
      "Values": {
        "type": "object",
        "description": "One series' values, column by column, in valid-time order. Every column has one entry a row. `view=basic` gives `kind`, `unit`, `valid_at`, `value`, `status` and `known_at`; `view=full`, every column.",
        "required": [
          "kind",
          "unit",
          "valid_at",
          "known_at",
          "value",
          "status"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "x-extensible-enum": [
              "number",
              "text",
              "array"
            ],
            "description": "The kind of the series' values."
          },
          "unit": {
            "type": "string",
            "description": "The unit of the series' values."
          },
          "valid_at": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Where each period starts."
          },
          "valid_until": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "description": "The period's end, where it is not `valid_at` plus the grid's step."
          },
          "known_at": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "description": "When each became known; null for a step no version speaks of."
          },
          "recorded_at": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "description": "When the platform stored each; null for a step no version speaks of."
          },
          "published_at": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "description": "When the source says it published each, or a quote's as-of time."
          },
          "known_by": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ],
              "x-extensible-enum": [
                "stated",
                "due",
                "first_seen",
                "first_seen_late",
                "revision",
                "computed"
              ]
            },
            "description": "How each `known_at` was set: stated by the source, its due time, when the feeder first saw it (late, where after its due time), a revision's own time, or computed from the inputs' times."
          },
          "value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Value"
            },
            "description": "The values; null where a step has none, its status saying why."
          },
          "status": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Status"
            },
            "description": "Each value's status, or the reason it is missing."
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "x-extensible-enum": [
                  "held",
                  "carried",
                  "derived",
                  "interpolated",
                  "estimated",
                  "outlier"
                ]
              }
            },
            "description": "What may be said of each value's quality, apart from its status; an empty list where nothing is."
          },
          "flag_reason": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Why each value's flags are set; null where none is."
          },
          "run_id": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "The model run or the computation that made each; null for a fetched value."
          },
          "estimates": {
            "type": "object",
            "description": "Each error estimate the series declares (such as `std`), as a column.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              }
            }
          }
        }
      },
      "Me": {
        "type": "object",
        "required": [
          "identity",
          "caller",
          "roles",
          "scopes",
          "reads"
        ],
        "properties": {
          "identity": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "A person's name, given and family, when the token carries it",
            "example": "Tara Test"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "A person's realm roles; empty for a client",
            "example": [
              "author",
              "trader"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the caller may do on the read API: data:read; ext:deploy for an author; ext:admin for an operator",
            "example": [
              "data:read",
              "ext:deploy"
            ]
          },
          "caller": {
            "type": "string",
            "enum": [
              "person",
              "client"
            ]
          },
          "reads": {
            "type": "object",
            "description": "What the caller reads: false and null throughout without data:read",
            "properties": {
              "registered_feeders": {
                "type": "boolean"
              },
              "forecasts": {
                "type": "boolean"
              },
              "own": {
                "type": [
                  "string",
                  "null"
                ],
                "example": "ext.tara"
              }
            }
          },
          "program": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a program: its client id. A program is told it is its owner (`identity`), a person, with its owner's reading roles; this says which program. Null for anyone else."
          }
        }
      },
      "Parameter": {
        "type": "object",
        "required": [
          "name",
          "type",
          "default",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "integer",
              "number",
              "choice",
              "text",
              "series"
            ]
          },
          "default": {},
          "minimum": {
            "type": "number",
            "format": "double"
          },
          "maximum": {
            "type": "number",
            "format": "double"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "max_length": {
            "type": "integer",
            "format": "int32",
            "description": "text: its longest, in characters"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "series: the unit a picker offers"
          }
        }
      },
      "Indicator": {
        "type": "object",
        "required": [
          "id",
          "version",
          "versions",
          "title",
          "description",
          "inputs",
          "parameters",
          "outputs",
          "columns",
          "history"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "rolling-mean"
          },
          "version": {
            "type": "string",
            "example": "1",
            "description": "This version. A released version never changes."
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "1",
              "2"
            ],
            "description": "Every version it computes, oldest first: a released version stays through 3.x."
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inputs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The names of its input series, in a call's `inputs`."
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Parameter"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The names of the series it answers with."
          },
          "columns": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "example": {
              "average": [
                "count"
              ]
            },
            "description": "Each output's columns beside its values, where it has any."
          },
          "history": {
            "type": "string",
            "description": "The history read before the period."
          }
        }
      },
      "Compute": {
        "type": "object",
        "required": [
          "inputs",
          "start",
          "end"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The path's id, if given; any other is refused."
          },
          "version": {
            "type": "string",
            "description": "The version to compute; the newest if absent. Name it, and the same call answers the same."
          },
          "inputs": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Each input's series."
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "step": {
            "type": "string",
            "example": "PT1H",
            "description": "An ISO 8601 duration: the inputs are first averaged over each step."
          },
          "zone": {
            "type": "string",
            "default": "Europe/Berlin",
            "description": "The market's time zone: a step of a day is its day, and base and peak are its hours. From version 2; version 1 computes in Berlin's time."
          },
          "timeline": {
            "type": "string",
            "default": "live"
          },
          "parameters": {
            "type": "object"
          }
        },
        "additionalProperties": false,
        "description": "A compute. A field it does not take is refused (`invalid_request`), so a misspelt one is not passed over."
      },
      "Computed": {
        "type": "object",
        "required": [
          "indicator",
          "version",
          "as_of",
          "start",
          "end",
          "step",
          "zone",
          "timeline",
          "parameters",
          "inputs",
          "read_from",
          "steps",
          "gaps",
          "result"
        ],
        "properties": {
          "indicator": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "description": "The version that computed."
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "step": {
            "type": [
              "string",
              "null"
            ],
            "description": "The call's step, if it gave one."
          },
          "zone": {
            "type": "string",
            "description": "The zone computed in."
          },
          "timeline": {
            "type": "string"
          },
          "inputs": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "parameters": {
            "type": "object",
            "description": "The parameters, with their defaults filled in.",
            "additionalProperties": true
          },
          "read_from": {
            "type": "string",
            "format": "date-time",
            "description": "The earliest valid time read: the period, and the history before it."
          },
          "steps": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Each input's step, as computed on: the call's, or the input's own, the most common interval between its values (null under two values)."
          },
          "gaps": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Gaps"
            },
            "description": "Each input's gaps over all that was read."
          },
          "result": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Output"
            },
            "description": "Each output."
          }
        }
      },
      "Output": {
        "type": "object",
        "required": [
          "unit",
          "valid_at",
          "value",
          "columns"
        ],
        "description": "One output: its unit, its values in [start, end), and its columns, one value each beside them.",
        "properties": {
          "unit": {
            "type": "string",
            "example": "EUR/MWh",
            "description": "An input's unit, or its own: empty for none, as RSI's."
          },
          "valid_at": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            }
          },
          "value": {
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            }
          },
          "columns": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "number",
                "format": "double"
              }
            },
            "example": {
              "count": [
                24
              ]
            },
            "description": "Each column the output declares, such as base and peak's `count`, the values a day's average is of."
          }
        }
      },
      "Gaps": {
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "description": "Where an input misses values: each gap from `start` to `end`, where two values lie further apart than one and a half steps.",
        "properties": {
          "start": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            }
          },
          "end": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      },
      "ChartIn": {
        "type": "object",
        "required": [
          "name",
          "position",
          "spec"
        ],
        "description": "A chart to keep.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "example": "Power DE"
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 999,
            "description": "Its place among the caller's charts."
          },
          "spec": {
            "type": "object",
            "additionalProperties": true,
            "description": "The screen's description of the chart, kept whole."
          }
        }
      },
      "Chart": {
        "type": "object",
        "required": [
          "id",
          "name",
          "position",
          "spec",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "spec": {
            "type": "object",
            "additionalProperties": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Charts": {
        "type": "object",
        "required": [
          "charts",
          "limit"
        ],
        "properties": {
          "charts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Chart"
            }
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "The most charts the caller may keep.",
            "example": 32
          }
        }
      },
      "Change": {
        "type": "object",
        "required": [
          "name",
          "from",
          "to",
          "known_at"
        ],
        "additionalProperties": false,
        "description": "New values of one series: told in a `changed` event of `/v1/events`.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The series"
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "The earliest valid time of the new values"
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "The latest valid time of the new values"
          },
          "known_at": {
            "type": "string",
            "format": "date-time",
            "description": "The latest time one of them became known"
          }
        }
      },
      "StreamEvent": {
        "type": "object",
        "required": [
          "specversion",
          "id",
          "source",
          "type",
          "time",
          "datacontenttype",
          "dataschema",
          "schemaversion",
          "data"
        ],
        "description": "What `/v1/events` tells: a CloudEvent 1.0, whole, in the `data:` of a server-sent event. `contracts/events.schema.json` holds the schema of `data` for each `type`. A client ignores attributes it does not know.",
        "properties": {
          "specversion": {
            "type": "string",
            "const": "1.0"
          },
          "id": {
            "type": "string",
            "description": "Unique to this event. It is not the place to resume from: that is the server-sent event's `id:`."
          },
          "source": {
            "type": "string",
            "description": "The read API and its version",
            "example": "api/3.0"
          },
          "type": {
            "type": "string",
            "description": "`bff.stream.` and the event's name",
            "x-extensible-enum": [
              "bff.stream.ready",
              "bff.stream.changed",
              "bff.stream.paused",
              "bff.stream.missed",
              "bff.stream.expired"
            ]
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "description": "When the read API told it"
          },
          "datacontenttype": {
            "type": "string",
            "const": "application/json"
          },
          "dataschema": {
            "type": "string",
            "format": "uri",
            "description": "The schema of `data`, in `contracts/events.schema.json`"
          },
          "schemaversion": {
            "type": "string",
            "description": "The version of the type's `data`, by SemVer",
            "example": "1.0.0"
          },
          "data": {
            "type": "object",
            "description": "`ready`: `is_following`, a boolean. `changed`: `series`, a list of `Change`. `missed`: `since`, a time or null. `paused` and `expired`: empty.",
            "properties": {
              "is_following": {
                "type": "boolean"
              },
              "series": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Change"
                }
              },
              "since": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          }
        }
      },
      "Owner": {
        "type": "object",
        "required": [
          "kind",
          "username"
        ],
        "description": "Who deployed a function",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "person"
            ]
          },
          "username": {
            "type": "string",
            "example": "tara"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "example": "Tara Test"
          }
        }
      },
      "Entry": {
        "type": "object",
        "required": [
          "kind",
          "name",
          "owner"
        ],
        "description": "A person's function, as its owner keeps it",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "model",
              "indicator"
            ]
          },
          "name": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/Owner"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "readme": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "suspended_reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "For operators: why a suspended version is suspended"
                }
              }
            }
          },
          "calls_30_days": {
            "type": "integer",
            "format": "int64"
          },
          "last_day": {
            "type": "object",
            "description": "For operators: the function's calls of the last 24 hours",
            "required": [
              "calls",
              "failed"
            ],
            "properties": {
              "calls": {
                "type": "integer",
                "format": "int64"
              },
              "failed": {
                "type": "integer",
                "format": "int64",
                "description": "Calls that ended with an error, a busy runner's among them"
              },
              "last_failed": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "The latest call that failed",
                "required": [
                  "run",
                  "at",
                  "version"
                ],
                "properties": {
                  "run": {
                    "type": "string",
                    "description": "The run's id: its log is read at /v1/admin/runs/{id}/log"
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "version": {
                    "type": "string"
                  },
                  "code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The error's code, such as `model_failed`, `model_timeout`, `runner_busy`"
                  }
                }
              }
            }
          }
        }
      },
      "Version": {
        "type": "object",
        "required": [
          "version",
          "state",
          "runtime"
        ],
        "description": "A version of a person's function",
        "properties": {
          "version": {
            "type": "string",
            "example": "1"
          },
          "state": {
            "type": "string",
            "enum": [
              "checking",
              "waiting",
              "failed",
              "ready",
              "released",
              "deprecated",
              "suspended"
            ]
          },
          "upload": {
            "type": [
              "string",
              "null"
            ],
            "example": "sha256:9f2c…"
          },
          "runtime": {
            "type": "string",
            "example": "python-1"
          },
          "runtime_digest": {
            "type": [
              "string",
              "null"
            ]
          },
          "waiting_for": {
            "type": [
              "object",
              "null"
            ],
            "description": "What the checks wait for: `env`, `hosts`"
          },
          "release_on_pass": {
            "type": "boolean"
          },
          "suspended_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "manifest": {
            "type": [
              "object",
              "null"
            ],
            "description": "contracts/function-manifest.schema.json; one version alone"
          },
          "report": {
            "type": [
              "object",
              "null"
            ],
            "description": "The checks' report; one version alone"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "released_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deprecated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "suspended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Run": {
        "type": "object",
        "required": [
          "version",
          "purpose",
          "yours",
          "started_at"
        ],
        "description": "A run of a function. The owner's own calls and the checks in full; others' calls as when, version, duration and outcome alone",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "call",
              "check",
              "retest"
            ]
          },
          "yours": {
            "type": "boolean"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "took_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ok",
              "failed",
              null
            ]
          },
          "cold": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "read": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LibraryRequest": {
        "type": "object",
        "required": [
          "id",
          "library",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "library": {
            "type": "string",
            "example": "lightgbm"
          },
          "why": {
            "type": "string"
          },
          "function": {
            "type": [
              "string",
              "null"
            ]
          },
          "requester": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "requested",
              "accepted",
              "declined",
              "available"
            ]
          },
          "answer": {
            "type": [
              "string",
              "null"
            ]
          },
          "runtime": {
            "type": [
              "string",
              "null"
            ]
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Runtime": {
        "type": "object",
        "required": [
          "name",
          "state",
          "libraries"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "python-1"
          },
          "state": {
            "type": "string",
            "enum": [
              "current",
              "withdrawing"
            ]
          },
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "digest": {
            "type": [
              "string",
              "null"
            ]
          },
          "libraries": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "numpy": "2.x",
              "pandas": "3.x"
            }
          }
        }
      },
      "HostRequest": {
        "type": "object",
        "required": [
          "host",
          "state"
        ],
        "properties": {
          "host": {
            "type": "string",
            "example": "api.anthropic.com"
          },
          "state": {
            "type": "string",
            "enum": [
              "requested",
              "approved",
              "declined",
              "withdrawn"
            ]
          },
          "requested_by": {
            "type": "object"
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Function": {
        "type": "object",
        "required": [
          "kind",
          "name",
          "owner",
          "title",
          "version",
          "parameters",
          "outputs"
        ],
        "description": "A person's function, as a caller reads it",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "model",
              "indicator"
            ]
          },
          "name": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/Owner"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "string",
            "example": "1"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "ready",
              "released",
              "deprecated"
            ]
          },
          "newest": {
            "type": [
              "string",
              "null"
            ],
            "description": "The newest released version, which a deprecated one points to"
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Parameter"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "unit": {
                  "type": "string"
                },
                "quantiles": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "format": "double"
                  }
                },
                "columns": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "card": {
            "type": [
              "object",
              "null"
            ]
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "host": {
                  "type": "string"
                },
                "account": {
                  "type": "string",
                  "description": "Whose account the data are sent under: the owner's"
                }
              }
            }
          },
          "time_seconds": {
            "type": "integer",
            "format": "int32"
          },
          "runtime": {
            "type": "string"
          },
          "repeatable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the same call answers the same, bit for bit; null until checked"
          }
        }
      },
      "Answered": {
        "type": "object",
        "required": [
          "kind",
          "function",
          "version",
          "owner",
          "parameters",
          "start",
          "end",
          "as_of",
          "result",
          "run"
        ],
        "description": "A call's answer: each output's unit, valid times and values (numbers or null) and columns; and the run",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "model",
              "indicator"
            ]
          },
          "function": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/Owner"
          },
          "parameters": {
            "type": "object",
            "additionalProperties": true
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "result": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "required": [
                "unit",
                "valid_at",
                "value",
                "columns"
              ],
              "properties": {
                "unit": {
                  "type": "string"
                },
                "valid_at": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "value": {
                  "type": "array",
                  "items": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "format": "double"
                  }
                },
                "columns": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "format": "double"
                    }
                  }
                }
              }
            }
          },
          "run": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "took_ms": {
                "type": "integer",
                "format": "int32"
              },
              "cold": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "runtime": {
                "type": "object"
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "read": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "hosts": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "repeatable": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "Release": {
        "type": "object",
        "required": [
          "product",
          "units"
        ],
        "properties": {
          "product": {
            "type": [
              "string",
              "null"
            ],
            "description": "The product's version: 3.2.8."
          },
          "commit": {
            "type": "string",
            "description": "The commit deployed."
          },
          "deployed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was deployed."
          },
          "units": {
            "type": "object",
            "description": "Each unit, by its name.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "version": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The product's version in which the unit last changed; null for a unit of stock images."
                },
                "says": {
                  "type": "string",
                  "description": "What the unit is, in a line."
                }
              }
            }
          }
        }
      },
      "Card": {
        "type": "object",
        "additionalProperties": false,
        "required": [],
        "description": "What a series' feeder says of it, beyond its values: one version of its card, in force from `valid_from` (docs/plan-trading-requirements.md, 2.3). Every field is optional: a card says what its feeder knows. As the built contract's `Card`, with `set_at`.",
        "properties": {
          "valid_from": {
            "type": "string",
            "format": "date-time",
            "description": "From which valid time this version holds; absent, from the beginning of time. The version in force for a valid time is the one with the latest `valid_from` at or before it."
          },
          "set_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this version was stored; a version corrected later has a later one."
          },
          "grid": {
            "type": "string",
            "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$",
            "description": "The step between the series' values, an ISO 8601 duration of local days and clock time, such as `PT15M`, `PT1H` or `P1D`, in the calendar of `zone`: `P1D` keeps its local hour when the clocks change, and a day of `PT15M` has 92, 96 or 100 quarter-hours. Absent for a series with no regular step."
          },
          "zone": {
            "type": "string",
            "description": "The time zone its days and clock times are in, an IANA name such as Europe/Berlin."
          },
          "publishes": {
            "type": "object",
            "minProperties": 1,
            "maxProperties": 1,
            "additionalProperties": false,
            "required": [],
            "description": "When a value becomes known, by one of three rules. A clock time needs `zone`.",
            "properties": {
              "day_before": {
                "type": "string",
                "pattern": "^[0-2][0-9]:[0-5][0-9]$",
                "description": "The values of a day are known on the day before, at this clock time."
              },
              "same_day": {
                "type": "string",
                "pattern": "^[0-2][0-9]:[0-5][0-9]$",
                "description": "The values of a day are known on that day, at this clock time (IDCC(c) at 05:00, IDA3 at 10:00)."
              },
              "after": {
                "type": "string",
                "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$",
                "description": "A value is known this long after the moment it is for, a duration."
              }
            }
          },
          "revises": {
            "type": "boolean",
            "description": "Whether the source ever corrects a value it has published."
          },
          "grace": {
            "type": "string",
            "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$",
            "description": "How long after its due time a value is late, a duration; two hours where absent."
          },
          "covers": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^[0-2][0-9]:[0-5][0-9]-[0-2][0-9]:[0-5][0-9]$"
            },
            "description": "The parts of each day the source gives by design, local times of `zone`, such as `12:00-24:00` for IDA3. A time outside them is not covered, never late. All of the day where absent."
          },
          "calendar": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,63}$",
            "description": "The publication calendar the source keeps, by name, such as TARGET: its days without a publication are not late."
          },
          "origin": {
            "type": "string",
            "x-extensible-enum": [
              "fetched",
              "computed",
              "forecast",
              "imported"
            ],
            "description": "Where the values come from: fetched from a source, computed by a definition, forecast by a model, or imported by a person. Not the series' `kind`, which says what a value is."
          },
          "lineage": {
            "type": "string",
            "pattern": "^[A-Z]{2,4}-[0-9]{2,3}$",
            "description": "The requirement the series answers, such as RAW-01 or CMP-08."
          }
        }
      },
      "PublicKey": {
        "type": "object",
        "required": [
          "kty",
          "kid",
          "n",
          "e"
        ],
        "description": "The public half of a program's key, as a JWK: an RSA key of 2,048 bits or more, for signing with RS256, with an id. A key with any private field (`d`, `p`, `q`...) is refused: the private half never leaves the program's machine.",
        "properties": {
          "kty": {
            "const": "RSA"
          },
          "kid": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "description": "The key's id; the assertion's header names it."
          },
          "n": {
            "type": "string",
            "description": "The modulus, base64url."
          },
          "e": {
            "type": "string",
            "description": "The exponent, base64url."
          },
          "use": {
            "const": "sig"
          },
          "alg": {
            "const": "RS256"
          }
        }
      },
      "Program": {
        "type": "object",
        "required": [
          "name",
          "client_id",
          "status",
          "key_id",
          "key_set_at",
          "created_at"
        ],
        "description": "A program of a person's own: a client in the identity provider that signs in by itself, with its key, and reads and calls as its owner does.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Its name, its owner's to choose: a-z, 0-9 and _, starting with a letter, at most 32 characters."
          },
          "client_id": {
            "type": "string",
            "description": "The client it signs in as: `program.{owner}.{name}`."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it is suspended."
          },
          "key_id": {
            "type": "string",
            "description": "The id of its key. The key itself is never told."
          },
          "key_set_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "owner": {
            "type": "string",
            "description": "Its owner's user name; told to an operator."
          },
          "suspended_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who suspended it; told to an operator."
          }
        }
      },
      "Programs": {
        "type": "object",
        "required": [
          "programs"
        ],
        "properties": {
          "programs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Program"
            }
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "How many programs a person may keep."
          }
        }
      },
      "NextCursor": {
        "type": [
          "string",
          "null"
        ],
        "description": "The cursor of the page after this one: send it as `cursor`, with the same parameters. Null on the last page."
      },
      "AllPrograms": {
        "type": "object",
        "required": [
          "programs",
          "next_cursor"
        ],
        "properties": {
          "programs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Program"
            },
            "description": "A page of the programs, in the order of their ids."
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        }
      },
      "Status": {
        "type": [
          "string",
          "null"
        ],
        "x-extensible-enum": [
          "preliminary",
          "provisional",
          "final",
          "no_data",
          "cancelled",
          "withdrawn",
          "partial",
          "unstated",
          "not_covered",
          "not_due",
          "late",
          "source_down",
          "rejected"
        ],
        "description": "Where a value is in its life, or why there is none (docs/plan-trading-requirements.md, 2.1 to 2.4). With a value: null where the source says nothing of it, or `preliminary`, `provisional` or `final`. Without one, as the source or a definition states it: `no_data`, `cancelled`, `withdrawn` or `partial`; `unstated` for a row stored before 3.2.14. Without one, worked out at the read, as of its cut: `not_covered`, `not_due`, `late`, `source_down` or `rejected`. An open list: a client treats a status it does not know beside a value as none, and beside no value as an absence.",
        "examples": [
          "final",
          "cancelled",
          "late"
        ]
      },
      "FreshnessList": {
        "type": "object",
        "required": [
          "checked_at",
          "series",
          "next_cursor"
        ],
        "properties": {
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": "The moment the series are judged at: when the first page was read. The pages after it carry it in their cursor, so one read judges every series by one clock."
          },
          "series": {
            "type": "array",
            "description": "A page of the watched series, in the order of their names. The answer counts nothing: who wants how many are late reads the pages.",
            "items": {
              "type": "object",
              "required": [
                "name",
                "feeder",
                "last_valid_at",
                "next_valid_at",
                "due_at",
                "is_late",
                "status"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "feeder": {
                  "type": "string",
                  "description": "The feeder that feeds it."
                },
                "last_valid_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "The latest time with a value, or with an absence its source stated; null for a series that has none."
                },
                "next_valid_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "The time the series owes first: where it is late, the first time missing and late, at its end or inside it; else the next time of its grid to come. Null where its card says none."
                },
                "due_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When that time's value was, or is, due by the card in force for it."
                },
                "is_late": {
                  "type": "boolean",
                  "description": "Whether a time of the last week, or after its latest value, is missing past its due time by more than the card's grace: a hole inside the series as well as at its end. A stated absence (a cancelled auction) is present; a withdrawn value is gone; a time its card does not cover, or that its publication calendar does not publish on, is never owed."
                },
                "status": {
                  "$ref": "#/components/schemas/Status",
                  "description": "Why the time owed is missing, where it is late: `source_down`, the last read of the source that covered it failed, or was refused; `rejected`, the push of it was refused for its data; `late`, it was read without it, or not read. Null where it is not late."
                }
              }
            }
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "examples": [
          {
            "checked_at": "2026-11-19T12:10:00Z",
            "series": [
              {
                "name": "entsoe.de_lu_load",
                "feeder": "feeder.entsoe",
                "last_valid_at": "2026-11-19T10:45:00Z",
                "next_valid_at": "2026-11-19T07:00:00Z",
                "due_at": "2026-11-19T08:15:00Z",
                "is_late": true,
                "status": "source_down"
              },
              {
                "name": "entsoe.de_lu_price",
                "feeder": "feeder.entsoe",
                "last_valid_at": "2026-11-20T22:45:00Z",
                "next_valid_at": "2026-11-20T23:00:00Z",
                "due_at": "2026-11-20T12:00:00Z",
                "is_late": false,
                "status": null
              }
            ],
            "next_cursor": null
          }
        ]
      },
      "Value": {
        "description": "One value, of its series' kind: an IEEE double for `number`, a text for `text`, a rectangular array of numbers for `array`; null where there is none, the row's status saying why.",
        "oneOf": [
          {
            "type": "number",
            "format": "double"
          },
          {
            "type": "string"
          },
          {
            "$ref": "#/components/schemas/Numbers"
          },
          {
            "type": "null"
          }
        ]
      },
      "Numbers": {
        "type": "array",
        "description": "A rectangular array of finite numbers, of one dimension or more.",
        "items": {
          "oneOf": [
            {
              "type": "number",
              "format": "double"
            },
            {
              "$ref": "#/components/schemas/Numbers"
            }
          ]
        }
      },
      "ValuesPage": {
        "type": "object",
        "required": [
          "as_of",
          "recorded_as_of",
          "series",
          "next_cursor"
        ],
        "description": "A page of values or of versions, by series.",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date-time",
            "description": "The cut the read was answered at; the same on every page."
          },
          "recorded_as_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The second cut, by `recorded_at`, where one was asked for; the same on every page."
          },
          "series": {
            "type": "object",
            "description": "The values, by the series' name.",
            "additionalProperties": {
              "$ref": "#/components/schemas/Values"
            }
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        }
      },
      "Series": {
        "type": "object",
        "required": [
          "name",
          "kind",
          "unit",
          "market",
          "product",
          "origin"
        ],
        "description": "A series: what its values are, where they come from, and how far they reach as of the cut. `view=basic` gives the seven fields every series has (`name` to `origin`, `currency` among them); `view=full`, every field.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Its qualified name, its namespace first."
          },
          "kind": {
            "type": "string",
            "x-extensible-enum": [
              "number",
              "text",
              "array"
            ],
            "description": "What a value is; `Value` says how each is written."
          },
          "unit": {
            "type": "string",
            "description": "The unit of its values, such as EUR/MWh or MW; empty for none."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{3}$",
            "description": "The currency of a price, ISO 4217 (T4): the unit's first part where it is three capitals, as in EUR/MWh or USD; null where the unit is no price."
          },
          "market": {
            "type": "string",
            "description": "The market it belongs to, such as DE-LU; empty if it names none."
          },
          "product": {
            "type": "string",
            "description": "The product, such as day-ahead; empty if it names none."
          },
          "origin": {
            "type": "string",
            "x-extensible-enum": [
              "fetched",
              "computed",
              "forecast",
              "imported"
            ],
            "description": "Where its values come from, as its card says (`Card`); where its card names none, as its source is: a feeder's `fetched`, a forecast's `forecast`, a person's `imported`."
          },
          "lineage": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2,4}-[0-9]{2,3}$",
            "description": "The requirement it answers, as its card says; null where its card names none."
          },
          "description": {
            "type": "string",
            "description": "What it is, as its feeder first described it. It never changes."
          },
          "source": {
            "$ref": "#/components/schemas/Source",
            "description": "Where it comes from."
          },
          "definition": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "id",
              "version"
            ],
            "description": "What makes a computed series or a forecast: a definition's id, or a function as `{owner}/{name}`, and its version; for a forecast's copy, its model and version. Null for a fetched or imported series.",
            "properties": {
              "id": {
                "type": "string",
                "description": "The definition's id, or the function's owner and name."
              },
              "version": {
                "type": "string",
                "description": "The version that makes the series."
              }
            }
          },
          "card": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Card"
              },
              {
                "type": "null"
              }
            ],
            "description": "Its card in force at the valid time asked for, or for its last value; null where its feeder states none."
          },
          "first_valid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The valid time of its first value as of the cut; null for a series without one."
          },
          "last_valid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The valid time of its last value as of the cut; null for a series without one."
          },
          "latest_known_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the latest of its values became known, as of the cut."
          }
        }
      },
      "SeriesList": {
        "type": "object",
        "required": [
          "series",
          "next_cursor"
        ],
        "description": "A page of the catalog.",
        "properties": {
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Series"
            },
            "description": "The series, in the order of their names."
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        }
      },
      "CardList": {
        "type": "object",
        "required": [
          "cards",
          "next_cursor"
        ],
        "description": "A page of a series' cards.",
        "properties": {
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "description": "The versions of the card, by `valid_from`, the first from the beginning of time."
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        }
      },
      "Coverage": {
        "type": "object",
        "required": [
          "as_of",
          "series"
        ],
        "description": "How much of a range each series holds, and why the rest is missing.",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date-time",
            "description": "The cut the counts are as of."
          },
          "series": {
            "type": "object",
            "description": "The counts, by the series' name.",
            "additionalProperties": {
              "type": "object",
              "required": [
                "steps",
                "has_value",
                "missing"
              ],
              "properties": {
                "steps": {
                  "type": "integer",
                  "format": "int32",
                  "description": "The steps the grid has in the range."
                },
                "has_value": {
                  "type": "integer",
                  "format": "int32",
                  "description": "The steps that hold a value."
                },
                "missing": {
                  "type": "object",
                  "description": "The steps without a value, counted by reason (`Status`).",
                  "propertyNames": {
                    "$ref": "#/components/schemas/Status"
                  },
                  "additionalProperties": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "examples": [
                    {
                      "cancelled": 4,
                      "source_down": 12
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "Calendar": {
        "type": "object",
        "required": [
          "zone",
          "market",
          "product",
          "time_zone",
          "days"
        ],
        "description": "A market's delivery days, as its calendar has them.",
        "properties": {
          "zone": {
            "type": "string",
            "description": "The bidding zone."
          },
          "market": {
            "type": "string",
            "description": "The market."
          },
          "product": {
            "type": "string",
            "description": "What is traded."
          },
          "time_zone": {
            "type": "string",
            "description": "Whose midnight starts a delivery day and whose clock labels it, an IANA name.",
            "examples": [
              "Europe/Berlin"
            ]
          },
          "days": {
            "type": "array",
            "description": "The delivery days, in order.",
            "items": {
              "type": "object",
              "required": [
                "date",
                "starts_at",
                "ends_at",
                "mtu",
                "dst",
                "periods"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date",
                  "description": "The delivery day."
                },
                "starts_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Its local midnight."
                },
                "ends_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "The next local midnight."
                },
                "mtu": {
                  "type": "string",
                  "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$",
                  "description": "The market time unit of the day, a duration.",
                  "examples": [
                    "PT15M"
                  ]
                },
                "dst": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "x-extensible-enum": [
                    "short",
                    "long"
                  ],
                  "description": "Whether the clocks change that day: `short` on a day of 23 hours, `long` on one of 25; null on any other."
                },
                "periods": {
                  "type": "array",
                  "description": "Every period of the day, covered or not, in order.",
                  "items": {
                    "type": "object",
                    "required": [
                      "starts_at",
                      "ends_at",
                      "local_time",
                      "label",
                      "is_covered"
                    ],
                    "properties": {
                      "starts_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Where the period starts."
                      },
                      "ends_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Where it ends."
                      },
                      "local_time": {
                        "type": "string",
                        "pattern": "^[0-2][0-9]:[0-5][0-9]$",
                        "description": "The local clock time it starts at; 02:00 twice on Berlin's long day.",
                        "examples": [
                          "02:00"
                        ]
                      },
                      "label": {
                        "type": "string",
                        "pattern": "^H([1-9]|1[0-9]|2[0-5])( Q[1-4])?$",
                        "description": "The desk's label, numbered in order of delivery.",
                        "examples": [
                          "H3 Q2"
                        ]
                      },
                      "is_covered": {
                        "type": "boolean",
                        "description": "Whether the market covers it; IDA3 covers 12:00 to 24:00."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Catalogue": {
        "type": "object",
        "description": "The catalogue as catalogue.json holds it (its README says each field).",
        "required": [
          "catalogue",
          "feeds",
          "providers",
          "datasets",
          "series",
          "codes"
        ],
        "properties": {
          "catalogue": {
            "type": "object",
            "description": "Its title, version, date, owner and the standards it follows."
          },
          "feeds": {
            "type": "object",
            "description": "How data reaches the desk and the platform, by the feed's id: the platform's feeders and publisher, the desk's ClickHouse, files, by hand.",
            "additionalProperties": {
              "type": "object"
            }
          },
          "providers": {
            "type": "array",
            "description": "Each provider: its id, name, description, address, licence, the credit to show and its terms.",
            "items": {
              "type": "object"
            }
          },
          "datasets": {
            "type": "array",
            "description": "Each dataset: its id (provider.dataset), what it holds, its shape (series, table, records, view), its dimensions, how it reaches us and its state.",
            "items": {
              "type": "object"
            }
          },
          "series": {
            "type": "array",
            "description": "Each series a dataset names on the platform: its name, its dataset, its codes, unit, step, publication rule and route's state.",
            "items": {
              "type": "object"
            }
          },
          "codes": {
            "type": "object",
            "description": "The code lists (areas, borders, stages, countries, currencies, instruments), each code with its label and how each system spells it.",
            "additionalProperties": {
              "type": "object"
            }
          }
        }
      },
      "SourceList": {
        "type": "object",
        "required": [
          "checked_at",
          "sources"
        ],
        "properties": {
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": "The moment every source is judged at."
          },
          "sources": {
            "type": "array",
            "description": "Each provider of the catalogue, in its order.",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "description",
                "url",
                "licence",
                "credit",
                "terms",
                "status",
                "series",
                "watched",
                "late"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The provider's id in the catalogue, as `entsoe`."
                },
                "name": {
                  "type": "string",
                  "description": "Its name, as ENTSO-E."
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "What it is."
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Its address; null for our own."
                },
                "licence": {
                  "type": "string",
                  "description": "Its licence, by the catalogue's word for it."
                },
                "credit": {
                  "type": "string",
                  "description": "The credit to show wherever its data is shown."
                },
                "terms": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Its terms of use."
                },
                "status": {
                  "type": "string",
                  "x-extensible-enum": [
                    "not_on_platform",
                    "not_watched",
                    "source_down",
                    "rejected",
                    "late",
                    "on_time"
                  ],
                  "description": "Its status, the first that holds (the operation says each)."
                },
                "series": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0,
                  "description": "How many of its series the platform reads."
                },
                "watched": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0,
                  "description": "How many of those freshness watches."
                },
                "late": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0,
                  "description": "How many of those are late, whatever the reason."
                }
              }
            }
          }
        }
      }
    },
    "responses": {
      "Problem": {
        "description": "A refusal or a failure the statuses above do not list: a path or a method that is not served (`not_found`, `method_not_allowed`), a bug (`internal`). Every error is a problem.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "default": 200
        },
        "description": "The most items in a page: 200 unless given, and at most 500. One above the maximum is lowered to it, not refused; one that is no whole number from 1 is refused (`invalid_request`)."
      },
      "series_limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "default": 500
        },
        "description": "The most series in a page: 500 unless given, and at most 1,000. One above the maximum is lowered to it, not refused; one that is no whole number from 1 is refused (`invalid_request`)."
      },
      "cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "The `next_cursor` of the page before, as it was; without it, the first page. It is opaque, and whole in itself: it carries where the page before ended, and any copy of the service answers it. Send it with the same parameters as the page before. One that this list did not give for this request is refused (`invalid_cursor`)."
      },
      "filter": {
        "name": "filter",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "example": "namespace = entsoe AND status = source_down",
        "description": "Which items: comparisons of a field and a value (`=`, `!=`, `<`, `<=`, `>`, `>=`, and `:` for a text that holds the value) joined by `AND`, `OR` and `NOT` (or `-`), with parentheses. `OR` binds tighter than `AND`. A value is a word, a number, `true` or `false`, or a text in double quotes; a time is RFC 3339, with its offset. The fields are the list's own, named in its description. One that does not read is refused (`invalid_filter`), with its `position`."
      },
      "rows_limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "default": 10000,
          "x-bff-maximum": 200000
        },
        "description": "The most rows in a page: of values, one value of one series at one time, a filled step among them; of a table, one row. 10,000 unless given, about a month of quarter-hours of three series, a chart's read, in one page; and at most 200,000, the most rows one read holds today (`PF_API_MAX_ROWS`), so that no page is larger than a read is now. One above the maximum is lowered to it, not refused; one that is no whole number from 1 is refused (`invalid_request`).",
        "required": false
      },
      "series_name": {
        "name": "name",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "example": "entsoe.de_lu_price",
        "description": "The series' qualified name."
      },
      "view": {
        "name": "view",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "basic",
            "full"
          ],
          "default": "basic"
        },
        "description": "How much of each item is wanted; each read says what each gives.",
        "required": false
      },
      "start": {
        "name": "start",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "The first valid time, included."
      },
      "end": {
        "name": "end",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "The last valid time, excluded."
      },
      "as_of": {
        "name": "as_of",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "The moment the answer is as known at, by `known_at`; now if absent. A version known after it is not seen."
      }
    }
  },
  "tags": [
    {
      "name": "Programs",
      "description": "A person's programs: clients of their own that sign in by themselves, with a key, and read and call as their owner does. Kept by a person, signed in; a program keeps none."
    }
  ]
}
