{
  "contract_version": "1",
  "title": "Antistatic API",
  "base_url": "https://antistatic.exchange/api/v1",
  "description": "The REST API behind antistatic.exchange, its MCP server and the antistatic CLI. JSON in and out; most successful responses wrap their payload in `data`, and errors are `{\"error\": {\"message\", \"code\"}}`. Additive changes (new routes, new response fields, new optional parameters) can happen at any time, so ignore fields you don't know. A breaking change gets a new path or a deprecation window first: deprecated routes send a `Deprecation` header (RFC 9745), with `Sunset` and a `Link` when known.",
  "auth": {
    "scheme": "Authorization: Bearer <token>: an OAuth access token (`antistatic login`, MCP sign-in) or a personal API token from https://antistatic.exchange/users/settings#api-tokens.",
    "levels": {
      "none": "Public; a token is ignored.",
      "optional": "Public; with a token the response adds your own data (and a token needs the read scope).",
      "read": "A token with the read scope.",
      "write": "A token with the write scope.",
      "comment": "A token with the comment scope.",
      "admin": "A token with the admin scope, held by an admin."
    },
    "refused_token": "A token that is sent but not accepted gets 401 with code `invalid_token`, a message (also `error_description`) saying whether it expired (refresh it), was revoked or replaced by a refresh, or is unknown, and `WWW-Authenticate: Bearer error=\"invalid_token\", error_description=\"...\"` (RFC 6750). Without a token, a route that needs one gets 401 `unauthorized`."
  },
  "headers": {
    "x-antistatic-as": "`bot`: forecast or comment as your bot account (routes that list this header).",
    "x-antistatic-run": "A sandbox run id: read the market inside your run, as of its clock (routes that list this header; also `?run_id=`). On a wargame's questions, quote and forecast too (POST routes that list it); a past sandbox is read-only (403 `not_allowed_in_run`).",
    "user-agent": "Clients identify themselves, e.g. `antistatic-cli/1.2.3`."
  },
  "rate_limits": "Per account with a token, per IP without; read and write allowances are separate. Responses carry x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-scope; a 429 carries retry-after.",
  "$defs": {
    "error": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "object",
          "required": [
            "message"
          ],
          "properties": {
            "message": {
              "type": "string"
            },
            "code": {
              "type": "string",
              "description": "Stable machine-readable code, e.g. not_found, unauthorized, forbidden, invalid_params, out_of_order, rate_limited."
            }
          }
        }
      }
    },
    "envelope": {
      "type": "object",
      "required": [
        "data"
      ],
      "description": "Not yet described field by field; the payload is in data."
    },
    "contract": {
      "type": "object",
      "required": [
        "contract_version",
        "routes"
      ],
      "properties": {
        "contract_version": {
          "type": "string"
        },
        "routes": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "method",
              "path",
              "summary",
              "auth",
              "responses",
              "example"
            ]
          }
        }
      }
    },
    "push_error": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "description": "A curriculum push error: a code and the place (`path`, e.g. `items[b012].bars[g02-y2004]`), never the value.",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "path": {
              "type": [
                "string",
                "null"
              ]
            },
            "parts": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "missing_parts: the hashes to send."
            },
            "manifest_sha256": {
              "type": [
                "string",
                "null"
              ]
            },
            "state": {
              "type": "string"
            }
          }
        }
      }
    },
    "timeline_draft_status": {
      "type": "object",
      "required": [
        "slug",
        "version",
        "state",
        "manifest_sha256",
        "source_commit",
        "schema_version",
        "parts_expected",
        "parts_received",
        "parts_imported",
        "received",
        "error"
      ],
      "properties": {
        "slug": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "state": {
          "enum": [
            "receiving",
            "importing",
            "imported",
            "failed",
            "published",
            "archived"
          ]
        },
        "manifest_sha256": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_commit": {
          "type": [
            "string",
            "null"
          ]
        },
        "schema_version": {
          "type": [
            "integer",
            "null"
          ]
        },
        "parts_expected": {
          "type": "integer"
        },
        "parts_received": {
          "type": "integer"
        },
        "parts_imported": {
          "type": "integer"
        },
        "received": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "SHA-256 of every part stored for the draft."
        },
        "error": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "code": {
              "type": "string"
            },
            "path": {
              "type": [
                "string",
                "null"
              ]
            },
            "message": {
              "type": "string"
            }
          }
        },
        "authoring": {
          "type": "object",
          "description": "A draft built a piece at a time: the keys its working manifest holds.",
          "required": [
            "checkpoints",
            "questions",
            "disclosures"
          ],
          "properties": {
            "checkpoints": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "questions": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "disclosures": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "timeline_turn": {
      "type": "object",
      "description": "A wargame turn's result: the observations its clock reached (each dated at or before `clock`, with an id; struck ones left out), an outcome for each of the player's actions, and the run's bars it resolved. Nothing sealed. A turn that stopped for the player's answers has only `status` (\"questions\"), `run_id`, `turn_id`, `questions_for_player` and `replayed`: nothing happened and the clock hasn't moved. For a client-planned run, the first answer is `status: \"planner_job\"` with `job_id`: the player's planner agent plans it through the planner-job routes, and the same turn_id sent again then returns the stored turn. Before the first turn, a run tracking fewer questions than its opening answers once with `status: \"questions_needed\"`, `tracked`, `opening` ([low, high], to make now), `aim` ([low, high], over the run) and `next` (for a client-planned run also `job_id`, a questions job for its planner): nothing happened; make the questions, then send the same turn_id again.",
      "properties": {
        "run_id": {
          "type": "number"
        },
        "turn": {
          "type": "object",
          "properties": {
            "index": {
              "type": "number"
            },
            "from": {
              "type": "string"
            },
            "to": {
              "type": "string"
            }
          },
          "required": [
            "index",
            "from",
            "to"
          ]
        },
        "clock": {
          "type": "string"
        },
        "observations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "at": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "at",
              "text"
            ]
          }
        },
        "resolved": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "market_code": {
                "type": "string"
              },
              "bar": {
                "type": "string"
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "yes",
                  "no"
                ]
              }
            },
            "required": [
              "market_code",
              "bar",
              "outcome"
            ]
          }
        },
        "replayed": {
          "type": "boolean"
        },
        "action_outcomes": {
          "type": "array",
          "description": "One per action item (the actions split by line, or by sentence when they are one line), as the player knows it by the turn's end. Absent on turns taken before outcomes existed.",
          "items": {
            "type": "object",
            "properties": {
              "action": {
                "type": "string"
              },
              "label": {
                "type": "string",
                "description": "A short name for the action, at most six words (on turns before labels existed, absent: the action's text cut near 60 characters stands in)."
              },
              "status": {
                "type": "string",
                "enum": [
                  "done",
                  "partly",
                  "slipped",
                  "unknown"
                ]
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "action",
              "status",
              "note"
            ]
          }
        },
        "script": {
          "type": "string",
          "description": "The turn narrated from the drawn outcome only: a dated header with T+days, what happened, Results (one line per action and decree), Elsewhere, Markets, ending \"What do you do?\". Absent on turns taken before narration existed."
        },
        "answers": {
          "type": [
            "string",
            "null"
          ],
          "description": "Answers to the turn's info entries."
        },
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "strike": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ]
          }
        },
        "answers_as_of": {
          "type": "string",
          "description": "The clock the answers hold at: the turn's start."
        },
        "show": {
          "type": "object",
          "description": "The run's markets with an event this turn (an item happened or was settled, a period's value settled, a question created or given items; not routine no-bars), to show the player after the script (absent when none, and on turns before it existed).",
          "properties": {
            "run_id": {
              "type": "integer"
            },
            "market_codes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "urls": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "questions_created": {
          "type": "array",
          "description": "Run questions the planner created this turn, at its end; outcome yes when a draw settled it then.",
          "items": {
            "type": "object",
            "properties": {
              "market_code": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "outcome": {
                "type": "string"
              }
            },
            "required": [
              "market_code",
              "title"
            ]
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "questions",
            "planner_job",
            "questions_needed"
          ],
          "description": "Present only when the turn stopped before anything happened because the planner needs the player's answers: ask them verbatim and retry the same `turn_id` with the same entries plus each answer as a feed entry with `answers` (answer entries don't make it another request); a retry without answers proceeds on the stated assumptions."
        },
        "turn_id": {
          "type": "string"
        },
        "questions_for_player": {
          "type": "array",
          "description": "Questions the planner put to the player (at most two a turn): relay them verbatim. In a completed turn the turn went ahead on each one's assumption; with `status` questions it waits for them.",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Send the answer as a feed entry with `answers` set to this."
              },
              "question": {
                "type": "string",
                "description": "Relay it to the player verbatim."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "fact",
                  "probability"
                ]
              },
              "assumption": {
                "type": "string",
                "description": "What the simulation assumes until the player answers."
              },
              "blocking": {
                "type": "boolean",
                "description": "Whether the turn waits for the answer."
              },
              "why": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "question",
              "kind",
              "assumption"
            ]
          }
        },
        "scout_added": {
          "type": "array",
          "description": "Run questions or items the world-market scout added since the previous turn, anchored on real-world forecasts (also in `show`).",
          "items": {
            "type": "object",
            "properties": {
              "market_code": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "key": {
                "type": "string"
              },
              "action": {
                "type": "string",
                "enum": [
                  "create_question",
                  "add_item"
                ]
              }
            }
          }
        },
        "mode": {
          "type": "string",
          "enum": [
            "server",
            "client"
          ]
        },
        "job_id": {
          "type": "string"
        },
        "expires_at": {
          "type": "string"
        },
        "next": {
          "type": "string"
        },
        "tracked": {
          "type": "number",
          "description": "With status questions_needed: how many questions the run tracks."
        },
        "aim": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "With status questions_needed: the range of questions to aim for over the run, [low, high]."
        },
        "opening": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "With status questions_needed: the range of questions to make before turn 1, [low, high]."
        },
        "until": {
          "type": "object",
          "description": "Only for a turn taken with until \"auto\": the end date (`date`, midnight UTC; `last_day` the day before), `chosen_by` (planner, or cadence when the planner kept the suggestion) and `reason` (one line).",
          "properties": {
            "date": {
              "type": "string"
            },
            "last_day": {
              "type": "string"
            },
            "chosen_by": {
              "type": "string",
              "enum": [
                "planner",
                "cadence"
              ]
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "date",
            "chosen_by",
            "reason"
          ]
        },
        "past_end": {
          "type": "boolean",
          "description": "A completed turn: whether the clock is past the run's planned end."
        },
        "wrapup": {
          "$ref": "#/$defs/sandbox_wrapup",
          "description": "Server-planned runs: the wrap-up, made when this turn reached the planned end."
        },
        "wrapup_due": {
          "type": "boolean",
          "description": "Client-planned runs: the planned end is reached and there is no wrap-up yet (POST .../wrapup)."
        }
      },
      "required": [
        "run_id"
      ]
    },
    "timeline_future": {
      "type": "object",
      "description": "A wargame as its player sees it.",
      "properties": {
        "run_id": {
          "type": "number"
        },
        "kind": {
          "const": "future"
        },
        "template": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string"
            },
            "title": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "title"
          ]
        },
        "status": {
          "type": "string"
        },
        "clock": {
          "type": "string"
        },
        "forked_from_run_id": {
          "type": [
            "number",
            "null"
          ]
        },
        "settings": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "The scenario's title: the run's own, else its template's."
            },
            "premise": {
              "type": [
                "string",
                "null"
              ],
              "description": "The scenario's premise: the run's own (a scenario of the player's, or an edit), else its template's."
            },
            "bio": {
              "type": [
                "string",
                "null"
              ]
            },
            "modifications": {
              "type": [
                "string",
                "null"
              ]
            },
            "pace": {
              "type": "string",
              "description": "auto (the default: each turn's length is chosen when it is taken) or a fixed default length: days, week, month or quarter."
            },
            "complete": {
              "type": "boolean"
            },
            "starts_on": {
              "type": "string",
              "description": "The run's first date (YYYY-MM-DD)."
            },
            "start_auto": {
              "type": "boolean",
              "description": "The start date is still to be inferred from the premise (with the opening questions); until then it reads as today."
            },
            "start_open": {
              "type": "boolean",
              "description": "The start date can still change (`starts_on` in the setup); fixed once the first turn starts."
            },
            "duty_rates": {
              "type": "object",
              "description": "The run's duty rates (defaults with its overrides)."
            },
            "scout": {
              "type": "boolean"
            },
            "planner": {
              "type": "string",
              "enum": [
                "server",
                "client"
              ]
            },
            "mode": {
              "type": "string",
              "enum": [
                "mortal",
                "god"
              ]
            },
            "sample_from": {
              "type": "string",
              "enum": [
                "house",
                "user"
              ]
            },
            "setup_log": {
              "type": "array",
              "description": "Each edit of the premise or bio, oldest first, with the run's date (`at`) and turn count when it was made; sent to the planner so it knows what was true when.",
              "items": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string",
                    "enum": [
                      "premise",
                      "bio"
                    ]
                  },
                  "value": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "at": {
                    "type": "string"
                  },
                  "turn": {
                    "type": "number"
                  },
                  "edited_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "field",
                  "value",
                  "at",
                  "turn"
                ]
              }
            },
            "ends_on": {
              "type": [
                "string",
                "null"
              ],
              "description": "The date the game is planned to end (YYYY-MM-DD), or null."
            }
          },
          "required": [
            "bio",
            "modifications",
            "pace",
            "complete"
          ]
        },
        "turns": {
          "type": "number"
        },
        "history": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/timeline_turn"
          }
        },
        "questions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "market_code": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "market_type": {
                "type": "string"
              },
              "simulation_only": {
                "type": "boolean"
              },
              "bars": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolved": {
                      "type": "boolean"
                    },
                    "resolved_yes": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "key",
                    "resolved"
                  ]
                }
              }
            },
            "required": [
              "market_code",
              "title",
              "simulation_only",
              "bars"
            ]
          }
        },
        "url": {
          "type": "string"
        },
        "corrections": {
          "type": "array",
          "description": "Facts about the player's real situation, established in the run (sent to the planner each turn).",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "at": {
                "type": "string"
              }
            },
            "required": [
              "text",
              "at"
            ]
          }
        },
        "struck_observations": {
          "type": "array",
          "description": "Observations struck from the history (kept for audit, left out of the history and the planner's input).",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "at": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "reason",
              "at"
            ]
          }
        },
        "briefing": {
          "type": [
            "string",
            "null"
          ],
          "description": "The opening briefing at T+0, written when the setup is complete (again if the bio or modifications change before the first turn)."
        },
        "info_log": {
          "type": "array",
          "description": "Info answers so far, with the clock they were asked at.",
          "items": {
            "type": "object",
            "properties": {
              "at": {
                "type": "string"
              },
              "questions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "answer": {
                "type": "string"
              }
            },
            "required": [
              "at",
              "questions",
              "answer"
            ]
          }
        },
        "player_questions": {
          "type": "array",
          "description": "Questions put to the player: status open (awaiting an answer, a feed entry with `answers`), answered or lapsed (unanswered for three turns).",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "question": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "assumption": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "open",
                  "answered",
                  "lapsed"
                ]
              },
              "answer": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        },
        "score": {
          "type": "object",
          "description": "The run's goals and their points: Antistatic's regular market points on the player's run positions, counted from when each goal was priced. scored is false in a god run, where nothing accrues; frozen is the score frozen at the latest switch to god, included in the totals.",
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "mortal",
                "god"
              ]
            },
            "scored": {
              "type": "boolean"
            },
            "goals": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "liquidity": {
                    "type": "number"
                  },
                  "turn": {
                    "type": "number",
                    "description": "The turn count when it was set."
                  },
                  "priced_at": {
                    "type": "string"
                  },
                  "bars": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bar": {
                          "type": "string"
                        },
                        "label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "item": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "end_date": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "p0": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "The house p when the goal was priced (a bar added since: its first house p)."
                        },
                        "p": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "The house p now."
                        },
                        "forecast": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "The player's forecast on the bar."
                        },
                        "resolved": {
                          "type": "boolean"
                        },
                        "resolved_yes": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "realised": {
                          "type": "number"
                        },
                        "unrealised": {
                          "type": "number",
                          "description": "The position's expected points at the house p now (open bars)."
                        }
                      },
                      "required": [
                        "bar",
                        "p0",
                        "p",
                        "resolved",
                        "realised",
                        "unrealised"
                      ]
                    }
                  },
                  "realised": {
                    "type": "number"
                  },
                  "unrealised": {
                    "type": "number"
                  },
                  "total": {
                    "type": "number"
                  }
                },
                "required": [
                  "market",
                  "liquidity",
                  "bars",
                  "realised",
                  "unrealised",
                  "total"
                ]
              }
            },
            "total": {
              "type": "object",
              "properties": {
                "realised": {
                  "type": "number"
                },
                "unrealised": {
                  "type": "number"
                },
                "total": {
                  "type": "number"
                }
              },
              "required": [
                "realised",
                "unrealised",
                "total"
              ]
            },
            "frozen": {
              "type": [
                "object",
                "null"
              ],
              "description": "The score frozen at the run's latest switch from mortal to god (turn: turns taken then), included in the totals; null if it never turned god from mortal.",
              "properties": {
                "turn": {
                  "type": "number"
                },
                "realised": {
                  "type": "number"
                },
                "unrealised": {
                  "type": "number"
                },
                "total": {
                  "type": "number"
                }
              }
            }
          },
          "required": [
            "mode",
            "scored",
            "goals",
            "total"
          ]
        },
        "past_end": {
          "type": "boolean",
          "description": "The clock has reached ends_on; play carries on."
        },
        "wrapup": {
          "anyOf": [
            {
              "$ref": "#/$defs/sandbox_wrapup"
            },
            {
              "type": "null"
            }
          ]
        },
        "wrapup_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "earlier_wrapups": {
          "type": "number",
          "description": "Wrap-ups replaced by making it again (kept on the run)."
        },
        "turn_status": {
          "$ref": "#/$defs/turn_status"
        }
      },
      "required": [
        "run_id",
        "kind",
        "template",
        "status",
        "clock",
        "settings",
        "turns",
        "history",
        "questions",
        "url"
      ]
    },
    "sandbox_wrapup": {
      "type": "object",
      "description": "A wargame's wrap-up: `period` (from, to, ends_on, past_end, turns), `arc` (prose by the run's planner model, or the player's own planner in client mode), `resolutions` (what resolved, with dates), `turning_points` (the planner's adjustments to rolls, largest first: turn, market, item, factor, action, basis, result), `score` (goals and total; null in a god run), `forecasts` (resolved bars the player forecast: counts, mean Brier against the house's opening line, best and worst), `written_by` (server or client), `model` and `generated_at`.",
      "properties": {
        "period": {
          "type": "object",
          "properties": {
            "from": {
              "type": [
                "string",
                "null"
              ]
            },
            "to": {
              "type": "string"
            },
            "ends_on": {
              "type": [
                "string",
                "null"
              ]
            },
            "past_end": {
              "type": "boolean"
            },
            "turns": {
              "type": "number"
            }
          },
          "required": [
            "to",
            "turns"
          ]
        },
        "arc": {
          "type": "string"
        },
        "resolutions": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "turning_points": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "score": {
          "type": [
            "object",
            "null"
          ]
        },
        "forecasts": {
          "type": "object"
        },
        "written_by": {
          "type": "string",
          "enum": [
            "server",
            "client"
          ]
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "generated_at": {
          "type": "string"
        }
      },
      "required": [
        "period",
        "arc",
        "resolutions",
        "turning_points",
        "forecasts",
        "written_by",
        "generated_at"
      ]
    },
    "turn_status": {
      "type": "object",
      "description": "Where a wargame's next turn stands for the caller (its host or a guest). `version` changes whenever anything else here does: pass it as `since` to wait for the next change.",
      "properties": {
        "run_id": {
          "type": "number"
        },
        "turn": {
          "type": "number",
          "description": "The next turn's number."
        },
        "clock": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "host",
            "guest"
          ]
        },
        "multiplayer": {
          "type": "boolean"
        },
        "busy": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "planning",
            "questions",
            null
          ],
          "description": "A turn in flight: being planned, or stopped for the planner's questions to the host."
        },
        "planner": {
          "type": "string",
          "enum": [
            "server",
            "client"
          ],
          "description": "Who plans the turns: server (Antistatic's model) or client (the user's agent, through planner jobs; the website can't take its turns)."
        },
        "length": {
          "type": "object",
          "description": "The next turn's length. state: unset (the planner picks unless the host sets one), proposed (the host may still change it) or locked.",
          "properties": {
            "until": {
              "type": [
                "string",
                "null"
              ]
            },
            "label": {
              "type": "string"
            },
            "span": {
              "type": [
                "string",
                "null"
              ]
            },
            "state": {
              "type": "string",
              "enum": [
                "unset",
                "proposed",
                "locked"
              ]
            }
          },
          "required": [
            "until",
            "label",
            "span",
            "state"
          ]
        },
        "last_length": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "span": {
                  "type": "string"
                }
              },
              "required": [
                "from",
                "to",
                "span"
              ]
            }
          ]
        },
        "players": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "host",
                  "guest",
                  "invitee",
                  "open",
                  "ai"
                ],
                "description": "Who controls the character: the host, a guest (a player), or nobody yet (invitee: kept for one person; open) or the planner (ai)."
              },
              "status": {
                "type": "string",
                "enum": [
                  "host",
                  "drafting",
                  "submitted",
                  "invitee",
                  "open",
                  "ai"
                ],
                "description": "host: the host's orders go with the turn; a guest is drafting until they submit; invitee and open characters hold; ai ones are the planner's."
              },
              "orders": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "How many orders; null for another guest's (only the host, the umpire, sees every player's)."
              },
              "submitted_for": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The turn length the orders were submitted under: \"auto\" or the end date."
              },
              "submitted_for_label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "stale": {
                "type": "boolean",
                "description": "Submitted under a length that isn't the length now (they stand: the player submits regardless)."
              },
              "reopened": {
                "type": "boolean",
                "description": "Submitted, then sent back to draft when the host changed the length."
              },
              "you": {
                "type": "boolean"
              },
              "yours": {
                "type": "boolean",
                "description": "A character the caller controls."
              }
            },
            "required": [
              "key",
              "name",
              "role",
              "status",
              "orders",
              "submitted_for",
              "stale",
              "reopened",
              "you"
            ]
          }
        },
        "submitted": {
          "type": "number",
          "description": "Guests whose orders are in for the length now."
        },
        "expected": {
          "type": "number",
          "description": "Guests in the game."
        },
        "can_run": {
          "type": "boolean",
          "description": "The caller is the host and no turn is in flight."
        },
        "waiting_on": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Guests who haven't submitted (they hold if the host runs the turn)."
        },
        "open_questions": {
          "type": "array",
          "description": "The planner's questions to the host (empty for a guest).",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "question": {
                "type": "string"
              },
              "assumption": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "question"
            ]
          }
        },
        "next": {
          "type": "object",
          "description": "What the caller does next. action: wait, answer, run, draft, submit or resubmit.",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "wait",
                "answer",
                "run",
                "draft",
                "submit",
                "resubmit"
              ]
            },
            "text": {
              "type": "string"
            }
          },
          "required": [
            "action",
            "text"
          ]
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "run_id",
        "turn",
        "clock",
        "role",
        "multiplayer",
        "busy",
        "length",
        "last_length",
        "players",
        "submitted",
        "expected",
        "can_run",
        "waiting_on",
        "open_questions",
        "next",
        "version"
      ]
    }
  },
  "routes": [
    {
      "id": "market.index",
      "method": "GET",
      "path": "/api/v1/markets",
      "summary": "Markets you can see, with search.",
      "group": "markets",
      "description": "Markets you can see: public ones, plus with a token your private markets and those shared with you. `q` searches open markets (`include_closed=true` widens it); `open=true` lists open markets; `unforecasted=true` (signed in, not with `q`) lists open markets you haven't forecast on. Pages with `limit`/`offset`; `paging` says whether there are more.",
      "auth": "optional",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "include_closed": {
            "type": "string"
          },
          "open": {
            "type": "string"
          },
          "unforecasted": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          },
          "offset": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "budget": {
                    "type": "number"
                  },
                  "code": {
                    "type": "string"
                  },
                  "cumulative": {
                    "type": "boolean"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "id": {
                    "type": "number"
                  },
                  "inserted_at": {
                    "type": "string"
                  },
                  "local_code": {
                    "type": "string"
                  },
                  "reference": {
                    "type": "string"
                  },
                  "resolution_criteria": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "visibility": {
                    "type": "string"
                  },
                  "x_unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "budget",
                  "code",
                  "cumulative",
                  "end_date",
                  "id",
                  "inserted_at",
                  "local_code",
                  "reference",
                  "resolution_criteria",
                  "status",
                  "title",
                  "type",
                  "visibility",
                  "x_unit"
                ]
              }
            },
            "paging": {
              "type": "object",
              "properties": {
                "has_more": {
                  "type": "boolean"
                },
                "limit": {
                  "type": "number"
                },
                "next_offset": {
                  "type": "null"
                },
                "offset": {
                  "type": "number"
                }
              },
              "required": [
                "has_more",
                "limit",
                "next_offset",
                "offset"
              ]
            }
          },
          "required": [
            "data",
            "paging"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "limit": "1",
            "open": "true"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "budget": 100.0,
                "code": "test-api",
                "cumulative": true,
                "end_date": "2027-10-10T19:18:00Z",
                "id": 5129,
                "inserted_at": "2026-10-10T19:18:00Z",
                "local_code": "test-api",
                "reference": "test-api",
                "resolution_criteria": "Test criteria",
                "status": "open",
                "title": "Test Market",
                "type": "count",
                "visibility": "public",
                "x_unit": "units"
              }
            ],
            "paging": {
              "has_more": false,
              "limit": 1,
              "next_offset": null,
              "offset": 0
            }
          }
        }
      }
    },
    {
      "id": "market_spec.recipe",
      "method": "GET",
      "path": "/api/v1/market-recipe",
      "summary": "The market recipe: settings, rules and examples for writing a market spec.",
      "group": "making markets",
      "auth": "none",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "curves": {
                  "type": "object",
                  "properties": {
                    "meaning": {
                      "type": "string"
                    },
                    "single_curve_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "meaning",
                    "single_curve_id"
                  ]
                },
                "examples": {
                  "type": "object",
                  "properties": {
                    "how_much": {
                      "type": "object",
                      "properties": {
                        "anchors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period": {
                                "type": "string"
                              },
                              "quantiles": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "number"
                                }
                              }
                            },
                            "required": [
                              "period",
                              "quantiles"
                            ]
                          }
                        },
                        "basis": {
                          "type": "object",
                          "properties": {
                            "reference_classes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "description": {
                                    "type": "string"
                                  },
                                  "evidence": {
                                    "type": "string"
                                  },
                                  "sources": {
                                    "type": "array"
                                  }
                                },
                                "required": [
                                  "description",
                                  "evidence",
                                  "sources"
                                ]
                              }
                            }
                          },
                          "required": [
                            "reference_classes"
                          ]
                        },
                        "periods": {
                          "type": "object",
                          "properties": {
                            "cadence": {
                              "type": "string"
                            },
                            "from": {
                              "type": "string"
                            },
                            "to": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "cadence",
                            "from",
                            "to"
                          ]
                        },
                        "question": {
                          "type": "string"
                        },
                        "resolution": {
                          "type": "object",
                          "properties": {
                            "details": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "details",
                            "source"
                          ]
                        },
                        "thresholds": {
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": "number"
                            },
                            "scale": {
                              "type": "string"
                            },
                            "to": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "from",
                            "scale",
                            "to"
                          ]
                        },
                        "title": {
                          "type": "string"
                        },
                        "unit": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "anchors",
                        "basis",
                        "periods",
                        "question",
                        "resolution",
                        "thresholds",
                        "title",
                        "unit"
                      ]
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "anchors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "by": {
                                "type": "string"
                              },
                              "p": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "by",
                              "p"
                            ]
                          }
                        },
                        "basis": {
                          "type": "object",
                          "properties": {
                            "reference_classes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "description": {
                                    "type": "string"
                                  },
                                  "evidence": {
                                    "type": "string"
                                  },
                                  "k": {
                                    "type": "number"
                                  },
                                  "n": {
                                    "type": "number"
                                  },
                                  "period": {
                                    "type": "string"
                                  },
                                  "sources": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "title": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "title",
                                        "url"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "description",
                                  "evidence",
                                  "k",
                                  "n",
                                  "period",
                                  "sources"
                                ]
                              }
                            }
                          },
                          "required": [
                            "reference_classes"
                          ]
                        },
                        "horizon": {
                          "type": "object",
                          "properties": {
                            "end": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "end"
                          ]
                        },
                        "question": {
                          "type": "string"
                        },
                        "resolution": {
                          "type": "object",
                          "properties": {
                            "details": {
                              "type": "string"
                            },
                            "excludes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "includes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "source": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "details",
                            "excludes",
                            "includes",
                            "source"
                          ]
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "anchors",
                        "basis",
                        "horizon",
                        "question",
                        "resolution",
                        "title"
                      ]
                    }
                  },
                  "required": [
                    "how_much",
                    "when"
                  ]
                },
                "flow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "limits": {
                  "type": "object",
                  "properties": {
                    "bars_per_curve": {
                      "type": "object",
                      "properties": {
                        "max": {
                          "type": "number"
                        },
                        "max_when": {
                          "type": "number"
                        },
                        "min": {
                          "type": "number"
                        },
                        "min_when": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "max",
                        "max_when",
                        "min",
                        "min_when"
                      ]
                    },
                    "budget": {
                      "type": "object",
                      "properties": {
                        "default": {
                          "type": "number"
                        },
                        "max": {
                          "type": "number"
                        },
                        "min": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "default",
                        "max",
                        "min"
                      ]
                    },
                    "probability": {
                      "type": "object",
                      "properties": {
                        "max": {
                          "type": "number"
                        },
                        "min": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "max",
                        "min"
                      ]
                    },
                    "tabs": {
                      "type": "object",
                      "properties": {
                        "recommended_max": {
                          "type": "number"
                        },
                        "strong_warning_above": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "recommended_max",
                        "strong_warning_above"
                      ]
                    }
                  },
                  "required": [
                    "bars_per_curve",
                    "budget",
                    "probability",
                    "tabs"
                  ]
                },
                "questions": {
                  "type": "object",
                  "properties": {
                    "how_much": {
                      "type": "object",
                      "properties": {
                        "meaning": {
                          "type": "string"
                        },
                        "settings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "default": {
                                "type": [
                                  "string",
                                  "number",
                                  "null"
                                ]
                              },
                              "example": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "required": {
                                "type": "boolean"
                              },
                              "setting": {
                                "type": "string"
                              },
                              "values": {
                                "type": [
                                  "object",
                                  "array",
                                  "null"
                                ],
                                "properties": {
                                  "max": {
                                    "type": "number"
                                  },
                                  "min": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "max",
                                  "min"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              },
                              "why": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "default",
                              "example",
                              "required",
                              "setting",
                              "values",
                              "why"
                            ]
                          }
                        }
                      },
                      "required": [
                        "meaning",
                        "settings"
                      ]
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "meaning": {
                          "type": "string"
                        },
                        "settings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "default": {
                                "type": [
                                  "object",
                                  "string",
                                  "number",
                                  "null"
                                ],
                                "properties": {
                                  "end": {
                                    "type": "string"
                                  },
                                  "start": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "end",
                                  "start"
                                ]
                              },
                              "example": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "required": {
                                "type": "boolean"
                              },
                              "setting": {
                                "type": "string"
                              },
                              "values": {
                                "type": [
                                  "object",
                                  "array",
                                  "null"
                                ],
                                "properties": {
                                  "max": {
                                    "type": "number"
                                  },
                                  "min": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "max",
                                  "min"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              },
                              "why": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "default",
                              "example",
                              "required",
                              "setting",
                              "values",
                              "why"
                            ]
                          }
                        }
                      },
                      "required": [
                        "meaning",
                        "settings"
                      ]
                    }
                  },
                  "required": [
                    "how_much",
                    "when"
                  ]
                },
                "resolution_rules": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "starting_probabilities": {
                  "type": "object",
                  "properties": {
                    "basis_shape": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "judgement": {
                          "type": "string"
                        },
                        "method": {
                          "type": "string"
                        },
                        "notes": {
                          "type": "string"
                        },
                        "reference_classes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "cases": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "evidence": {
                                "type": "string"
                              },
                              "k": {
                                "type": "string"
                              },
                              "n": {
                                "type": "string"
                              },
                              "period": {
                                "type": "string"
                              },
                              "sources": {
                                "type": "array",
                                "items": {
                                  "type": [
                                    "object",
                                    "string"
                                  ],
                                  "properties": {
                                    "title": {
                                      "type": "string"
                                    },
                                    "url": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "title",
                                    "url"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "cases",
                              "description",
                              "evidence",
                              "k",
                              "n",
                              "period",
                              "sources"
                            ]
                          }
                        },
                        "weighting": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "judgement",
                        "method",
                        "notes",
                        "reference_classes",
                        "weighting"
                      ]
                    },
                    "guidance": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "method": {
                      "type": "string"
                    },
                    "principle": {
                      "type": "string"
                    },
                    "templates": {
                      "type": "object",
                      "properties": {
                        "how_much": {
                          "type": "string"
                        },
                        "when": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "how_much",
                        "when"
                      ]
                    },
                    "users_own_number": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "basis_shape",
                    "guidance",
                    "method",
                    "principle",
                    "templates",
                    "users_own_number"
                  ]
                },
                "summary": {
                  "type": "string"
                },
                "title_rules": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "yes_no_questions": {
                  "type": "string"
                }
              },
              "required": [
                "curves",
                "examples",
                "flow",
                "limits",
                "questions",
                "resolution_rules",
                "starting_probabilities",
                "summary",
                "title_rules",
                "yes_no_questions"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "curves": {
                "meaning": "Bars on one tab or event form a curve and must stay in order. Trades and edits that break that are refused with out_of_order; rest_of_curve: keep_in_order or interpolate fills in the rest.",
                "single_curve_id": "main"
              },
              "examples": {
                "how_much": {
                  "anchors": [
                    {
                      "period": "2026",
                      "quantiles": {
                        "10": 300,
                        "50": 330
                      }
                    },
                    {
                      "period": "2029",
                      "quantiles": {
                        "10": 350,
                        "50": 780
                      }
                    }
                  ],
                  "basis": {
                    "reference_classes": [
                      {
                        "description": "Annual revenue growth of large memory makers",
                        "evidence": "From the top five memory makers' annual reports, 1995-2025: revenue more than doubled within three years in about a third of upcycles, and fell by a third or more in most downcycles.",
                        "sources": []
                      }
                    ]
                  },
                  "periods": {
                    "cadence": "year",
                    "from": "2026",
                    "to": "2029"
                  },
                  "question": "how_much",
                  "resolution": {
                    "details": "Korean won, as first reported.",
                    "source": "SK Hynix's consolidated annual revenue in its annual report"
                  },
                  "thresholds": {
                    "from": 100,
                    "scale": "log",
                    "to": 2000
                  },
                  "title": "SK Hynix annual revenue",
                  "unit": "₩Xtn"
                },
                "when": {
                  "anchors": [
                    {
                      "by": "2030-12",
                      "p": 0.12
                    },
                    {
                      "by": "2036-12",
                      "p": 0.3
                    }
                  ],
                  "basis": {
                    "reference_classes": [
                      {
                        "description": "Militarised disputes escalating to the use of force",
                        "evidence": "Counted from the Correlates of War militarized interstate disputes data: 9 of 120 comparable disputes escalated, 1946-2020.",
                        "k": 9,
                        "n": 120,
                        "period": "1946-2020",
                        "sources": [
                          {
                            "title": "Correlates of War MID data",
                            "url": "https://correlatesofwar.org/data-sets/mids/"
                          }
                        ]
                      }
                    ]
                  },
                  "horizon": {
                    "end": "2036-12"
                  },
                  "question": "when",
                  "resolution": {
                    "details": "Major military action means a blockade, strikes on Taiwan's territory, or an amphibious landing.",
                    "excludes": [
                      "Military exercises",
                      "Cyber operations alone"
                    ],
                    "includes": [
                      "A naval blockade enforced for at least 7 days"
                    ],
                    "source": "Reported by at least two of AP, Reuters and AFP"
                  },
                  "title": "Date China takes major military action against Taiwan"
                }
              },
              "flow": [
                "Pick the question: when (the date something first happens) or how_much (the value of a quantity in one or more periods).",
                "Preview after each choice and follow next_options; settings that don't apply aren't offered."
              ],
              "limits": {
                "bars_per_curve": {
                  "max": 60,
                  "max_when": 130,
                  "min": 20,
                  "min_when": 6
                },
                "budget": {
                  "default": 300,
                  "max": 1000,
                  "min": 100
                },
                "probability": {
                  "max": 0.999,
                  "min": 0.001
                },
                "tabs": {
                  "recommended_max": 6,
                  "strong_warning_above": 12
                }
              },
              "questions": {
                "how_much": {
                  "meaning": "Each bar is the chance the value is at least its threshold in that period, so each curve falls from left to right. Each period is a tab and its own curve.",
                  "settings": [
                    {
                      "default": null,
                      "example": "\"₩Xtn\", \"$Xbn\", \"cases\"",
                      "required": true,
                      "setting": "unit",
                      "values": null,
                      "why": "The unit, with X marking where the number goes."
                    },
                    {
                      "default": "value_at_end",
                      "example": null,
                      "required": false,
                      "setting": "measure",
                      "values": [
                        "highest",
                        "lowest"
                      ],
                      "why": "What the number is within each period: its value at the end, the total over the period (it builds up and resets each period), or the highest or lowest seen."
                    }
                  ]
                },
                "when": {
                  "meaning": "Each bar is the chance the event has happened by its date, so a curve rises from left to right. One curve per event.",
                  "settings": [
                    {
                      "default": "one event",
                      "example": "[{\"key\": \"ai_rd_high\", \"label\": \"AI R&D: high\"}]",
                      "required": false,
                      "setting": "items",
                      "values": null,
                      "why": "Several related events in one market, each with its own curve and tab."
                    },
                    {
                      "default": "none",
                      "example": "{\"kind\": \"after_trigger\", \"trigger\": \"1,000 US troops deploy to Iran\", \"deadline\": \"2027-12-31\", \"window\": {\"months\": 24}, \"title_after\": \"Time for US forces to leave Iran\"}, with anchors like [{\"within\": 6, \"p\": 0.2}, {\"within\": 24, \"p\": 0.6}]",
                      "required": false,
                      "setting": "condition",
                      "values": [
                        "none",
                        "after_trigger"
                      ],
                      "why": "After a trigger: count time from an event that hasn't happened yet (\"months after 1,000 troops deploy\"). The market voids if the trigger doesn't happen by its deadline. Anchors then say how likely the event is within N periods of the trigger."
                    }
                  ]
                }
              },
              "resolution_rules": [
                "Date bars include events at their exact stored cutoff: event time is at or before threshold_date. Calendar bars close at 23:59:59 UTC. January 31 includes that day; it does not include February 1. Use words for dates and retain the exact cutoff in points scenarios.",
                "Name the source that settles it, and the counting unit."
              ],
              "starting_probabilities": {
                "basis_shape": {
                  "code": "optional: the analysis code, so others can rerun it",
                  "judgement": "optional: when there are too few cases for a table (a few precedents, or none), the rule-of-succession estimate and the precedents and period behind it",
                  "method": "optional: the model in plain words, opening \"The starting probabilities of this market were calculated by...\"",
                  "notes": "optional: other judgement calls",
                  "reference_classes": [
                    {
                      "cases": "optional: the case table, as rows of {case, start, end or outcome, note, url}; from a full list, including cases where it never happened; mark rows from memory",
                      "description": "Plain-language description of the class",
                      "evidence": "What it shows: a count, a rate or a benchmark, with its period, and whether it was counted from data or is a recollection or judgement",
                      "k": "optional: cases where it happened (integer), with n",
                      "n": "optional: comparable cases (integer)",
                      "period": "optional, e.g. 1990-2025",
                      "sources": [
                        {
                          "title": "...",
                          "url": "https://..."
                        },
                        "or plain text, such as a newsletter's name, when there's no link"
                      ]
                    }
                  ],
                  "weighting": "optional: how the classes were weighed against each other, and overlap handled"
                },
                "guidance": [
                  "Research the reference class carefully: what comparable things are, and how often they have happened. Look broad first (how often this kind of thing happens at all), then narrower (similar actors and situations), then close analogues.",
                  "Evidence can take whatever form the question allows. A count of cases out of comparable ones (\"9 of 120 militarised disputes escalated, 1946-2020\") is one way; a rate per month or year, a growth benchmark, a survival curve or a forecaster consensus are others. A reference class can be construed broa…"
                ],
                "method": "When there is a real case table, treat the starting probabilities as a small analysis, done in code (Python with numpy is enough): gather the evidence into tables, decompose it into levels, fit, and print the anchors. 1) Levels, broad to specific: how often this kind of thing happens at all; a narro…",
                "principle": "Starting probabilities come from base rates, not opinion: how often comparable things have happened.",
                "templates": {
                  "how_much": "# Spread from the history of the series: past changes, widening with the horizon.\nimport json\nimport numpy as np\nfrom statistics import NormalDist\nhistory = {2021: 1558, 2022: 1711, 2023: 1645, 2024: 1602, 2025: 1538}  # official figures\nyears = sorted(history)\nv = np.array([history[y] for y in year…",
                  "when": "# Hazard from cases: every comparable case, including ones where it never happened (end=None).\nimport json\nimport numpy as np\nfrom datetime import date\nTODAY = date.today()\ncases = [  # (case, start of exposure, date it happened or None)\n    (\"Iraq -> Kuwait\", date(1988, 1, 1), date(1990, 8, 2)),\n  …"
                },
                "users_own_number": "A number the user gives (\"I reckon 60%\") is their forecast, not a base rate. Set the starting curve from base rates, tell the user how their number compares, and offer to submit their forecast once the market exists."
              },
              "summary": "Describe a market as a spec; the server builds the bars, fits the starting curve and checks these rules. POST /api/v1/market-specs/preview with a partial spec to see the derived market, any issues (errors carry a fix) and next_options, the settings that apply to what you've chosen. POST /api/v1/mark…",
              "title_rules": [
                "A noun phrase, not a question: no question mark, and not starting with Will/When/How/What.",
                "No years, quarters or month phrases; dates belong on the bars."
              ],
              "yes_no_questions": "Markets don't take plain yes/no questions. \"Will X happen before Y?\" becomes a when market for the date X first happens, with a bar at Y; tell the user which bar answers their question. \"Will X exceed N?\" becomes a how_much market with a threshold at N. \"Who wins?\" settles on one known day, so ask a…"
            }
          }
        }
      }
    },
    {
      "id": "market_spec.preview",
      "method": "POST",
      "path": "/api/v1/market-specs/preview",
      "summary": "Check a market spec without creating anything: issues with fixes, and next options.",
      "group": "making markets",
      "auth": "optional",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    },
                    "period": {
                      "type": "string"
                    },
                    "quantiles": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number"
                      }
                    }
                  }
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "title",
                              "url"
                            ]
                          }
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "cadence": {
                    "type": "string"
                  },
                  "end": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "excludes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "includes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              },
              "periods": {
                "type": "object",
                "properties": {
                  "cadence": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "cadence",
                  "from",
                  "to"
                ]
              },
              "thresholds": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "number"
                  },
                  "scale": {
                    "type": "string"
                  },
                  "to": {
                    "type": "number"
                  }
                },
                "required": [
                  "from",
                  "scale",
                  "to"
                ]
              },
              "unit": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "question",
              "resolution",
              "title"
            ]
          },
          "question": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "spec"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "curves": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "bars": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "starting_probability": {
                              "type": "number"
                            },
                            "threshold_date": {
                              "type": "string"
                            },
                            "threshold": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "label",
                            "starting_probability"
                          ]
                        }
                      },
                      "curve": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "item": {
                        "type": "string"
                      },
                      "ladder": {
                        "type": "number"
                      },
                      "period": {
                        "type": "string"
                      },
                      "trimmed": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    },
                    "required": [
                      "bars",
                      "curve",
                      "label"
                    ]
                  }
                },
                "issues": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "example": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "field": {
                        "type": "string"
                      },
                      "fix": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "message": {
                        "type": "string"
                      },
                      "severity": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "example",
                      "field",
                      "fix",
                      "message",
                      "severity"
                    ]
                  }
                },
                "market": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "background_info_html": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "budget": {
                      "type": "number"
                    },
                    "cumulative": {
                      "type": "boolean"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "resolution_criteria": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "svelte_params": {
                      "type": "object",
                      "properties": {
                        "countObservationMode": {
                          "type": "string"
                        },
                        "defaultView": {
                          "type": "string"
                        },
                        "scaleBase": {
                          "type": "number"
                        },
                        "scaleType": {
                          "type": "string"
                        },
                        "timeCadence": {
                          "type": "string"
                        }
                      }
                    },
                    "title": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "visibility": {
                      "type": "string"
                    },
                    "x_unit": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "background_info_html",
                    "budget",
                    "cumulative",
                    "end_date",
                    "resolution_criteria",
                    "status",
                    "svelte_params",
                    "title",
                    "type",
                    "visibility",
                    "x_unit"
                  ]
                },
                "next_options": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "default": {
                        "type": [
                          "object",
                          "string",
                          "number",
                          "null"
                        ],
                        "properties": {
                          "end": {
                            "type": "string"
                          },
                          "start": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "end",
                          "start"
                        ]
                      },
                      "example": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "set": {
                        "type": "boolean"
                      },
                      "setting": {
                        "type": "string"
                      },
                      "values": {
                        "type": [
                          "object",
                          "array",
                          "null"
                        ],
                        "properties": {
                          "max": {
                            "type": "number"
                          },
                          "min": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "max",
                          "min"
                        ],
                        "items": {
                          "type": "string"
                        }
                      },
                      "why": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "default",
                      "example",
                      "required",
                      "set",
                      "setting",
                      "values",
                      "why"
                    ]
                  }
                },
                "valid": {
                  "type": "boolean"
                }
              },
              "required": [
                "curves",
                "issues",
                "market",
                "next_options",
                "valid"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "curves": [],
              "issues": [
                {
                  "example": "\"question\": \"when\" or \"question\": \"how_much\"",
                  "field": "question",
                  "fix": null,
                  "message": "Say whether it asks when something happens or how much of something there is.",
                  "severity": "error"
                },
                {
                  "example": null,
                  "field": "title",
                  "fix": null,
                  "message": "Give the market a title.",
                  "severity": "error"
                }
              ],
              "market": null,
              "next_options": [
                {
                  "default": null,
                  "example": null,
                  "required": true,
                  "set": false,
                  "setting": "question",
                  "values": [
                    "when",
                    "how_much"
                  ],
                  "why": "When: the date something first happens. How much: the value of a quantity in one or more periods."
                },
                {
                  "default": null,
                  "example": null,
                  "required": true,
                  "set": false,
                  "setting": "title",
                  "values": null,
                  "why": "A noun phrase without a question mark or years, e.g. \"Date China takes major military action against Taiwan\"."
                }
              ],
              "valid": false
            }
          }
        }
      }
    },
    {
      "id": "market.show",
      "method": "GET",
      "path": "/api/v1/markets/{code}",
      "summary": "One market's details.",
      "group": "markets",
      "description": "`fuzzy=true` resolves a near-miss code. With `X-Antistatic-Run`, the market as it stands in your sandbox run.",
      "auth": "optional",
      "headers": [
        "x-antistatic-run"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "fuzzy": {
            "type": "string"
          },
          "run_id": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "background_info_html": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "budget": {
                  "type": "number"
                },
                "code": {
                  "type": "string"
                },
                "cumulative": {
                  "type": "boolean"
                },
                "end_date": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "inserted_at": {
                  "type": "string"
                },
                "local_code": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "resolution_criteria": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "visibility": {
                  "type": "string"
                },
                "x_unit": {
                  "type": "string"
                }
              },
              "required": [
                "background_info_html",
                "budget",
                "code",
                "cumulative",
                "end_date",
                "id",
                "inserted_at",
                "local_code",
                "reference",
                "resolution_criteria",
                "status",
                "title",
                "type",
                "visibility",
                "x_unit"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "background_info_html": null,
              "budget": 100.0,
              "code": "~5229",
              "cumulative": true,
              "end_date": "2027-10-10T19:18:09Z",
              "id": 5229,
              "inserted_at": "2026-10-10T19:18:09Z",
              "local_code": "share-19559",
              "reference": "~5229",
              "resolution_criteria": "Criteria",
              "status": "open",
              "title": "Shared market",
              "type": "count",
              "visibility": "private",
              "x_unit": "units"
            }
          }
        }
      }
    },
    {
      "id": "market.submarkets",
      "method": "GET",
      "path": "/api/v1/markets/{code}/submarkets",
      "summary": "A market's bars (submarkets) with liquidity, resolution state and curve summaries.",
      "group": "markets",
      "auth": "optional",
      "headers": [
        "x-antistatic-run"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "run_id": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "curves": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "curve": {
                    "type": "string"
                  },
                  "not_by": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "resolved_at": {
                        "type": "string"
                      },
                      "submarket": {
                        "type": "string"
                      },
                      "threshold_date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "label",
                      "resolved_at",
                      "submarket",
                      "threshold_date"
                    ]
                  },
                  "outcome": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "projection_group": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "resolved_on": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "resolved_at": {
                        "type": "string"
                      },
                      "submarket": {
                        "type": "string"
                      },
                      "threshold_date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "label",
                      "resolved_at",
                      "submarket",
                      "threshold_date"
                    ]
                  },
                  "resolved_submarkets": {
                    "type": "number"
                  },
                  "status": {
                    "type": "string"
                  },
                  "submarkets": {
                    "type": "number"
                  },
                  "at_least": {
                    "type": "null"
                  },
                  "below": {
                    "type": "null"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "resolved_value": {
                    "type": "null"
                  }
                },
                "required": [
                  "curve",
                  "outcome",
                  "projection_group",
                  "resolved_submarkets",
                  "status",
                  "submarkets"
                ]
              }
            },
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "budget_allocation": {
                    "type": "number"
                  },
                  "curve": {
                    "type": "string"
                  },
                  "effective_b": {
                    "type": "number"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "id": {
                    "type": "number"
                  },
                  "initial_probability": {
                    "type": "number"
                  },
                  "label": {
                    "type": "string"
                  },
                  "projection_group": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string"
                  },
                  "submarket": {
                    "type": "string"
                  },
                  "threshold_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "threshold_decimal": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "resolved_at": {
                    "type": "string"
                  },
                  "resolved_yes": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "budget_allocation",
                  "curve",
                  "effective_b",
                  "end_date",
                  "id",
                  "initial_probability",
                  "label",
                  "projection_group",
                  "status",
                  "submarket",
                  "threshold_date",
                  "threshold_decimal"
                ]
              }
            }
          },
          "required": [
            "curves",
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "curves": [
              {
                "at_least": null,
                "below": null,
                "curve": "group1 2027-10-10",
                "end_date": "2027-10-10T19:18:12Z",
                "outcome": null,
                "projection_group": "group1",
                "resolved_submarkets": 0,
                "resolved_value": null,
                "status": "open",
                "submarkets": 1
              }
            ],
            "data": [
              {
                "budget_allocation": 50.0,
                "curve": "group1 2027-10-10",
                "effective_b": 50.0,
                "end_date": "2027-10-10T19:18:12Z",
                "id": 37516,
                "initial_probability": 0.5,
                "label": "Test submarket",
                "projection_group": "group1",
                "status": "open",
                "submarket": "sm_37516",
                "threshold_date": null,
                "threshold_decimal": 100.0
              }
            ]
          }
        }
      }
    },
    {
      "id": "market.forecast",
      "method": "GET",
      "path": "/api/v1/markets/{code}/forecast",
      "summary": "A market's bars grouped by curve, with the house line, the crowd and your forecast.",
      "group": "markets",
      "description": "- `starting_probability` is the house line forecasts are priced against: quote it as the market's number. `community_probability` is the crowd (`contributors` users). `my_probability` is your own forecast, or null (only with a `read` token).\n- `status` is `open`, `closed` or `resolved`. A count period past its end that isn't resolved stays `open` and takes forecasts with nothing at stake. Resolved rows carry `resolved_yes` and `resolved_at`; don't quote them as live odds.\n- `curve` names the curve a bar belongs to; match it against `curves[].curve`, whose `outcome` describes what has resolved.\n- Filter with `year`/`group`/`curve`, read one bar with `for` (`for=2026`, `for=jun 2026`, `for=1000`), and `limit=0` returns every row of a large market. Large markets default to `response_mode: \"summary_index\"`, whose `groups` summarise each curve; `mode=full` returns rows.\n- With `X-Antistatic-Run`, the market as it stands in your sandbox run.",
      "auth": "optional",
      "headers": [
        "x-antistatic-run",
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string"
          },
          "include": {
            "type": "string"
          },
          "year": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "curve": {
            "type": "string"
          },
          "for": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          },
          "offset": {
            "type": "string"
          },
          "run_id": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "chart_color": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "code": {
                  "type": "string"
                },
                "curves": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "at_least": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "resolved_at": {
                            "type": "string"
                          },
                          "submarket": {
                            "type": "string"
                          },
                          "threshold": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "label",
                          "resolved_at",
                          "submarket",
                          "threshold"
                        ]
                      },
                      "below": {
                        "type": "null"
                      },
                      "curve": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "outcome": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "projection_group": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "resolved_submarkets": {
                        "type": "number"
                      },
                      "resolved_value": {
                        "type": "null"
                      },
                      "status": {
                        "type": "string"
                      },
                      "submarkets": {
                        "type": "number"
                      },
                      "not_by": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "resolved_at": {
                            "type": "string"
                          },
                          "submarket": {
                            "type": "string"
                          },
                          "threshold_date": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "label",
                          "resolved_at",
                          "submarket",
                          "threshold_date"
                        ]
                      },
                      "resolved_on": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "resolved_at": {
                            "type": "string"
                          },
                          "submarket": {
                            "type": "string"
                          },
                          "threshold_date": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "label",
                          "resolved_at",
                          "submarket",
                          "threshold_date"
                        ]
                      }
                    },
                    "required": [
                      "curve",
                      "outcome",
                      "projection_group",
                      "resolved_submarkets",
                      "status",
                      "submarkets"
                    ]
                  }
                },
                "forecast": {
                  "type": [
                    "object",
                    "array"
                  ],
                  "additionalProperties": {
                    "type": [
                      "array",
                      "string",
                      "number",
                      "boolean",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "b0": {
                          "type": "number"
                        },
                        "community_probability": {
                          "type": "number"
                        },
                        "contributors": {
                          "type": "number"
                        },
                        "current_b": {
                          "type": "number"
                        },
                        "curve": {
                          "type": "string"
                        },
                        "effective_b": {
                          "type": "number"
                        },
                        "group": {
                          "type": "string"
                        },
                        "group_label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "id": {
                          "type": "number"
                        },
                        "label": {
                          "type": "string"
                        },
                        "liquidity_multiplier": {
                          "type": "number"
                        },
                        "pct_remaining": {
                          "type": "number"
                        },
                        "projection_group": {
                          "type": "string"
                        },
                        "starting_probability": {
                          "type": "number"
                        },
                        "status": {
                          "type": "string"
                        },
                        "submarket": {
                          "type": "string"
                        },
                        "resolved_at": {
                          "type": "string"
                        },
                        "resolved_yes": {
                          "type": "boolean"
                        },
                        "my_probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "threshold": {
                          "type": "number"
                        },
                        "chart_starting_probability": {
                          "type": "number"
                        },
                        "end_date": {
                          "type": "string"
                        },
                        "threshold_date": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "community_probability",
                        "contributors",
                        "curve",
                        "group",
                        "group_label",
                        "id",
                        "label",
                        "projection_group",
                        "starting_probability",
                        "status",
                        "submarket"
                      ]
                    }
                  },
                  "items": {
                    "type": "object",
                    "additionalProperties": {
                      "type": [
                        "string",
                        "number",
                        "null"
                      ]
                    }
                  }
                },
                "forecast_by_group": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "b0": {
                          "type": "number"
                        },
                        "community_probability": {
                          "type": "number"
                        },
                        "contributors": {
                          "type": "number"
                        },
                        "current_b": {
                          "type": "number"
                        },
                        "curve": {
                          "type": "string"
                        },
                        "effective_b": {
                          "type": "number"
                        },
                        "group": {
                          "type": "string"
                        },
                        "group_label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "id": {
                          "type": "number"
                        },
                        "label": {
                          "type": "string"
                        },
                        "liquidity_multiplier": {
                          "type": "number"
                        },
                        "pct_remaining": {
                          "type": "number"
                        },
                        "projection_group": {
                          "type": "string"
                        },
                        "starting_probability": {
                          "type": "number"
                        },
                        "status": {
                          "type": "string"
                        },
                        "submarket": {
                          "type": "string"
                        },
                        "resolved_at": {
                          "type": "string"
                        },
                        "resolved_yes": {
                          "type": "boolean"
                        },
                        "my_probability": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "threshold": {
                          "type": "number"
                        },
                        "chart_starting_probability": {
                          "type": "number"
                        },
                        "end_date": {
                          "type": "string"
                        },
                        "threshold_date": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "community_probability",
                        "contributors",
                        "curve",
                        "group",
                        "group_label",
                        "id",
                        "label",
                        "projection_group",
                        "starting_probability",
                        "status",
                        "submarket"
                      ]
                    }
                  }
                },
                "group_scope": {
                  "type": "string"
                },
                "liquidity_by_category": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": {
                      "type": [
                        "string",
                        "number",
                        "null"
                      ]
                    }
                  }
                },
                "local_code": {
                  "type": "string"
                },
                "prob_direction": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "response_mode": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "submarkets": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "b0": {
                        "type": "number"
                      },
                      "community_probability": {
                        "type": "number"
                      },
                      "contributors": {
                        "type": "number"
                      },
                      "current_b": {
                        "type": "number"
                      },
                      "curve": {
                        "type": "string"
                      },
                      "effective_b": {
                        "type": "number"
                      },
                      "group": {
                        "type": "string"
                      },
                      "group_label": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "id": {
                        "type": "number"
                      },
                      "label": {
                        "type": "string"
                      },
                      "liquidity_multiplier": {
                        "type": "number"
                      },
                      "pct_remaining": {
                        "type": "number"
                      },
                      "projection_group": {
                        "type": "string"
                      },
                      "starting_probability": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "submarket": {
                        "type": "string"
                      },
                      "resolved_at": {
                        "type": "string"
                      },
                      "resolved_yes": {
                        "type": "boolean"
                      },
                      "interpretation": {
                        "type": "string"
                      },
                      "threshold_date": {
                        "type": "string"
                      },
                      "my_probability": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "threshold": {
                        "type": "number"
                      },
                      "chart_starting_probability": {
                        "type": "number"
                      },
                      "end_date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "community_probability",
                      "contributors",
                      "curve",
                      "group",
                      "group_label",
                      "id",
                      "label",
                      "projection_group",
                      "starting_probability",
                      "status",
                      "submarket"
                    ]
                  }
                },
                "title": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "visibility": {
                  "type": "string"
                },
                "multidate": {
                  "type": "object",
                  "properties": {
                    "event_details": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "color": {
                            "type": "null"
                          },
                          "key": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "color",
                          "key",
                          "label"
                        ]
                      }
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "event_details",
                    "events"
                  ]
                },
                "groups": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "community_probability_range": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "group": {
                        "type": "string"
                      },
                      "resolved_submarkets": {
                        "type": "number"
                      },
                      "starting_probability_range": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "submarkets": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "community_probability_range",
                      "group",
                      "resolved_submarkets",
                      "starting_probability_range",
                      "submarkets"
                    ]
                  }
                },
                "hint": {
                  "type": "string"
                },
                "total_submarkets": {
                  "type": "number"
                },
                "display_unit": {
                  "type": "string"
                },
                "multicount": {
                  "type": "object",
                  "properties": {
                    "entities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "entity_details": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "color": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "color",
                          "key",
                          "label"
                        ]
                      }
                    },
                    "total": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "entities",
                    "entity_details",
                    "total"
                  ]
                },
                "budget": {
                  "type": "number"
                },
                "description": {
                  "type": "object",
                  "properties": {
                    "resolution_criteria": {
                      "type": "string"
                    },
                    "version": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "resolution_criteria",
                    "version"
                  ]
                },
                "end_date": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "resolution_criteria": {
                  "type": "string"
                },
                "x_unit": {
                  "type": "string"
                },
                "group_labels": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "default_view": {
                  "type": "string"
                },
                "as_of": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "chart_color",
                "code",
                "curves",
                "group_scope",
                "local_code",
                "prob_direction",
                "reference",
                "response_mode",
                "status",
                "title",
                "type",
                "visibility"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "chart_color": null,
              "code": "t48194",
              "curves": [],
              "forecast": {},
              "forecast_by_group": {},
              "group_scope": "cumulative",
              "local_code": "t48194",
              "prob_direction": "increasing",
              "reference": "t48194",
              "response_mode": "grouped_forecast",
              "status": "open",
              "submarkets": [],
              "title": "some title",
              "type": "date",
              "visibility": "public"
            }
          }
        }
      }
    },
    {
      "id": "position.market_positions",
      "method": "GET",
      "path": "/api/v1/markets/{code}/positions",
      "summary": "Your positions in one market.",
      "group": "your forecasts",
      "auth": "read",
      "headers": [
        "x-antistatic-run",
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "run_id": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number"
                  },
                  "created_via": {
                    "type": "string"
                  },
                  "id": {
                    "type": "number"
                  },
                  "market_code": {
                    "type": "string"
                  },
                  "market_title": {
                    "type": "string"
                  },
                  "net_cost": {
                    "type": "number"
                  },
                  "net_shares": {
                    "type": "number"
                  },
                  "probability": {
                    "type": "number"
                  },
                  "shares": {
                    "type": "number"
                  },
                  "submarket": {
                    "type": "string"
                  },
                  "submarket_details": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "market": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "id": {
                            "type": "number"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "id",
                          "title"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "label",
                      "market"
                    ]
                  },
                  "submarket_label": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "created_via",
                  "id",
                  "market_code",
                  "market_title",
                  "net_cost",
                  "net_shares",
                  "probability",
                  "shares",
                  "submarket",
                  "submarket_details",
                  "submarket_label"
                ]
              }
            },
            "paging": {
              "type": "object",
              "properties": {
                "has_more": {
                  "type": "boolean"
                },
                "limit": {
                  "type": "number"
                },
                "next_offset": {
                  "type": "null"
                },
                "offset": {
                  "type": "number"
                }
              },
              "required": [
                "has_more",
                "limit",
                "next_offset",
                "offset"
              ]
            }
          },
          "required": [
            "data",
            "paging"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "cost": 14.384103166472112,
                "created_via": "web",
                "id": 14996,
                "market_code": "ct10915",
                "market_title": "Contract test market",
                "net_cost": 14.384103166472112,
                "net_shares": 22.09163691343073,
                "probability": 0.7,
                "shares": 22.09163691343073,
                "submarket": "sm_48370",
                "submarket_details": {
                  "id": "sm_48370",
                  "label": "At least 100",
                  "market": {
                    "code": "ct10915",
                    "id": 6656,
                    "title": "Contract test market"
                  }
                },
                "submarket_label": "At least 100"
              }
            ],
            "paging": {
              "has_more": false,
              "limit": 100,
              "next_offset": null,
              "offset": 0
            }
          }
        }
      }
    },
    {
      "id": "points.show",
      "method": "GET",
      "path": "/api/v1/markets/{code}/points",
      "summary": "What your positions in a market win or lose under each way it could resolve.",
      "group": "your forecasts",
      "description": "A cumulative market that forms one curve returns `scenarios`; otherwise `groups` has one entry per curve. Each scenario has a readable `resolution` (date curves: the period the event first happens; count curves: the bucket the value lands in), `points_won_lost`, and `possible: false` when resolved bars rule it out. `at=<text>` keeps scenarios whose label contains that text.",
      "auth": "read",
      "headers": [
        "x-antistatic-run",
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string"
          },
          "run_id": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "cumulative": {
                  "type": "boolean"
                },
                "market": {
                  "type": "string"
                },
                "scenarios": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "first_in": {
                        "type": "object",
                        "properties": {
                          "after": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "by": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "after",
                          "by"
                        ]
                      },
                      "points_won_lost": {
                        "type": "number"
                      },
                      "possible": {
                        "type": "boolean"
                      },
                      "resolution": {
                        "type": "string"
                      },
                      "hi": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "lo": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "points_won_lost",
                      "possible",
                      "resolution"
                    ]
                  }
                },
                "title": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "unit": {
                  "type": "string"
                },
                "groups": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "curve": {
                        "type": "string"
                      },
                      "group": {
                        "type": "string"
                      },
                      "scenarios": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "hi": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "lo": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "points_won_lost": {
                              "type": "number"
                            },
                            "possible": {
                              "type": "boolean"
                            },
                            "resolution": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "hi",
                            "lo",
                            "points_won_lost",
                            "possible",
                            "resolution"
                          ]
                        }
                      },
                      "submarkets": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "curve",
                      "group",
                      "scenarios",
                      "submarkets"
                    ]
                  }
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "cumulative",
                "market",
                "title",
                "type",
                "unit"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "cumulative": true,
              "market": "mcp-test",
              "scenarios": [
                {
                  "hi": 100.0,
                  "lo": null,
                  "points_won_lost": 0.0,
                  "possible": true,
                  "resolution": "Below 100"
                },
                {
                  "hi": 200.0,
                  "lo": 100.0,
                  "points_won_lost": 0.0,
                  "possible": true,
                  "resolution": "100 to under 200"
                }
              ],
              "title": "MCP test market",
              "type": "count",
              "unit": "points"
            }
          }
        }
      }
    },
    {
      "id": "position.index",
      "method": "GET",
      "path": "/api/v1/positions",
      "summary": "All your positions.",
      "group": "your forecasts",
      "auth": "read",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "market_code": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          },
          "offset": {
            "type": "string"
          },
          "as": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number"
                  },
                  "created_via": {
                    "type": "string"
                  },
                  "id": {
                    "type": "number"
                  },
                  "market_code": {
                    "type": "string"
                  },
                  "market_title": {
                    "type": "string"
                  },
                  "net_cost": {
                    "type": "number"
                  },
                  "net_shares": {
                    "type": "number"
                  },
                  "probability": {
                    "type": "number"
                  },
                  "shares": {
                    "type": "number"
                  },
                  "submarket": {
                    "type": "string"
                  },
                  "submarket_details": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "market": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "id": {
                            "type": "number"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "id",
                          "title"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "label",
                      "market"
                    ]
                  },
                  "submarket_label": {
                    "type": "string"
                  },
                  "market_id": {
                    "type": "number"
                  },
                  "position_count": {
                    "type": "number"
                  }
                },
                "required": [
                  "cost",
                  "market_code",
                  "market_title",
                  "net_cost",
                  "net_shares",
                  "shares"
                ]
              }
            },
            "paging": {
              "type": "object",
              "properties": {
                "has_more": {
                  "type": "boolean"
                },
                "limit": {
                  "type": "number"
                },
                "next_offset": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "offset": {
                  "type": "number"
                }
              },
              "required": [
                "has_more",
                "limit",
                "next_offset",
                "offset"
              ]
            }
          },
          "required": [
            "data",
            "paging"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "limit": "1"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "cost": 3.449643574347566,
                "created_via": "web",
                "id": 14259,
                "market_code": "pos-b6978",
                "market_title": "Position Market B",
                "net_cost": 3.449643574347566,
                "net_shares": 8.215152564563809,
                "probability": 0.44,
                "shares": 8.215152564563809,
                "submarket": "sm_47061",
                "submarket_details": {
                  "id": "sm_47061",
                  "label": "B-200",
                  "market": {
                    "code": "pos-b6978",
                    "id": 6477,
                    "title": "Position Market B"
                  }
                },
                "submarket_label": "B-200"
              }
            ],
            "paging": {
              "has_more": true,
              "limit": 1,
              "next_offset": 1,
              "offset": 0
            }
          }
        }
      }
    },
    {
      "id": "profile.summary",
      "method": "GET",
      "path": "/api/v1/profile/summary",
      "summary": "Your points totals.",
      "group": "your forecasts",
      "auth": "read",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "forecasting_points": {
                  "type": "number"
                },
                "private_forecasting_points": {
                  "type": "number"
                },
                "tipping_profit": {
                  "type": "number"
                },
                "user_id": {
                  "type": "number"
                }
              },
              "required": [
                "forecasting_points",
                "private_forecasting_points",
                "tipping_profit",
                "user_id"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "forecasting_points": 0.0,
              "private_forecasting_points": 0.0,
              "tipping_profit": 0,
              "user_id": 7994
            }
          }
        }
      }
    },
    {
      "id": "profile.forecast_history",
      "method": "GET",
      "path": "/api/v1/profile/forecast-history",
      "summary": "Your forecasts over time, newest first.",
      "group": "your forecasts",
      "auth": "read",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "string"
          },
          "offset": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "pagination": {
                  "type": "object",
                  "properties": {
                    "limit": {
                      "type": "number"
                    },
                    "offset": {
                      "type": "number"
                    },
                    "total_count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "limit",
                    "offset",
                    "total_count"
                  ]
                },
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "communityExpectedPoints": {
                        "type": "number"
                      },
                      "lastPositionAt": {
                        "type": "string"
                      },
                      "liquidity": {
                        "type": "number"
                      },
                      "marketId": {
                        "type": "number"
                      },
                      "marketPath": {
                        "type": "string"
                      },
                      "next24hLiquidityChange": {
                        "type": "number"
                      },
                      "pointsStaked": {
                        "type": "number"
                      },
                      "pointsWonLost": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "userExpectedPoints": {
                        "type": "number"
                      },
                      "visibility": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "communityExpectedPoints",
                      "lastPositionAt",
                      "liquidity",
                      "marketId",
                      "marketPath",
                      "next24hLiquidityChange",
                      "pointsStaked",
                      "pointsWonLost",
                      "status",
                      "title",
                      "userExpectedPoints",
                      "visibility"
                    ]
                  }
                },
                "user_id": {
                  "type": "number"
                }
              },
              "required": [
                "pagination",
                "rows",
                "user_id"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "pagination": {
                "limit": 50,
                "offset": 0,
                "total_count": 0
              },
              "rows": [],
              "user_id": 10482
            }
          }
        }
      }
    },
    {
      "id": "profile.liquidity_decay",
      "method": "GET",
      "path": "/api/v1/profile/liquidity-decay",
      "summary": "Upcoming liquidity cuts on bars you hold.",
      "group": "your forecasts",
      "auth": "read",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "as_of": {
                  "type": "string"
                },
                "decaying_count": {
                  "type": "number"
                },
                "horizon_hours": {
                  "type": "number"
                },
                "markets": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "communityExpectedPoints": {
                        "type": "number"
                      },
                      "lastPositionAt": {
                        "type": "string"
                      },
                      "liquidity": {
                        "type": "number"
                      },
                      "marketId": {
                        "type": "number"
                      },
                      "marketPath": {
                        "type": "string"
                      },
                      "next24hLiquidityChange": {
                        "type": "number"
                      },
                      "pointsStaked": {
                        "type": "number"
                      },
                      "pointsWonLost": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "userExpectedPoints": {
                        "type": "number"
                      },
                      "visibility": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "communityExpectedPoints",
                      "lastPositionAt",
                      "liquidity",
                      "marketId",
                      "marketPath",
                      "next24hLiquidityChange",
                      "pointsStaked",
                      "pointsWonLost",
                      "status",
                      "title",
                      "userExpectedPoints",
                      "visibility"
                    ]
                  }
                },
                "total_count": {
                  "type": "number"
                },
                "user_id": {
                  "type": "number"
                }
              },
              "required": [
                "as_of",
                "decaying_count",
                "horizon_hours",
                "markets",
                "total_count",
                "user_id"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "as_of": "2026-10-10T19:44:30.586567Z",
              "decaying_count": 0,
              "horizon_hours": 24,
              "markets": [],
              "total_count": 0,
              "user_id": 10483
            }
          }
        }
      }
    },
    {
      "id": "profile.points_history",
      "method": "GET",
      "path": "/api/v1/profile/points-history",
      "summary": "The points-over-time series from your profile.",
      "group": "your forecasts",
      "description": "`range` is `1d`, `1w` (hourly), `1m`, `1y` or `all` (daily, UTC; the default). Each point has running `realized_points`, `user_expected_points`, `community_expected_points` and `tips_received` at `at`.",
      "auth": "read",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "range": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "as_of": {
                  "type": "string"
                },
                "cadence": {
                  "type": "string"
                },
                "points": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "at": {
                        "type": "string"
                      },
                      "community_expected_points": {
                        "type": "number"
                      },
                      "realized_points": {
                        "type": "number"
                      },
                      "tips_received": {
                        "type": "number"
                      },
                      "user_expected_points": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "at",
                      "community_expected_points",
                      "realized_points",
                      "tips_received",
                      "user_expected_points"
                    ]
                  }
                },
                "range": {
                  "type": "string"
                },
                "start_at": {
                  "type": "string"
                },
                "user_id": {
                  "type": "number"
                }
              },
              "required": [
                "as_of",
                "cadence",
                "points",
                "range",
                "start_at",
                "user_id"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "range": "all"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "as_of": "2026-10-10T19:18:01Z",
              "cadence": "daily",
              "points": [],
              "range": "all",
              "start_at": "2026-10-10T19:18:00Z",
              "user_id": 7994
            }
          }
        }
      }
    },
    {
      "id": "trade.quote",
      "method": "GET",
      "path": "/api/v1/markets/{code}/quote",
      "summary": "Quote a forecast: its cost and what it wins or loses. Changes nothing.",
      "group": "forecasting",
      "description": "Name a bar with `submarket` (`sm_42`) or `submarket_id` and the probability with `to_p`; `from_p` defaults to your current forecast, or the starting probability. For several bars send `updates` (a JSON array as for positions). `cost` is points paid; `profit_if_yes`/`profit_if_no` what the change wins or loses; `draft_url` opens it on the market page as an unsaved draft.",
      "auth": "read",
      "headers": [
        "x-antistatic-run",
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "submarket": {
            "type": "string"
          },
          "submarket_id": {
            "type": "string"
          },
          "from_p": {
            "type": "string"
          },
          "to_p": {
            "type": "string"
          },
          "updates": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "b_used": {
                  "type": "number"
                },
                "cost": {
                  "type": "number"
                },
                "draft_url": {
                  "type": "string"
                },
                "from_probability": {
                  "type": "number"
                },
                "points_cashed_out": {
                  "type": "number"
                },
                "points_invested": {
                  "type": "number"
                },
                "points_won_lost_if_no": {
                  "type": "number"
                },
                "points_won_lost_if_yes": {
                  "type": "number"
                },
                "shares_yes": {
                  "type": "number"
                },
                "topup_cost": {
                  "type": "number"
                },
                "topup_shares": {
                  "type": "number"
                }
              },
              "required": [
                "b_used",
                "cost",
                "draft_url",
                "points_cashed_out",
                "points_invested",
                "points_won_lost_if_no",
                "points_won_lost_if_yes",
                "shares_yes"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "from_p": "0.5",
            "submarket": "sm_45612",
            "to_p": "0.65"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "b_used": 49.9999984145104,
              "cost": 17.833746631432213,
              "draft_url": "http://localhost:4002/m/trade-test?g=group1&draft=eyJ1IjpbWzQ1NjEyLDAuNjVdXX0",
              "points_cashed_out": 0.0,
              "points_invested": 17.833746631432213,
              "points_won_lost_if_no": -17.833746631432213,
              "points_won_lost_if_yes": 13.118212807398741,
              "shares_yes": 30.951959438830954
            }
          }
        }
      }
    },
    {
      "id": "trade.curve_targets",
      "method": "POST",
      "path": "/api/v1/markets/{code}/curve-targets",
      "summary": "The bar updates that targets or a shift would make. Changes nothing.",
      "group": "forecasting",
      "description": "The bar updates a `targets`/`shift` request would make, and a `draft_url`. Works without a token (curves start from the house line); with one, it needs `read` and starts from your forecast.",
      "auth": "optional",
      "headers": [
        "x-antistatic-run",
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "probability": {
                  "type": "number"
                },
                "threshold": {
                  "type": "number"
                }
              },
              "required": [
                "probability",
                "threshold"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "draft_url": {
                  "type": "string"
                },
                "updates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "probability": {
                        "type": "number"
                      },
                      "submarket": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "probability",
                      "submarket"
                    ]
                  }
                }
              },
              "required": [
                "draft_url",
                "updates"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "targets": [
              {
                "probability": 0.4,
                "threshold": 200
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "draft_url": "http://localhost:4002/m/dl71554?g=period&draft=eyJ0IjpbeyJwcm9iYWJpbGl0eSI6MC40LCJ0aHJlc2hvbGQiOjIwMH1dfQ",
              "updates": [
                {
                  "probability": 0.6517,
                  "submarket": "sm_44303"
                },
                {
                  "probability": 0.4,
                  "submarket": "sm_44304"
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "pending_edit.show",
      "method": "GET",
      "path": "/api/v1/markets/{code}/pending-edits",
      "summary": "Your staged (unsubmitted) forecast for a market.",
      "group": "forecasting",
      "auth": "read",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "is_fixed": {
                    "type": "boolean"
                  },
                  "probability": {
                    "type": "number"
                  }
                },
                "required": [
                  "probability"
                ]
              }
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "sm_39279": {
                "probability": 0.4
              }
            }
          }
        }
      }
    },
    {
      "id": "comment.index",
      "method": "GET",
      "path": "/api/v1/markets/{code}/comments",
      "summary": "A market's comments, threaded.",
      "group": "comments",
      "description": "Threaded, newest first by default (`sort`). `limit` top-level threads (max 100), `max_comments` in total, `max_body_chars` per body; page with `cursor_id`/`cursor_inserted_at` from the previous page. With `X-Antistatic-Run`, the run's own comments.",
      "auth": "read",
      "headers": [
        "x-antistatic-run"
      ],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "sort": {
            "type": "string"
          },
          "filter": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          },
          "max_comments": {
            "type": "string"
          },
          "max_body_chars": {
            "type": "string"
          },
          "replies": {
            "type": "string"
          },
          "cursor_id": {
            "type": "string"
          },
          "cursor_inserted_at": {
            "type": "string"
          },
          "run_id": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "comments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "body_html": {
                        "type": "string"
                      },
                      "body_text": {
                        "type": "string"
                      },
                      "children": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "body_html": {
                              "type": "string"
                            },
                            "body_text": {
                              "type": "string"
                            },
                            "children": {
                              "type": "array"
                            },
                            "created_via": {
                              "type": "string"
                            },
                            "edited_at": {
                              "type": "null"
                            },
                            "id": {
                              "type": "number"
                            },
                            "inserted_at": {
                              "type": "string"
                            },
                            "parent_id": {
                              "type": "number"
                            },
                            "reply_count": {
                              "type": "number"
                            },
                            "score": {
                              "type": "number"
                            },
                            "total_tips": {
                              "type": "number"
                            },
                            "user": {
                              "type": "object",
                              "properties": {
                                "bot": {
                                  "type": "boolean"
                                },
                                "id": {
                                  "type": "number"
                                },
                                "username": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "bot",
                                "id",
                                "username"
                              ]
                            }
                          },
                          "required": [
                            "body_html",
                            "body_text",
                            "children",
                            "created_via",
                            "edited_at",
                            "id",
                            "inserted_at",
                            "parent_id",
                            "reply_count",
                            "score",
                            "total_tips",
                            "user"
                          ]
                        }
                      },
                      "created_via": {
                        "type": "string"
                      },
                      "edited_at": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "id": {
                        "type": "number"
                      },
                      "inserted_at": {
                        "type": "string"
                      },
                      "parent_id": {
                        "type": "null"
                      },
                      "reply_count": {
                        "type": "number"
                      },
                      "score": {
                        "type": "number"
                      },
                      "total_tips": {
                        "type": "number"
                      },
                      "user": {
                        "type": "object",
                        "properties": {
                          "bot": {
                            "type": "boolean"
                          },
                          "id": {
                            "type": "number"
                          },
                          "username": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "bot",
                          "id",
                          "username"
                        ]
                      }
                    },
                    "required": [
                      "body_html",
                      "body_text",
                      "children",
                      "created_via",
                      "edited_at",
                      "id",
                      "inserted_at",
                      "parent_id",
                      "reply_count",
                      "score",
                      "total_tips",
                      "user"
                    ]
                  }
                },
                "filter": {
                  "type": "string"
                },
                "paging": {
                  "type": "object",
                  "properties": {
                    "has_more": {
                      "type": "boolean"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "next_cursor": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "inserted_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "inserted_at"
                      ]
                    }
                  },
                  "required": [
                    "has_more",
                    "limit",
                    "next_cursor"
                  ]
                },
                "returned_count": {
                  "type": "number"
                },
                "sort": {
                  "type": "string"
                },
                "total_count": {
                  "type": "number"
                },
                "truncated": {
                  "type": "boolean"
                }
              },
              "required": [
                "comments",
                "filter",
                "paging",
                "returned_count",
                "sort",
                "total_count",
                "truncated"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "limit": "20",
            "sort": "new"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "comments": [],
              "filter": "all",
              "paging": {
                "has_more": false,
                "limit": 20,
                "next_cursor": null
              },
              "returned_count": 0,
              "sort": "newest",
              "total_count": 0,
              "truncated": false
            }
          }
        }
      }
    },
    {
      "id": "sandbox.index",
      "method": "GET",
      "path": "/api/v1/sandbox",
      "summary": "Sandboxes you can start (curricula and wargame templates), and your runs.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "curricula": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "run_id": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "slug": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "description",
                      "kind",
                      "run_id",
                      "slug",
                      "title",
                      "url"
                    ]
                  }
                },
                "runs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "checkpoint": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "title"
                        ]
                      },
                      "clock": {
                        "type": "string"
                      },
                      "complete": {
                        "type": "boolean"
                      },
                      "curriculum": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "slug",
                          "title"
                        ]
                      },
                      "kind": {
                        "type": "string"
                      },
                      "run_id": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "practice": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "archived": {
                        "type": "boolean"
                      },
                      "forked_from_run_id": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "checkpoint",
                      "clock",
                      "complete",
                      "curriculum",
                      "kind",
                      "run_id",
                      "status"
                    ]
                  }
                },
                "templates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "premise": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "title",
                      "kind",
                      "premise"
                    ]
                  }
                },
                "future_sandboxes": {
                  "type": "object",
                  "properties": {
                    "included": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    },
                    "ai_budget": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The monthly AI budget that server-planned turns, info answers and briefings use (client-planned turns use none): `plan` (free, pro or supporter), `allowance_usd`, `used_usd`, `remaining_usd` (null when uncapped), `uncapped` (true: never stopped; `allowance_usd` is then only a meter) and `resets_on` (a date, UTC).",
                      "properties": {
                        "plan": {
                          "type": "string"
                        },
                        "allowance_usd": {
                          "type": "number"
                        },
                        "used_usd": {
                          "type": "number"
                        },
                        "remaining_usd": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "uncapped": {
                          "type": "boolean"
                        },
                        "resets_on": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "plan",
                        "allowance_usd",
                        "used_usd",
                        "remaining_usd",
                        "uncapped",
                        "resets_on"
                      ]
                    }
                  },
                  "required": [
                    "included"
                  ]
                }
              },
              "required": [
                "curricula",
                "runs"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "curricula": [],
              "runs": [],
              "templates": [
                {
                  "key": "wargame-your-life",
                  "title": "Wargame your life",
                  "kind": "future",
                  "premise": "It is October 2026. …"
                }
              ],
              "future_sandboxes": {
                "included": true
              }
            }
          }
        }
      }
    },
    {
      "id": "sandbox.show",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}",
      "summary": "Where one of your sandbox runs stands: a past run's clock, checkpoint and questions, or a wargame's setup and history.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "include_audit": {
            "type": "string",
            "description": "true adds `audit` to a wargame: how each completed turn was decided (see sandbox.audit)."
          },
          "character": {
            "type": "string",
            "description": "A wargame character's key (c2, ...): one of your characters, whose view or orders this is; required when you have several in the game (the 422 lists them). Only that character's private material comes back."
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "blockers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "reason",
                          "title"
                        ]
                      }
                    },
                    "checkpoint": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "occurred_at": {
                          "type": "string"
                        },
                        "sequence": {
                          "type": "number"
                        },
                        "text": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "occurred_at",
                        "sequence",
                        "text",
                        "title"
                      ]
                    },
                    "clock": {
                      "type": "string"
                    },
                    "complete": {
                      "type": "boolean"
                    },
                    "curriculum": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "slug",
                        "title"
                      ]
                    },
                    "kind": {
                      "type": "string"
                    },
                    "pending_resolutions": {
                      "type": "array"
                    },
                    "previous_checkpoint_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "contaminated": {
                            "type": "boolean"
                          },
                          "key": {
                            "type": "string"
                          },
                          "market_code": {
                            "type": "string"
                          },
                          "moderation": {
                            "type": "null"
                          },
                          "open": {
                            "type": "boolean"
                          },
                          "private": {
                            "type": "boolean"
                          },
                          "resolved": {
                            "type": "boolean"
                          },
                          "submitted": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "contaminated",
                          "key",
                          "market_code",
                          "moderation",
                          "open",
                          "private",
                          "resolved",
                          "submitted",
                          "title"
                        ]
                      }
                    },
                    "run_id": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "blockers",
                    "checkpoint",
                    "clock",
                    "complete",
                    "curriculum",
                    "kind",
                    "pending_resolutions",
                    "previous_checkpoint_at",
                    "questions",
                    "run_id",
                    "status",
                    "url"
                  ]
                },
                {
                  "$ref": "#/$defs/timeline_future"
                },
                {
                  "type": "object",
                  "description": "A wargame as one of the caller's characters sees it (role guest).",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "guest"
                      ]
                    },
                    "character": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "tagline": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "bio": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "key",
                        "name",
                        "tagline",
                        "bio"
                      ]
                    },
                    "clock": {
                      "type": "string"
                    },
                    "settings": {
                      "type": "object"
                    },
                    "turns": {
                      "type": "number"
                    },
                    "history": {
                      "type": "array"
                    },
                    "questions": {
                      "type": "array"
                    },
                    "info_log": {
                      "type": "array"
                    },
                    "cast": {
                      "type": "array"
                    },
                    "url": {
                      "type": "string"
                    },
                    "turn_status": {
                      "$ref": "#/$defs/turn_status"
                    }
                  },
                  "required": [
                    "run_id",
                    "kind",
                    "role",
                    "character",
                    "clock",
                    "settings",
                    "turns",
                    "history",
                    "questions",
                    "url"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [
                {
                  "key": "paper-a",
                  "reason": "forecast",
                  "title": "Will the paper's primary endpoint be positive?"
                }
              ],
              "checkpoint": {
                "key": "opening",
                "occurred_at": "2020-01-01T00:00:00Z",
                "sequence": 0,
                "text": "Only prior evidence is visible.",
                "title": "Opening evidence"
              },
              "clock": "2020-01-01T00:00:00Z",
              "complete": false,
              "curriculum": {
                "slug": "retro-42115",
                "title": "Biology sandbox 42115"
              },
              "kind": "past",
              "pending_resolutions": [],
              "previous_checkpoint_at": null,
              "questions": [
                {
                  "contaminated": false,
                  "key": "paper-a",
                  "market_code": "rt42115",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": null,
                  "title": "Will the paper's primary endpoint be positive?"
                }
              ],
              "run_id": 609,
              "status": "active",
              "url": "http://localhost:4002/sandbox/retro-42115"
            }
          }
        }
      },
      "description": "A past sandbox's position (`kind: past`), or a wargame's (`kind: future`): its clock, setup, the results of its last 50 turns and the questions written in it. Nothing past the clock. In a wargame you play but don't host, or with `character` (one of yours), the run as that character sees it: the shared story with its own results and info answers, `role: guest` and its `character`."
    },
    {
      "id": "sandbox.audit",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}/audit",
      "summary": "How a wargame's completed turns were decided: the server's seeded rolls.",
      "group": "sandboxes",
      "description": "For the run's owner, per completed turn (oldest first; `turn` picks one by number): `seed_hex` (random per turn), `planner` (server or client), `model` (the model the turn was planned with, fixed when it started; null for client turns), `cost_usd` (its exact model cost at list prices; null for client turns), the optional `duties` rolled (duty, rate, p, u, fired), every visible `draws` entry (kind draw, sample or curveball; label, p or distribution, basis, u, result, action), `sealed_draws` (how many draws the planner sealed: counted, not shown), `question_rolls` (each run-question item rolled: market, title, item, item_label, period, `source` (house; or, in a run with sample_from user, user, fallback when the user had no forecast, or mixed with user_bars of bars), line_p (the p from the line rolled), house_p (when the source is house), the planner's adjustment {factor, basis}, p, u, result and date; for a how_much period: source, line [{threshold, p, source}] (and house, the same, when the source is house), median, u and result {at_least, below}), the run's `mode` (mortal or god), `goals` after the turn (null for a run without goals; else mode, scored, total {realised, unrealised, total} and goals [{market, liquidity, turn, priced_at, realised, unrealised, total, bars [{bar, p0, p, forecast, resolved_yes, realised, unrealised}]}]) and `branches` (labels, weights, chosen index, u). A result is yes when u < p. Nothing about turns not yet completed, and no planner evidence, notes or unseen observations. Errors: 404 (not your wargame), 422 (turn is not a number).",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "envelope",
      "query": {
        "type": "object",
        "properties": {
          "turn": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 30,
              "turns": [
                {
                  "turn": 1,
                  "planner": "client",
                  "seed_hex": "9f2c…",
                  "duties": [],
                  "draws": [
                    {
                      "n": 1,
                      "kind": "draw",
                      "label": "The ward manager replies this week",
                      "p": 0.5,
                      "basis": "…",
                      "u": 0.4,
                      "result": "yes"
                    }
                  ],
                  "sealed_draws": 0,
                  "question_rolls": [],
                  "branches": {
                    "labels": [
                      "Reply, scheme open",
                      "No reply"
                    ],
                    "weights": [
                      0.6,
                      0.4
                    ],
                    "chosen": 0,
                    "u": 0.31
                  }
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandbox.sources",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}/sources",
      "summary": "A run's sources up to its clock: the briefing, reached disclosures and new feed items.",
      "group": "sandboxes",
      "description": "`since=YYYY-MM-DD` (default: the previous checkpoint's date; `since=start` for everything reached) bounds the disclosures and the feed. `limit` caps disclosures (max 200). The feed needs Pro or curriculum membership; otherwise its `status` is `not_included`.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "since": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "briefing": {
                  "type": "object",
                  "properties": {
                    "checkpoint": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "text",
                        "title"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "checkpoint",
                    "text",
                    "title"
                  ]
                },
                "clock": {
                  "type": "string"
                },
                "disclosures": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "at": {
                        "type": "string"
                      },
                      "checkpoint_key": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "question_code": {
                        "type": "string"
                      },
                      "source_url": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "text": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "at",
                      "checkpoint_key",
                      "key",
                      "kind",
                      "question_code",
                      "source_url",
                      "text",
                      "title"
                    ]
                  }
                },
                "feed": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "items",
                    "status"
                  ]
                },
                "since": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "briefing",
                "clock",
                "disclosures",
                "feed",
                "since"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "since": "start"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "briefing": {
                "checkpoint": {
                  "key": "opening",
                  "text": "Only prior evidence is visible.",
                  "title": "Opening evidence"
                },
                "text": "Historical biology questions.",
                "title": "Biology sandbox 42115"
              },
              "clock": "2020-01-01T00:00:00Z",
              "disclosures": [
                {
                  "at": "2020-01-01T00:00:00Z",
                  "checkpoint_key": "opening",
                  "key": "study-design",
                  "kind": "evidence",
                  "question_code": "rt42115",
                  "source_url": null,
                  "text": "Forty subjects and a preregistered endpoint.",
                  "title": "Study design"
                }
              ],
              "feed": {
                "items": [],
                "status": "unavailable"
              },
              "since": null
            }
          }
        }
      }
    },
    {
      "id": "sandbox.library",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}/library",
      "summary": "Search a run's library, capped at the run's clock.",
      "group": "sandboxes",
      "description": "`q` is required. `limit` (max 15), `offset`, `after=YYYY-MM-DD`, `sort=relevance|newest`. The cutoff comes from the run's clock: a source dated D is available from D+1. Needs Pro or curriculum membership.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          },
          "offset": {
            "type": "string"
          },
          "after": {
            "type": "string"
          },
          "sort": {
            "type": "string"
          }
        },
        "required": [
          "q"
        ]
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "cutoff": {
                  "type": "string"
                },
                "more": {
                  "type": "boolean"
                },
                "next_offset": {
                  "type": "null"
                },
                "results": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string"
                      },
                      "doc_id": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "date",
                      "doc_id",
                      "title"
                    ]
                  }
                }
              },
              "required": [
                "cutoff",
                "more",
                "next_offset",
                "results"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "q": "widget"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "cutoff": "2020-01-01",
              "more": false,
              "next_offset": null,
              "results": [
                {
                  "date": "2019-12-31",
                  "doc_id": "a",
                  "title": "Reached"
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandbox.turn_status",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}/turn_status",
      "summary": "Where a wargame's next turn stands for you: players, the turn's length, what you do next; can long-poll.",
      "group": "sandboxes",
      "description": "For the run's host or a guest who joined it. `wait_seconds` (0-60) long-polls: the answer comes as soon as the status differs from `since` (a `version` from an earlier answer; absent, the status now), or after `wait_seconds` with the status as it is. 404 for a run you don't play.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "wait_seconds": {
            "type": "string",
            "description": "Seconds to wait for a change, 0-60 (default 0)."
          },
          "since": {
            "type": "string",
            "description": "The `version` you last saw."
          },
          "character": {
            "type": "string",
            "description": "A wargame character's key (c2, ...): one of your characters, whose view or orders this is; required when you have several in the game (the 422 lists them). Only that character's private material comes back."
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/$defs/turn_status"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "wait_seconds": "30",
            "since": "1x9k1"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "turn": 4,
              "clock": "2026-11-14",
              "role": "guest",
              "multiplayer": true,
              "busy": null,
              "length": {
                "until": "2026-12-14",
                "label": "to 14 Dec 2026 (1 month)",
                "span": "1 month",
                "state": "locked"
              },
              "last_length": {
                "from": "2026-10-14",
                "to": "2026-11-14",
                "span": "1 month"
              },
              "players": [
                {
                  "key": "c1",
                  "name": "Ana",
                  "role": "host",
                  "status": "host",
                  "orders": null,
                  "submitted_for": null,
                  "submitted_for_label": null,
                  "stale": false,
                  "reopened": false,
                  "you": false
                },
                {
                  "key": "c2",
                  "name": "Rosa",
                  "role": "guest",
                  "status": "submitted",
                  "orders": 2,
                  "submitted_for": "2026-12-14",
                  "submitted_for_label": "to 14 Dec 2026 (1 month)",
                  "stale": false,
                  "reopened": false,
                  "you": true
                }
              ],
              "submitted": 1,
              "expected": 1,
              "can_run": false,
              "waiting_on": [],
              "open_questions": [],
              "next": {
                "action": "wait",
                "text": "Submitted. Waiting for the host to run the turn."
              },
              "version": "1x9k2"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.orders",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}/orders",
      "summary": "A wargame character's draft orders for the next turn.",
      "group": "sandboxes",
      "description": "The host's own draft without `character`; else that character's (required when you have several in the game). 404 for a run you don't play.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "character": {
            "type": "string",
            "description": "A wargame character's key (c2, ...): one of your characters, whose view or orders this is; required when you have several in the game (the 422 lists them). Only that character's private material comes back."
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "run_id": {
                  "type": "number"
                },
                "character": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "owner",
                    "guest"
                  ]
                },
                "entries": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "text",
                      "source"
                    ]
                  }
                },
                "submitted_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "run_id",
                "character",
                "role",
                "entries",
                "submitted_at"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "character": "c3"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 42,
              "character": "c3",
              "role": "guest",
              "entries": [
                {
                  "id": "oAbC123",
                  "type": "action",
                  "text": "Announce a pause on frontier training.",
                  "source": "mcp"
                }
              ],
              "submitted_at": "2026-10-13T12:00:00Z"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.start",
      "method": "POST",
      "path": "/api/v1/sandbox/runs",
      "summary": "Start a sandbox: a future one from a template or the player's own scenario, or a past one from a curriculum.",
      "group": "sandboxes",
      "description": "`template` starts a wargame on `starts_on` (default today; any past or future date; where the plan allows; at most 5 active), with an optional `model` (`opus`, the default, `sonnet` or `haiku`: the model that simulates the run). `title` and `premise` without `template` start a wargame of the player's own scenario (the premise is free text: one line or a long brief; world rules, pacing and curveball guidance are the shared defaults); with `template` they replace its own. `bio` sets the player's bio from the outset. A run started with a premise or a bio is set up: its first turn can be taken. The response is the run with a `setup` object (the scenario's title and premise, the bio prompt and choices, how turn lengths are chosen, the curveball guidance) whose answers go to `PATCH /sandbox/runs/{id}/setup`. `curriculum` (a slug) starts or resumes a past sandbox and returns its position (`kind: past`). `planner`: `client` (the default here: the caller's own agent plans through planner jobs, with no Antistatic model calls) or `server` (Antistatic's model, on the monthly AI budget in `GET /sandbox`); runs started on the website are server-planned. Errors: 429 `sandbox_quota`, 422 for a missing title or premise. `characters` makes a cast for the caller as the run starts (they host and umpire, with no character of their own).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string"
          },
          "curriculum": {
            "type": "string"
          },
          "planner": {
            "type": "string",
            "enum": [
              "server",
              "client"
            ]
          },
          "sample_from": {
            "type": "string",
            "enum": [
              "house",
              "user"
            ],
            "description": "Where the run's question rolls take their odds: house (the house line) or user (the user's own forecast where they have one, else the house line); user needs mode god. Wargames."
          },
          "mode": {
            "type": "string",
            "enum": [
              "mortal",
              "god"
            ],
            "description": "mortal (the default for new runs): the world is drawn from the house line (sample_from is house) and the run's goals are scored with market points. god: sample_from may be user (the default in god mode); nothing is scored. sample_from user alone starts a god run. The mode can change at any time: turning god freezes the score; turning mortal prices the goals again, and new points add to the frozen score. Wargames."
          },
          "title": {
            "type": "string",
            "description": "The scenario's title (at most 120 characters). Wargames."
          },
          "premise": {
            "type": "string",
            "description": "The scenario's premise: one line or a long brief. Without template, starts a scenario of the player's own. Wargames."
          },
          "bio": {
            "type": "string",
            "description": "The player's bio from the outset (at most 6,000 characters). Wargames."
          },
          "starts_on": {
            "type": "string",
            "description": "The run's first date (YYYY-MM-DD, past or future), or `auto`: inferred from the premise by Antistatic's planner (server-planned runs; today otherwise). Default today. Changeable in the setup until the first turn starts. Wargames."
          },
          "characters": {
            "type": "array",
            "description": "Characters for the caller, one per actor (`name`, `tagline`, private `bio`), at most 12; the host gets none of their own. Wargames.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "tagline": {
                  "type": "string"
                },
                "bio": {
                  "type": "string"
                },
                "controller": {
                  "type": "string",
                  "enum": [
                    "me",
                    "invitee",
                    "open",
                    "ai"
                  ],
                  "description": "Who plays it: me (the caller; the default), invitee (kept for the person whose email is `invitee`, who claims it from the invite link), open (any invited player may claim it; until then it holds) or ai (the planner plays it). Only the host gives a character to others."
                },
                "invitee": {
                  "type": "string",
                  "description": "The invitee's email, with controller invitee."
                }
              },
              "required": [
                "name"
              ]
            }
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "allOf": [
                    {
                      "$ref": "#/$defs/timeline_future"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "setup": {
                          "type": "object",
                          "description": "What a host collects before the first turn.",
                          "properties": {
                            "template": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "premise": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "key",
                                "title",
                                "premise"
                              ]
                            },
                            "bio_prompt": {
                              "type": "string"
                            },
                            "bio_choices": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "key",
                                  "label"
                                ]
                              }
                            },
                            "default_pace": {
                              "type": "string"
                            },
                            "fields": {
                              "type": "object"
                            },
                            "privacy": {
                              "type": "string"
                            },
                            "pacing": {
                              "type": "string",
                              "description": "How each turn's length is chosen."
                            },
                            "curveballs": {
                              "type": "string",
                              "description": "The life events the planner draws at their base rates, including the risks that come with particulars in the bio."
                            }
                          },
                          "required": [
                            "template",
                            "bio_prompt",
                            "bio_choices",
                            "pacing",
                            "curveballs",
                            "default_pace"
                          ]
                        },
                        "next": {
                          "type": "string",
                          "description": "What to do next with a wargame: its setup round with the user and, with characters, how to play them."
                        }
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "kind": {
                      "const": "past"
                    }
                  },
                  "required": [
                    "run_id",
                    "kind"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "template": "wargame-your-life"
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-10-10T09:00:00Z",
              "forked_from_run_id": null,
              "settings": {
                "bio": null,
                "modifications": null,
                "pace": "month",
                "complete": false
              },
              "setup": {
                "template": {
                  "key": "wargame-your-life",
                  "title": "Wargame your life",
                  "premise": "It is October 2026. …"
                },
                "bio_prompt": "Who is the player? …",
                "bio_choices": [
                  {
                    "key": "draft_from_context",
                    "label": "Let the assistant draft it from what it knows about you, then edit"
                  },
                  {
                    "key": "free_text",
                    "label": "Write it yourself"
                  },
                  {
                    "key": "skip",
                    "label": "Skip: play an unnamed person"
                  }
                ],
                "default_pace": "auto",
                "fields": {
                  "bio": "text, at most 6000 characters"
                },
                "privacy": "The bio, modifications and actions go to Antistatic's planner …",
                "pacing": "Each turn's length is chosen when the turn is taken.",
                "curveballs": "Curveballs are life events outside the story, drawn at their base rates."
              },
              "turns": 0,
              "history": [],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.update_setup",
      "method": "PATCH",
      "path": "/api/v1/sandbox/runs/{id}/setup",
      "summary": "Set a wargame's premise, bio and other settings.",
      "group": "sandboxes",
      "description": "Any of `title` (at most 120 characters), `premise`, `bio` (6,000), `modifications` (2,000), `pace` (`auto`, the default: each turn's length is chosen when it is taken; or a fixed length: `days`, `week`, `month`, `quarter`) and `model` (`opus`, `sonnet` or `haiku`: the model that simulates the run's next turns, info answers and briefings); omitted fields stay, empty text clears (a cleared premise or title falls back to the template's). Each change of the premise or the bio is logged with the run's date and turn (`settings.setup_log`) and sent to the planner. Any setup completes it, which turns need; a complete setup before the first turn gets an opening briefing (again when the premise, bio or modifications change, up to a daily limit). Returns the run.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "premise": {
            "type": [
              "string",
              "null"
            ]
          },
          "bio": {
            "type": [
              "string",
              "null"
            ]
          },
          "modifications": {
            "type": [
              "string",
              "null"
            ]
          },
          "pace": {
            "type": "string"
          },
          "duty_rates": {
            "type": "object",
            "description": "How often the planner's optional duties run, each a rate per 30 days from 0 to 1 (a turn of d days runs a duty with probability 1 − (1 − rate)^(d/30)): `curveball_scan` (unlikely life and world events drawn at their base rates; default 0.5), `question_review` (new run questions and items; 0.6), `ask_player` (questions for the player; 0.4).",
            "properties": {
              "curveball_scan": {
                "type": "number"
              },
              "question_review": {
                "type": "number"
              },
              "ask_player": {
                "type": "number"
              }
            }
          },
          "scout": {
            "type": "boolean",
            "description": "The world-market scout (default true): after each turn, real-world forecasts relevant to the player are checked and the few that clear its bar become run questions or items, listed in the next turn's `scout_added`."
          },
          "planner": {
            "type": "string",
            "enum": [
              "server",
              "client"
            ],
            "description": "Who plans the run's turns: server (Antistatic's model, on the monthly AI budget) or client (the player's own agent, through planner jobs; no Antistatic model calls, larger allowances)."
          },
          "sample_from": {
            "type": "string",
            "enum": [
              "house",
              "user"
            ],
            "description": "Where the run's question rolls take their odds: house (the house line) or user (the user's own forecast where they have one, else the house line). A mortal run is always house: user there is refused (422). Wargames."
          },
          "mode": {
            "type": "string",
            "enum": [
              "mortal",
              "god"
            ],
            "description": "mortal (the default for new runs): the world is drawn from the house line (sample_from is house) and the run's goals are scored with market points. god: sample_from may be user (the default in god mode); nothing is scored. sample_from user alone starts a god run. The mode can change at any time: turning god freezes the score; turning mortal prices the goals again, and new points add to the frozen score. Wargames."
          },
          "ends_on": {
            "type": [
              "string",
              "null"
            ],
            "description": "The date the game is planned to end (YYYY-MM-DD, after the clock), or null for open-ended. Play carries on past it; reaching it makes the wrap-up."
          },
          "starts_on": {
            "type": "string",
            "description": "Moves the run's start (YYYY-MM-DD, past or future) before its first turn; fixed once a turn starts (422). Questions already made for the old start are made again (422 once any has a forecast); a planned end not after the new start is dropped."
          },
          "characters": {
            "type": "array",
            "description": "Characters to add (see sandbox.start), or, with key, existing ones to change. A player (not the host) may send only characters.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "tagline": {
                  "type": "string"
                },
                "bio": {
                  "type": "string"
                },
                "controller": {
                  "type": "string",
                  "enum": [
                    "me",
                    "invitee",
                    "open",
                    "ai"
                  ],
                  "description": "Who plays it: me (the caller; the default), invitee (kept for the person whose email is `invitee`, who claims it from the invite link), open (any invited player may claim it; until then it holds) or ai (the planner plays it). Only the host gives a character to others."
                },
                "invitee": {
                  "type": "string",
                  "description": "The invitee's email, with controller invitee."
                },
                "key": {
                  "type": "string",
                  "description": "An existing character's key: changes its controller (between turns) and bio. A player may take an open, AI or kept-for-them character (controller me) or cede their own (ai or open)."
                }
              }
            }
          },
          "character": {
            "type": "string",
            "description": "A player with several characters: the one whose view comes back."
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "$ref": "#/$defs/timeline_future"
                },
                {
                  "type": "object",
                  "description": "A wargame as one of the caller's characters sees it (role guest).",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "guest"
                      ]
                    },
                    "character": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "tagline": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "bio": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "key",
                        "name",
                        "tagline",
                        "bio"
                      ]
                    },
                    "clock": {
                      "type": "string"
                    },
                    "settings": {
                      "type": "object"
                    },
                    "turns": {
                      "type": "number"
                    },
                    "history": {
                      "type": "array"
                    },
                    "questions": {
                      "type": "array"
                    },
                    "info_log": {
                      "type": "array"
                    },
                    "cast": {
                      "type": "array"
                    },
                    "url": {
                      "type": "string"
                    },
                    "turn_status": {
                      "$ref": "#/$defs/turn_status"
                    }
                  },
                  "required": [
                    "run_id",
                    "kind",
                    "role",
                    "character",
                    "clock",
                    "settings",
                    "turns",
                    "history",
                    "questions",
                    "url"
                  ]
                },
                {
                  "type": "object",
                  "description": "A player who no longer plays any character in the game.",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "left": {
                      "const": true
                    }
                  },
                  "required": [
                    "run_id",
                    "left"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "bio": "A nurse in Leeds.",
            "pace": "month"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-10-10T09:00:00Z",
              "forked_from_run_id": null,
              "settings": {
                "bio": "A nurse in Leeds.",
                "modifications": null,
                "pace": "month",
                "complete": true
              },
              "turns": 0,
              "history": [],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.take_turn",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/turns",
      "summary": "Take a wargame's turn.",
      "group": "sandboxes",
      "description": "The player's typed `entries` (each `{type, text}`, type `action`, `decree`, `feed` or `info`; at least one action or decree; at most 20 entries and 200,000 characters per character, `character` naming one, untagged the host's) and optionally `until` (an ISO date after the clock, at most a year ahead; a date-time counts as its date; default the clock plus the pace; `\"auto\"`: the planner chooses the date, keeping to the run's cadence (recent turn lengths, else the pace) or a sensible step, and the result's `until` gives it with a one-line reason, also stated under the script's header). An action is an attempt the planner forecasts; a decree happens exactly as stated; a feed is a binding correction recorded before planning (with `strike`, an observation id, it also strikes that observation); an info entry is answered from what the player already knew, as of the turn's start (`answers_as_of`), so it can't shape the turn's actions (ask those first with POST /sandbox/runs/{id}/info). `actions` (text) is deprecated: one action. The server plans the period, draws one outcome in code, moves the clock to midnight UTC of that date and narrates the drawn outcome; the response holds `script` (the narration), the observations the clock has reached, an outcome per action and decree, `answers` to info entries, the run's bars that resolved, and any run questions the planner created (`questions_created`). Idempotent by `turn_id` (the client's key, per run): a completed turn sent again with the same entries and `until` returns its stored result with `replayed: true`; the same `turn_id` with other entries or another `until` is 409 `turn_id_conflict`. A daily turn quota. Errors: 409 `setup_incomplete`, 409 `turn_in_progress`, 409 `turn_id_conflict`, 429 `turn_quota` (turns per user per day) or `info_quota` (with info entries), 503 `at_capacity` (the service's daily cap), 403 `model_requires_pro` (a free account's server turns run on Haiku only), 402 `ai_budget_exhausted` (the month's AI budget is used up; client mode still works; admins exempt), all checked on every call, retries included, 502 `planner_invalid` / `planner_refused` and 503 `planner_unavailable` (the clock has not moved; retry with the same `turn_id`). When the planner needs the player's answers before the period can be simulated, the response is `status: \"questions\"` with `questions_for_player` and nothing else happens (no turn counted, the clock stays): ask the player and retry the same `turn_id` with the answers as feed entries (`answers`: id).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "turn_id": {
            "type": "string"
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "action",
                    "decree",
                    "feed",
                    "info"
                  ]
                },
                "text": {
                  "type": "string"
                },
                "strike": {
                  "type": "string"
                },
                "settle": {
                  "type": "object",
                  "description": "feed only: settles an item of a run when-question at the clock. outcome no resolves its open bars no and closes it; yes resolves it as happened by the clock.",
                  "properties": {
                    "market": {
                      "type": "string"
                    },
                    "item": {
                      "type": "string"
                    },
                    "outcome": {
                      "type": "string",
                      "enum": [
                        "no",
                        "yes"
                      ]
                    }
                  },
                  "required": [
                    "market",
                    "outcome"
                  ]
                },
                "answers": {
                  "type": "string",
                  "description": "feed only: the id of a question put to the player (`questions_for_player`); the text is the answer. A fact answer is recorded as an established fact; a probability is information for the planner only (draws stay on the house line). An unknown id is 400."
                },
                "character": {
                  "type": "string",
                  "description": "A wargame: one of the caller's characters' keys. The entry (action or decree) is filed as that character's orders (replacing its draft, submitted) and goes with this turn."
                }
              },
              "required": [
                "type",
                "text"
              ]
            }
          },
          "actions": {
            "type": "string",
            "description": "Deprecated: one action."
          },
          "until": {
            "type": "string",
            "description": "An ISO date, or \"auto\" (the planner chooses)."
          }
        },
        "required": [
          "turn_id"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_turn"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "turn_id": "7f9c2b1e-turn-1",
            "entries": [
              {
                "type": "action",
                "text": "Ask my manager for a pay review."
              },
              {
                "type": "info",
                "text": "When is my contract up for renewal?"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "turn": {
                "index": 1,
                "from": "2026-10-10T09:00:00Z",
                "to": "2026-11-10T09:00:00Z"
              },
              "clock": "2026-11-10T09:00:00Z",
              "observations": [
                {
                  "at": "2026-10-24T09:00:00Z",
                  "text": "Your manager agrees to a pay review in January.",
                  "id": "o3f9a1c2b7d4e"
                }
              ],
              "resolved": [],
              "replayed": false,
              "action_outcomes": [
                {
                  "action": "Ask my manager for a pay review.",
                  "status": "done",
                  "note": "Your manager agreed to review your pay in January."
                }
              ],
              "entries": [
                {
                  "type": "action",
                  "text": "Ask my manager for a pay review."
                },
                {
                  "type": "info",
                  "text": "When is my contract up for renewal?"
                }
              ],
              "answers": "**When is my contract up for renewal?**\nYour contract renews on 31 March; the HR portal shows it.",
              "script": "**10 October to 10 November 2026 · T+31 days**\n\nOn 24 October your manager agrees to a pay review in January.\n\n**Results**\n- Ask my manager for a pay review: done; the review is booked for January.\n\n**Elsewhere**\nNothing in the wider world touched your month.\n\n**Markets**\nNothing resolved.\n\nWhat do you do?"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.ask",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/info",
      "summary": "Info and feed entries in a wargame, with no time passing.",
      "group": "sandboxes",
      "description": "`entries`: `{type, text}` with type `info` or `feed` (at most 20, each up to 1,000 characters). Feeds are recorded first as binding corrections (with `strike`, an observation id, also striking it); info entries are questions about what the player would already know, answered consistently with the run's hidden state and logged. The clock does not move. Pro (or admin), checked on every call. Errors: 403 `pro_required`, 429 `info_quota` (info answers per user per day), 503 `at_capacity`, 502 `planner_invalid` / `planner_refused`, 503 `planner_unavailable` (the feeds stay recorded).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "info",
                    "feed"
                  ]
                },
                "text": {
                  "type": "string"
                },
                "strike": {
                  "type": "string"
                },
                "settle": {
                  "type": "object",
                  "description": "feed only: settles an item of a run when-question at the clock. outcome no resolves its open bars no and closes it; yes resolves it as happened by the clock.",
                  "properties": {
                    "market": {
                      "type": "string"
                    },
                    "item": {
                      "type": "string"
                    },
                    "outcome": {
                      "type": "string",
                      "enum": [
                        "no",
                        "yes"
                      ]
                    }
                  },
                  "required": [
                    "market",
                    "outcome"
                  ]
                },
                "answers": {
                  "type": "string",
                  "description": "feed only: the id of a question put to the player (`questions_for_player`); the text is the answer. A fact answer is recorded as an established fact; a probability is information for the planner only (draws stay on the house line). An unknown id is 400."
                }
              },
              "required": [
                "type",
                "text"
              ]
            }
          },
          "character": {
            "type": "string",
            "description": "A wargame character's key: its info questions (a player's character sends info entries only, answered as of the clock on the caller's budget)."
          }
        },
        "required": [
          "entries"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "run_id": {
                  "type": "number"
                },
                "answer": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "feeds_recorded": {
                  "type": "number"
                }
              },
              "required": [
                "run_id",
                "answer",
                "feeds_recorded"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "entries": [
              {
                "type": "info",
                "text": "How much is in my savings account?"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "answer": "**How much is in my savings account?**\nAbout £18,000, roughly nine months of spending.",
              "feeds_recorded": 0
            }
          }
        }
      }
    },
    {
      "id": "sandbox.put_orders",
      "method": "PUT",
      "path": "/api/v1/sandbox/runs/{id}/orders",
      "summary": "Replace a wargame character's orders and submit them for the host's turn.",
      "group": "sandboxes",
      "description": "`entries` (`{type, text}`: `action` or `decree`, at most 20 and 200,000 characters) replace the character's draft. A player's character's orders are submitted for the host's next turn unless `submit` is false; the host's own go with the turn they take. `character` as for sandbox.orders.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "character": {
            "type": "string",
            "description": "A wargame character's key (c2, ...): one of your characters, whose view or orders this is; required when you have several in the game (the 422 lists them). Only that character's private material comes back."
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "action",
                    "decree",
                    "info",
                    "feed"
                  ]
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "text"
              ]
            }
          },
          "submit": {
            "type": "boolean"
          }
        },
        "required": [
          "entries"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "run_id": {
                  "type": "number"
                },
                "character": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "owner",
                    "guest"
                  ]
                },
                "entries": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "text",
                      "source"
                    ]
                  }
                },
                "submitted_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "run_id",
                "character",
                "role",
                "entries",
                "submitted_at"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "character": "c3",
            "entries": [
              {
                "type": "action",
                "text": "Announce a pause on frontier training."
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 42,
              "character": "c3",
              "role": "guest",
              "entries": [
                {
                  "id": "oAbC123",
                  "type": "action",
                  "text": "Announce a pause on frontier training.",
                  "source": "mcp"
                }
              ],
              "submitted_at": "2026-10-13T12:00:00Z"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.add_correction",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/corrections",
      "summary": "Record a fact about the player's real situation in a wargame.",
      "group": "sandboxes",
      "description": "Adds `fact` (text, at most 1,000 characters; at most 50 per run) to the run's corrections. The planner takes the run's corrections as established facts of its world from the next turn on. Returns the run.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "fact": {
            "type": "string"
          }
        },
        "required": [
          "fact"
        ]
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_future"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "fact": "The app has not launched; it has no paying users."
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-11-10T09:00:00Z",
              "forked_from_run_id": null,
              "settings": {
                "bio": "A nurse in Leeds.",
                "modifications": null,
                "pace": "month",
                "complete": true
              },
              "turns": 1,
              "history": [
                {
                  "run_id": 712,
                  "turn": {
                    "index": 1,
                    "from": "2026-10-10T09:00:00Z",
                    "to": "2026-11-10T09:00:00Z"
                  },
                  "clock": "2026-11-10T09:00:00Z",
                  "observations": [
                    {
                      "at": "2026-10-24T09:00:00Z",
                      "text": "Your manager agrees to a pay review in January.",
                      "id": "o3f9a1c2b7d4e"
                    }
                  ],
                  "resolved": []
                }
              ],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f",
              "corrections": [
                {
                  "text": "The app has not launched; it has no paying users.",
                  "at": "2026-11-10T18:02:11Z"
                }
              ],
              "struck_observations": []
            }
          }
        }
      }
    },
    {
      "id": "sandbox.set_goal",
      "method": "PUT",
      "path": "/api/v1/sandbox/runs/{id}/goals/{code}",
      "summary": "Mark a wargame's run question as a goal, with its liquidity.",
      "group": "sandboxes",
      "description": "Marks the run question `code` (one of the run's own questions) as a goal with `liquidity` (a whole number of points from 100 to 1,000: the market's budget, as on the live site), changes its liquidity, or with `remove: true` removes it. At most 10 goals; a goal's liquidity is fixed once a turn has passed since it was set. In a mortal run the player is scored on goals with the regular market points of their run positions: the budget is spread over the bars with the live engine's constant daily decay on the run's clock, and points come as bars resolve. A goal is priced when set (each open bar's house p and the player's position); only points made after count. Decrees and feeds can't settle or move a goal of a mortal run. Returns the run, with `score`. Errors: 404 (not your wargame), 422 (not a run question, liquidity out of range, a goal fixed by a turn, too many goals).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "liquidity": {
            "type": "integer",
            "minimum": 100,
            "maximum": 1000
          },
          "remove": {
            "type": "boolean"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_future"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "liquidity": 600
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-11-10T09:00:00Z",
              "forked_from_run_id": null,
              "settings": {
                "bio": "A nurse in Leeds.",
                "modifications": null,
                "pace": "month",
                "complete": true,
                "mode": "mortal"
              },
              "turns": 1,
              "history": [
                {
                  "run_id": 712,
                  "turn": {
                    "index": 1,
                    "from": "2026-10-10T09:00:00Z",
                    "to": "2026-11-10T09:00:00Z"
                  },
                  "clock": "2026-11-10T09:00:00Z",
                  "observations": [
                    {
                      "at": "2026-10-24T09:00:00Z",
                      "text": "Your manager agrees to a pay review in January.",
                      "id": "o3f9a1c2b7d4e"
                    }
                  ],
                  "resolved": []
                }
              ],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f",
              "corrections": [
                {
                  "text": "The app has not launched; it has no paying users.",
                  "at": "2026-11-10T18:02:11Z"
                }
              ],
              "struck_observations": [],
              "score": {
                "mode": "mortal",
                "scored": true,
                "goals": [
                  {
                    "market": "p712-1",
                    "title": "Date the player changes job",
                    "liquidity": 600,
                    "turn": 0,
                    "priced_at": "2026-11-10T00:00:00Z",
                    "bars": [
                      {
                        "bar": "b1",
                        "label": "Dec 2026",
                        "item": null,
                        "end_date": "2026-12-31T00:00:00Z",
                        "p0": 0.12,
                        "p": 0.12,
                        "forecast": null,
                        "resolved": false,
                        "resolved_yes": null,
                        "realised": 0.0,
                        "unrealised": 0.0
                      }
                    ],
                    "realised": 0.0,
                    "unrealised": 0.0,
                    "total": 0.0
                  }
                ],
                "total": {
                  "realised": 0.0,
                  "unrealised": 0.0,
                  "total": 0.0
                }
              }
            }
          }
        }
      }
    },
    {
      "id": "sandbox.strike",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/observations/{observation_id}/strike",
      "summary": "Strike an observation from a wargame's history.",
      "group": "sandboxes",
      "description": "Strikes an observation the run has reached (its `id` from the history or a turn's result), with `reason` (text, at most 500 characters). It stays stored for audit but is left out of the history, turn results and the planner's input. Returns the run.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "reason"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_future"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "reason": "No pay review is possible before April."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-11-10T09:00:00Z",
              "forked_from_run_id": null,
              "settings": {
                "bio": "A nurse in Leeds.",
                "modifications": null,
                "pace": "month",
                "complete": true
              },
              "turns": 1,
              "history": [
                {
                  "run_id": 712,
                  "turn": {
                    "index": 1,
                    "from": "2026-10-10T09:00:00Z",
                    "to": "2026-11-10T09:00:00Z"
                  },
                  "clock": "2026-11-10T09:00:00Z",
                  "observations": [],
                  "resolved": []
                }
              ],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f",
              "corrections": [
                {
                  "text": "The app has not launched; it has no paying users.",
                  "at": "2026-11-10T18:02:11Z"
                }
              ],
              "struck_observations": [
                {
                  "id": "o3f9a1c2b7d4e",
                  "reason": "No pay review is possible before April.",
                  "at": "2026-11-10T18:03:40Z"
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandbox.fork",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/forks",
      "summary": "Fork a sandbox run.",
      "group": "sandboxes",
      "description": "A wargame forks after `turn` (default its last; 0 is the start) into a new run with its history, clock and planner state up to then (`model` sets its planner model; default the original's), and a copy of every question as it stood after that turn: specs, links, goals, forecasts, positions, house line, liquidity and the resolutions reached by then, under the fork's own codes (p<fork id>-<n>, same n). Later changes in either run stay in that run. A past run forks at a reached `checkpoint` (key; default the current one) into a new run marked `practice`. The original is unchanged.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "turn": {
            "type": [
              "number",
              "string"
            ]
          },
          "checkpoint": {
            "type": "string"
          },
          "model": {
            "type": "string",
            "enum": [
              "opus",
              "sonnet",
              "haiku"
            ]
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "$ref": "#/$defs/timeline_future"
                },
                {
                  "type": "object",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "kind": {
                      "const": "past"
                    },
                    "practice": {
                      "type": "boolean"
                    },
                    "forked_from_run_id": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "run_id",
                    "kind",
                    "practice",
                    "forked_from_run_id"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "turn": 1
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "run_id": 713,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-11-10T09:00:00Z",
              "forked_from_run_id": 712,
              "settings": {
                "bio": "A nurse in Leeds.",
                "modifications": null,
                "pace": "month",
                "complete": true
              },
              "turns": 1,
              "history": [
                {
                  "run_id": 712,
                  "turn": {
                    "index": 1,
                    "from": "2026-10-10T09:00:00Z",
                    "to": "2026-11-10T09:00:00Z"
                  },
                  "clock": "2026-11-10T09:00:00Z",
                  "observations": [
                    {
                      "at": "2026-10-24T09:00:00Z",
                      "text": "Your manager agrees to a pay review in January."
                    }
                  ],
                  "resolved": []
                }
              ],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.importable_questions",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}/importable-questions",
      "summary": "List questions importable from your other wargames.",
      "group": "sandboxes",
      "description": "The questions in the caller's other wargames (not abandoned or deleted; archived ones included), newest runs first: `run_id`, `template`, `code`, `title`, `definition_sha256` (a hash of the question's spec without its code; identical definitions share it) and `already_here` (this run has a question with the same hash). 404 unless `id` is the caller's wargame.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "questions": [
                {
                  "run_id": 31,
                  "template": "wargame-your-life",
                  "code": "p31-2",
                  "title": "When will I change job?",
                  "definition_sha256": "3f9a…",
                  "already_here": false
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandbox.import_questions",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/questions/import",
      "summary": "Import questions from another of your wargames.",
      "group": "sandboxes",
      "description": "Copies questions `codes` from the caller's wargame `from_run_id` into run `id`: each a new question with the same definition, checked at this run's clock, and fresh state (no forecasts, positions, resolutions or goal). All or nothing. 201 with `data.imported` [{from, code}]; 422 `invalid_spec` when a definition doesn't fit this run's clock; 404 when either run isn't the caller's wargame.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "from_run_id": {
            "type": "number"
          },
          "codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "from_run_id",
          "codes"
        ]
      },
      "responses": {
        "201": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "from_run_id": 31,
            "codes": [
              "p31-2"
            ]
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "imported": [
                {
                  "from": "p31-2",
                  "code": "p30-4"
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandbox.wrapup",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/wrapup",
      "summary": "Wrap up a wargame.",
      "group": "sandboxes",
      "description": "Makes the run's wrap-up now (also made automatically when a server-planned run's clock reaches `ends_on`). A server-planned run: 201 with `status: done` and the `wrapup`, written by the run's planner model and gated and charged like a turn (`model_requires_pro`, `ai_budget_exhausted`). A client-planned run: 202 with `status: wrapup_job` and a `job_id` for the run's own planner, which reads the facts with GET /api/v1/sandbox/planner_jobs/{job_id} and submits the arc with POST .../script. Made again, the earlier wrap-up is kept (`earlier_wrapups` in the run). 422 before the first turn.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "201": {
          "$ref": "#/$defs/envelope"
        },
        "202": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 201,
          "body": {
            "data": {
              "status": "done",
              "wrapup": {
                "period": {
                  "from": "2026-10-12T00:00:00Z",
                  "to": "2027-01-10T00:00:00Z",
                  "ends_on": "2027-01-01",
                  "past_end": true,
                  "turns": 3
                },
                "arc": "You started the autumn on the ward…",
                "resolutions": [
                  {
                    "market": "p30-1",
                    "title": "When will I change job?",
                    "date": "2026-12-04",
                    "outcome": "happened"
                  }
                ],
                "turning_points": [],
                "score": null,
                "forecasts": {
                  "resolved_bars": 1,
                  "right": 1,
                  "brier": 0.04,
                  "house_brier": 0.16,
                  "best": [],
                  "worst": []
                },
                "written_by": "server",
                "model": "claude-opus-4-5",
                "generated_at": "2027-01-10T09:00:00Z"
              }
            }
          }
        }
      }
    },
    {
      "id": "sandbox.delete",
      "method": "DELETE",
      "path": "/api/v1/sandbox/runs/{id}",
      "summary": "Delete one of your sandbox runs.",
      "group": "sandboxes",
      "description": "Needs `confirm: true`. The run (a past sandbox's run, or a wargame) disappears for you everywhere: lists, `GET` and every write answer 404 for it, and its page is gone. It is a soft delete: the run and everything in it are kept, so the site's operators can restore it on request. Its forks stay, and show it as a deleted parent. A curriculum stays available: opening it again starts a new run. 404 for a run that isn't yours.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": [
              "boolean",
              "string"
            ]
          }
        },
        "required": [
          "confirm"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "deleted": {
                  "type": "boolean"
                },
                "run_id": {
                  "type": "number"
                }
              },
              "required": [
                "deleted",
                "run_id"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "confirm": true
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "deleted": true,
              "run_id": 712
            }
          }
        }
      }
    },
    {
      "id": "sandbox.update",
      "method": "PATCH",
      "path": "/api/v1/sandbox/runs/{id}",
      "summary": "Rename, archive or unarchive one of your sandbox runs.",
      "group": "sandboxes",
      "description": "`name` (up to 80 characters; empty or null clears it) renames a wargame wherever it is listed; a past sandbox keeps its curriculum's title (422). `archived: true` takes the run off your sandbox lists (the site's list shows it under Archived) without changing it: it still opens, plays and answers here; `archived: false` puts it back. Send either or both. 404 for a run that isn't yours.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived": {
            "type": [
              "boolean",
              "string"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "run_id": {
                  "type": "number"
                },
                "kind": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "run_id",
                "kind",
                "name",
                "archived"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "name": "Move to Lisbon",
            "archived": false
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "name": "Move to Lisbon",
              "archived": false
            }
          }
        }
      }
    },
    {
      "id": "sandbox.promote",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/questions/{code}/promote",
      "summary": "Copy a wargame's question into the real exchange today.",
      "group": "sandboxes",
      "description": "The question's definition is its spec in the run without the simulated `anchors` and `basis`; `spec` replaces any of its settings. Without `create` (or `create: false`) the answer is that spec and its preview as of today (as `POST /market-specs/preview`). Opening probabilities come from evidence available today, never from the sandbox's history: send `anchors` (and `basis`) in `spec`. With `create: true` it is created as `POST /market-specs` does, a normal private market owned by the caller (201); 422 `invalid_spec` while the spec has errors. The run is unchanged. `POST /markets/{code}/publication-request` can then ask for a public listing. 404 for a past sandbox's run or a code that isn't the run's question.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    },
                    "period": {
                      "type": "string"
                    },
                    "quantiles": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number"
                      }
                    }
                  }
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "title",
                              "url"
                            ]
                          }
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "cadence": {
                    "type": "string"
                  },
                  "end": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "excludes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "includes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              },
              "periods": {
                "type": "object",
                "properties": {
                  "cadence": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "cadence",
                  "from",
                  "to"
                ]
              },
              "thresholds": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "number"
                  },
                  "scale": {
                    "type": "string"
                  },
                  "to": {
                    "type": "number"
                  }
                },
                "required": [
                  "from",
                  "scale",
                  "to"
                ]
              },
              "unit": {
                "type": "string"
              }
            }
          },
          "create": {
            "type": [
              "boolean",
              "string"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "spec": {
                  "type": "object"
                },
                "preview": {
                  "type": "object",
                  "properties": {
                    "curves": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "bars": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "starting_probability": {
                                  "type": "number"
                                },
                                "threshold_date": {
                                  "type": "string"
                                },
                                "threshold": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "label",
                                "starting_probability"
                              ]
                            }
                          },
                          "curve": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "end_date": {
                            "type": "string"
                          },
                          "item": {
                            "type": "string"
                          },
                          "ladder": {
                            "type": "number"
                          },
                          "period": {
                            "type": "string"
                          },
                          "trimmed": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          }
                        },
                        "required": [
                          "bars",
                          "curve",
                          "label"
                        ]
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "example": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "field": {
                            "type": "string"
                          },
                          "fix": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "example",
                          "field",
                          "fix",
                          "message",
                          "severity"
                        ]
                      }
                    },
                    "market": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "background_info_html": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "budget": {
                          "type": "number"
                        },
                        "cumulative": {
                          "type": "boolean"
                        },
                        "end_date": {
                          "type": "string"
                        },
                        "resolution_criteria": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string"
                        },
                        "svelte_params": {
                          "type": "object",
                          "properties": {
                            "countObservationMode": {
                              "type": "string"
                            },
                            "defaultView": {
                              "type": "string"
                            },
                            "scaleBase": {
                              "type": "number"
                            },
                            "scaleType": {
                              "type": "string"
                            },
                            "timeCadence": {
                              "type": "string"
                            }
                          }
                        },
                        "title": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "visibility": {
                          "type": "string"
                        },
                        "x_unit": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "background_info_html",
                        "budget",
                        "cumulative",
                        "end_date",
                        "resolution_criteria",
                        "status",
                        "svelte_params",
                        "title",
                        "type",
                        "visibility",
                        "x_unit"
                      ]
                    },
                    "next_options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": [
                              "object",
                              "string",
                              "number",
                              "null"
                            ],
                            "properties": {
                              "end": {
                                "type": "string"
                              },
                              "start": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "end",
                              "start"
                            ]
                          },
                          "example": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "set": {
                            "type": "boolean"
                          },
                          "setting": {
                            "type": "string"
                          },
                          "values": {
                            "type": [
                              "object",
                              "array",
                              "null"
                            ],
                            "properties": {
                              "max": {
                                "type": "number"
                              },
                              "min": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "max",
                              "min"
                            ],
                            "items": {
                              "type": "string"
                            }
                          },
                          "why": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "default",
                          "example",
                          "required",
                          "set",
                          "setting",
                          "values",
                          "why"
                        ]
                      }
                    },
                    "valid": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "curves",
                    "issues",
                    "market",
                    "next_options",
                    "valid"
                  ]
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "spec",
                "preview",
                "note"
              ]
            }
          },
          "required": [
            "data"
          ]
        },
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "visibility": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "promoted_from": {
                  "type": "object",
                  "properties": {
                    "run_id": {
                      "type": "integer"
                    },
                    "market_code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "run_id",
                    "market_code"
                  ]
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "title",
                "visibility",
                "url",
                "promoted_from",
                "note"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "create": true,
            "spec": {
              "anchors": [
                {
                  "by": "2027-06",
                  "p": 0.3
                },
                {
                  "by": "2028-12",
                  "p": 0.7
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Career changes into nursing management",
                    "evidence": "About a third of ward nurses who apply are promoted within two years, from the NHS staff survey 2019-2024.",
                    "sources": [
                      {
                        "title": "NHS staff survey",
                        "url": "https://www.nhsstaffsurveys.com/"
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "code": "~6612",
              "title": "Date I become a ward manager",
              "visibility": "private",
              "url": "https://antistatic.exchange/m/~6612",
              "promoted_from": {
                "run_id": 712,
                "market_code": "p712-1"
              },
              "note": "A normal private market, owned by you, with nothing from the sandbox but its definition. To let others forecast on it, ask for a public listing (antistatic_request_public_listing)."
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.limits",
      "method": "GET",
      "path": "/api/v1/sandbox/limits",
      "summary": "Curriculum upload limits, field limits, lint rules and the T5 hindsight list.",
      "group": "sandbox authoring",
      "description": "The same numbers the server's changesets enforce; `antistatic sandbox check` applies them locally. Rule IDs are those of priv/sandboxes/RULES.md.",
      "auth": "none",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "schema_versions",
                "manifest",
                "fields",
                "rules",
                "hindsight_terms"
              ],
              "properties": {
                "schema_versions": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "manifest": {
                  "type": "object",
                  "required": [
                    "max_part_bytes",
                    "max_top_bytes",
                    "max_parts",
                    "max_items",
                    "max_checkpoints",
                    "max_bars",
                    "max_bars_per_item",
                    "max_bars_per_part"
                  ],
                  "additionalProperties": {
                    "type": "integer"
                  }
                },
                "fields": {
                  "type": "object",
                  "description": "\"<schema>.<field>\" => {min, max, pattern}; lengths in characters.",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "min": {
                        "type": "integer"
                      },
                      "max": {
                        "type": "integer"
                      },
                      "pattern": {
                        "type": "string"
                      }
                    }
                  }
                },
                "rules": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "severity",
                      "summary"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "severity": {
                        "enum": [
                          "error",
                          "warning"
                        ]
                      },
                      "summary": {
                        "type": "string"
                      }
                    }
                  }
                },
                "hindsight_terms": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "RULES.md T5: whole-word, case-insensitive; /.../ is a regular expression."
                }
              }
            }
          }
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "schema_versions": [
                2
              ],
              "manifest": {
                "max_part_bytes": 2000000,
                "max_top_bytes": 6000000,
                "max_parts": 400,
                "max_items": 1000,
                "max_checkpoints": 5000,
                "max_bars": 300000,
                "max_bars_per_item": 3000,
                "max_bars_per_part": 6000
              },
              "fields": {
                "bar.key": {
                  "max": 255
                }
              },
              "rules": [
                {
                  "id": "T5",
                  "severity": "warning",
                  "summary": "Hindsight vocabulary (hindsight_terms) in learner-visible text."
                }
              ],
              "hindsight_terms": [
                "seminal",
                "would later"
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.put_part",
      "method": "PUT",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/parts/{sha256}",
      "summary": "Store one content-addressed part of a curriculum draft.",
      "group": "sandbox authoring",
      "description": "`sha256` is the hex SHA-256 of the exact body. 201 when stored, 200 (`stored: false`) when the draft already has it. Creates the draft if new. Parts hold compact items with their own disclosures and resolution requests; nothing is imported until the manifest arrives.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object"
            },
            "description": "Compact (schema_version 2) items."
          },
          "disclosures": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "resolution_requests": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "stored",
                "sha256",
                "items",
                "bars",
                "bytes"
              ],
              "properties": {
                "stored": {
                  "type": "boolean"
                },
                "sha256": {
                  "type": "string"
                },
                "items": {
                  "type": "integer"
                },
                "bars": {
                  "type": "integer"
                },
                "bytes": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "201": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "stored",
                "sha256",
                "items",
                "bars",
                "bytes"
              ],
              "properties": {
                "stored": {
                  "type": "boolean"
                },
                "sha256": {
                  "type": "string"
                },
                "items": {
                  "type": "integer"
                },
                "bars": {
                  "type": "integer"
                },
                "bytes": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "413": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "items": [
              {
                "key": "b001"
              }
            ]
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "stored": true,
              "sha256": "a100000000000000000000000000000000000000000000000000000000000000",
              "items": 1,
              "bars": 24,
              "bytes": 5120
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.put_manifest",
      "method": "PUT",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/manifest",
      "summary": "Send a draft's manifest (top level and ordered part hashes) and start its import.",
      "group": "sandbox authoring",
      "description": "202 starts a background import (one part per transaction); poll status. 200 when the draft already has this manifest. 409 `draft_changed` when `base_sha256` is not the draft's current manifest; 422 `missing_parts` lists the hashes to send. Sending the manifest again resumes a failed or interrupted import.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "schema_version",
          "manifest_sha256",
          "top",
          "parts"
        ],
        "properties": {
          "schema_version": {
            "const": 2
          },
          "source": {
            "type": "object",
            "properties": {
              "commit": {
                "type": "string"
              },
              "dirty": {
                "type": "boolean"
              }
            }
          },
          "manifest_sha256": {
            "type": "string"
          },
          "base_sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "top": {
            "type": "object",
            "required": [
              "checkpoints"
            ],
            "properties": {
              "curriculum": {
                "type": "object"
              },
              "checkpoints": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "disclosures": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "resolution_requests": {
                "type": "array",
                "maxItems": 0
              },
              "resolved_through": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "parts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "202": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "413": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "schema_version": 2,
            "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000",
            "base_sha256": null,
            "source": {
              "commit": "5b2e6c65b",
              "dirty": false
            },
            "top": {
              "curriculum": {
                "title": "Biology"
              },
              "checkpoints": [
                {
                  "key": "cp000"
                }
              ],
              "disclosures": []
            },
            "parts": [
              "a100000000000000000000000000000000000000000000000000000000000000",
              "b200000000000000000000000000000000000000000000000000000000000000"
            ]
          }
        },
        "response": {
          "status": 202,
          "body": {
            "data": {
              "slug": "biology",
              "version": "1.1",
              "state": "importing",
              "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000",
              "source_commit": "5b2e6c65b",
              "schema_version": 2,
              "parts_expected": 2,
              "parts_received": 2,
              "parts_imported": 0,
              "received": [
                "a100000000000000000000000000000000000000000000000000000000000000",
                "b200000000000000000000000000000000000000000000000000000000000000"
              ],
              "error": null
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.draft_status",
      "method": "GET",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/status",
      "summary": "A curriculum version's push and import status.",
      "group": "sandbox authoring",
      "description": "Counts and hashes only. `error` has a code and a path; its message only for owners and editors who are not learners of the curriculum.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "biology",
              "version": "1.1",
              "state": "imported",
              "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000",
              "source_commit": "5b2e6c65b",
              "schema_version": 2,
              "parts_expected": 2,
              "parts_received": 2,
              "parts_imported": 2,
              "received": [
                "a100000000000000000000000000000000000000000000000000000000000000",
                "b200000000000000000000000000000000000000000000000000000000000000"
              ],
              "error": null
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.create_draft",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}",
      "summary": "Start a curriculum draft built a piece at a time.",
      "group": "sandbox authoring",
      "description": "Makes the curriculum when the slug is new (a first curriculum is free; more need Pro, 403 `pro_required`; non-admins' curricula stay `restricted`) and starts, or reopens, the version's draft with an empty working manifest. `title`, `description` (plain text) and `resolved_through` (a date) are optional. A draft already pushed with a manifest is 409 `pushed_draft`. Then add checkpoints, questions and disclosures and validate: `validate` imports the working manifest first. Limits: 40 questions, 60 checkpoints, 200 disclosures; push larger curricula.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "resolved_through": {
            "type": "string"
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "title": "RNAi, 1998-2006",
            "description": "From the first worm papers to the first trials."
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [],
                "questions": [],
                "disclosures": []
              }
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.add_checkpoint",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/checkpoints",
      "summary": "Add or replace a checkpoint in a draft's working manifest.",
      "group": "sandbox authoring",
      "description": "`key`, `title` and `occurred_at` (a date or ISO date-time), optional `body_html`. An entry with the same key replaces the earlier one. `sequence` follows `occurred_at`, then the order added. Returns the draft status (`receiving`).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "key",
          "title",
          "occurred_at"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string"
          },
          "body_html": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "key": "cp01",
            "title": "February 1998",
            "occurred_at": "1998-02-19"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [
                  "cp01"
                ],
                "questions": [],
                "disclosures": []
              }
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.add_question",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/questions",
      "summary": "Add or replace a question (one compact-manifest item) in a draft.",
      "group": "sandbox authoring",
      "description": "One item in the compact format (`/sandbox/manifest.md`). Its shape is checked now (422 with a `path`, never a value); the publish rules run on validate. An item with the same key replaces the earlier one.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "key",
          "title",
          "introduced_at",
          "market"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "introduced_at": {
            "type": "string",
            "description": "A checkpoint key."
          },
          "sort_order": {
            "type": "integer"
          },
          "market": {
            "type": "object",
            "required": [
              "code",
              "type",
              "budget",
              "resolution_criteria",
              "x_unit"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "2-40 characters, [a-z0-9_-]; the question's stable identity in the curriculum."
              },
              "type": {
                "enum": [
                  "count",
                  "date"
                ]
              },
              "budget": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "resolution_criteria": {
                "type": "string"
              },
              "x_unit": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "background_info_html": {
                "type": "string"
              },
              "cumulative": {
                "type": "boolean"
              },
              "end_date": {
                "type": "string"
              },
              "resolution_date": {
                "type": "string"
              },
              "number_format": {
                "type": "string"
              },
              "svelte_params": {
                "type": "object"
              }
            }
          },
          "curves": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "keys",
                "thresholds",
                "p0"
              ],
              "properties": {
                "group": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "projection_group; omit for none."
                },
                "keys": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "thresholds": {
                  "type": "array",
                  "items": {
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "description": "Numbers on count markets, ISO date-times on date markets."
                },
                "p0": {
                  "type": "array",
                  "items": {
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "description": "Opening probabilities, 0.001-0.999."
                },
                "labels": {
                  "type": [
                    "array",
                    "string",
                    "null"
                  ]
                },
                "end_dates": {
                  "type": [
                    "array",
                    "string",
                    "null"
                  ]
                },
                "closes_at": {
                  "type": [
                    "array",
                    "string"
                  ]
                },
                "resolves_at": {
                  "type": [
                    "array",
                    "string",
                    "null"
                  ]
                },
                "outcomes": {
                  "type": [
                    "array",
                    "boolean",
                    "null"
                  ]
                },
                "resolution": {
                  "type": [
                    "array",
                    "string"
                  ],
                  "description": "prepared (default) or learner."
                },
                "liquidity_schedule": {
                  "type": [
                    "array",
                    "object",
                    "null"
                  ]
                }
              }
            }
          },
          "submarkets": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "The per-bar form, instead of curves."
          },
          "liquidity_cuts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "house_reprices": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "occurrences": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "count_observations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "key": "q01",
            "title": "First RNAi therapy enters human trials",
            "introduced_at": "cp01",
            "market": {
              "code": "rnai-trial",
              "type": "date",
              "budget": 100,
              "resolution_criteria": "A registered trial of an RNAi therapeutic doses its first patient.",
              "x_unit": "date"
            },
            "curves": [
              {
                "keys": [
                  "y2002",
                  "y2004"
                ],
                "thresholds": [
                  "2002-12-31T23:59:59Z",
                  "2004-12-31T23:59:59Z"
                ],
                "p0": [
                  0.1,
                  0.3
                ],
                "closes_at": "cp02",
                "resolves_at": [
                  "cp02",
                  "cp03"
                ],
                "outcomes": [
                  false,
                  true
                ]
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [
                  "cp01",
                  "cp02",
                  "cp03"
                ],
                "questions": [
                  "q01"
                ],
                "disclosures": []
              }
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.add_disclosure",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/disclosures",
      "summary": "Add or replace a disclosure in a draft's working manifest.",
      "group": "sandbox authoring",
      "description": "`key`, `checkpoint`, `title` and `body_html`; optional `item` (a question key), `kind` (`evidence`, `result`, `admin_explanation`) and `source_url` (an archived link, RULES.md S2). An entry with the same key replaces the earlier one.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "key",
          "checkpoint",
          "title",
          "body_html"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "checkpoint": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body_html": {
            "type": "string"
          },
          "item": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "source_url": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "key": "d01",
            "checkpoint": "cp01",
            "item": "q01",
            "kind": "evidence",
            "title": "Fire and Mello in Nature",
            "body_html": "<p>Double-stranded RNA silences genes in worms.</p>"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [
                  "cp01",
                  "cp02",
                  "cp03"
                ],
                "questions": [
                  "q01"
                ],
                "disclosures": [
                  "d01"
                ]
              }
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.validate_draft",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/validate",
      "summary": "Validate an imported draft: publish rules (errors) and lint (warnings tagged with RULES.md IDs).",
      "group": "sandbox authoring",
      "description": "A draft built a piece at a time (`POST drafts/{version}` and its checkpoints, questions and disclosures) is imported first when it has changed: 422 with a `path` when it lacks checkpoints or questions or its import fails. A learner of the curriculum gets counts only (`errors` redacted, `lint` empty, `lint_counts` kept).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "valid",
                "errors",
                "warnings",
                "unresolved_past_bar_count",
                "lint",
                "lint_counts"
              ],
              "properties": {
                "valid": {
                  "type": "boolean"
                },
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unresolved_past_bar_count": {
                  "type": "integer"
                },
                "lint": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "rule",
                      "where"
                    ],
                    "properties": {
                      "rule": {
                        "type": "string"
                      },
                      "where": {
                        "type": "string"
                      },
                      "term": {
                        "type": "string"
                      }
                    }
                  }
                },
                "lint_counts": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "valid": true,
              "errors": [],
              "warnings": [],
              "unresolved_past_bar_count": 0,
              "lint": [
                {
                  "rule": "T5",
                  "where": "items[b012].title",
                  "term": "eventually"
                }
              ],
              "lint_counts": {
                "T5": 1
              }
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.publish_draft",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}/publish",
      "summary": "Publish an imported, valid draft atomically.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "slug",
                "version",
                "status",
                "published_at",
                "manifest_sha256"
              ],
              "properties": {
                "slug": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "published_at": {
                  "type": "string"
                },
                "manifest_sha256": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "biology",
              "version": "1.1",
              "status": "published",
              "published_at": "2026-10-10T20:00:00Z",
              "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000"
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.delete_draft",
      "method": "DELETE",
      "path": "/api/v1/sandbox/curricula/{slug}/drafts/{version}",
      "summary": "Delete a curriculum draft and its staged parts.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "deleted"
              ],
              "properties": {
                "deleted": {
                  "const": true
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "deleted": true
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.grant",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/members",
      "summary": "Make an account (username or email) a learner, editor or owner of a curriculum.",
      "group": "sandbox authoring",
      "description": "Bots are refused, and an account with a run in the curriculum cannot be an editor or owner.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "user",
          "role"
        ],
        "properties": {
          "user": {
            "type": "string"
          },
          "role": {
            "enum": [
              "learner",
              "editor",
              "owner"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "user_id",
                "username",
                "role"
              ],
              "properties": {
                "user_id": {
                  "type": "integer"
                },
                "username": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "role": {
                  "type": "string"
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "422": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {
          "body": {
            "user": "nonstationary",
            "role": "learner"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "user_id": 42,
              "username": "nonstationary",
              "role": "learner"
            }
          }
        }
      }
    },
    {
      "id": "sandboxes.revoke",
      "method": "DELETE",
      "path": "/api/v1/sandbox/curricula/{slug}/members/{user_id}",
      "summary": "Remove an account from a curriculum.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "removed"
              ],
              "properties": {
                "removed": {
                  "const": true
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "422": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "removed": true
            }
          }
        }
      }
    },
    {
      "id": "bot.show",
      "method": "GET",
      "path": "/api/v1/me/bot",
      "summary": "Your bot account, if you have one.",
      "group": "account",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "bot": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "paused": {
                  "type": "boolean"
                },
                "profile_url": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              },
              "required": [
                "paused",
                "profile_url",
                "username"
              ]
            }
          },
          "required": [
            "bot"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "bot": null
          }
        }
      }
    },
    {
      "id": "publication_request.show",
      "method": "GET",
      "path": "/api/v1/markets/{code}/publication-request",
      "summary": "The public-listing request for a market you own.",
      "group": "your markets",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "market": {
                  "type": "string"
                },
                "request": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "admin_note": {
                      "type": "string"
                    },
                    "decided_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "admin_note",
                    "decided_at",
                    "id",
                    "message",
                    "requested_at",
                    "status",
                    "updated_at"
                  ]
                },
                "visibility": {
                  "type": "string"
                }
              },
              "required": [
                "market",
                "request",
                "visibility"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "market": "t12418",
              "request": null,
              "visibility": "private"
            }
          }
        }
      }
    },
    {
      "id": "plan.show",
      "method": "GET",
      "path": "/api/v1/me/plan",
      "summary": "Your plan tier (free, pro or supporter) and its limits.",
      "group": "account",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "billing_configured": {
                  "type": "boolean"
                },
                "can_share_private_markets": {
                  "type": "boolean"
                },
                "current_period_end": {
                  "type": "null"
                },
                "lapsed": {
                  "type": "boolean"
                },
                "manage_url": {
                  "type": "string"
                },
                "past_due": {
                  "type": "boolean"
                },
                "plan": {
                  "type": "string"
                },
                "share_member_limit": {
                  "type": "number"
                },
                "status": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "billing_configured",
                "can_share_private_markets",
                "current_period_end",
                "lapsed",
                "manage_url",
                "past_due",
                "plan",
                "share_member_limit",
                "status"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "billing_configured": false,
              "can_share_private_markets": true,
              "current_period_end": null,
              "lapsed": false,
              "manage_url": "http://localhost:4002/users/settings",
              "past_due": false,
              "plan": "pro",
              "share_member_limit": 25,
              "status": null
            }
          }
        }
      }
    },
    {
      "id": "settings.show",
      "method": "GET",
      "path": "/api/v1/me/settings",
      "summary": "Your notification and forecasting settings.",
      "group": "account",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "settings": {
              "type": "object",
              "properties": {
                "auto_double_down": {
                  "type": "boolean"
                },
                "bot": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "paused": {
                      "type": "boolean"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "paused",
                    "username"
                  ]
                },
                "email": {
                  "type": "object",
                  "properties": {
                    "bot_comments": {
                      "type": "boolean"
                    },
                    "double_down_opportunities": {
                      "type": "boolean"
                    },
                    "forecast_resolution": {
                      "type": "boolean"
                    },
                    "market_resolution": {
                      "type": "boolean"
                    },
                    "mentions": {
                      "type": "boolean"
                    },
                    "new_comments": {
                      "type": "boolean"
                    },
                    "replies": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "bot_comments",
                    "double_down_opportunities",
                    "forecast_resolution",
                    "market_resolution",
                    "mentions",
                    "new_comments",
                    "replies"
                  ]
                },
                "follow_own_markets": {
                  "type": "boolean"
                },
                "sensitive_settings_url": {
                  "type": "string"
                },
                "subscribe_to_own_market_comments": {
                  "type": "boolean"
                },
                "show_other_players_comments": {
                  "type": "boolean"
                },
                "share_sandbox_comments": {
                  "type": "boolean"
                }
              },
              "required": [
                "auto_double_down",
                "bot",
                "email",
                "follow_own_markets",
                "sensitive_settings_url",
                "share_sandbox_comments",
                "show_other_players_comments",
                "subscribe_to_own_market_comments"
              ]
            }
          },
          "required": [
            "settings"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "settings": {
              "auto_double_down": false,
              "bot": null,
              "email": {
                "bot_comments": false,
                "double_down_opportunities": true,
                "forecast_resolution": true,
                "market_resolution": true,
                "mentions": true,
                "new_comments": true,
                "replies": true
              },
              "follow_own_markets": true,
              "sensitive_settings_url": "http://localhost:4002/users/settings",
              "subscribe_to_own_market_comments": true,
              "show_other_players_comments": false,
              "share_sandbox_comments": false
            }
          }
        }
      }
    },
    {
      "id": "market_follow.show",
      "method": "GET",
      "path": "/api/v1/markets/{code}/follow",
      "summary": "Whether you follow a market and are subscribed to its comments.",
      "group": "account",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "following": {
              "type": "boolean"
            },
            "subscribed": {
              "type": "boolean"
            }
          },
          "required": [
            "following",
            "subscribed"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "following": true,
            "subscribed": false
          }
        }
      }
    },
    {
      "id": "sharing.show_link",
      "method": "GET",
      "path": "/api/v1/markets/{code}/share-link",
      "summary": "The live share link for a private market you own (Pro).",
      "group": "sharing",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "created_at": {
                  "type": "string"
                },
                "expires_at": {
                  "type": "string"
                },
                "revoked_at": {
                  "type": "null"
                },
                "state": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "created_at",
                "expires_at",
                "revoked_at",
                "state",
                "url"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "created_at": "2026-10-10T19:18:06Z",
              "expires_at": "2026-10-17T19:18:06Z",
              "revoked_at": null,
              "state": "active",
              "url": "http://localhost:4002/share/qXKUlRVlSVL_Fi379UhTKauk"
            }
          }
        }
      }
    },
    {
      "id": "sharing.list_requests",
      "method": "GET",
      "path": "/api/v1/markets/{code}/access-requests",
      "summary": "Pending requests to join a private market you own.",
      "group": "sharing",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "decided_at": {
                    "type": "null"
                  },
                  "id": {
                    "type": "number"
                  },
                  "requested_at": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "username": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "username"
                    ]
                  }
                },
                "required": [
                  "decided_at",
                  "id",
                  "requested_at",
                  "status",
                  "user"
                ]
              }
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "decided_at": null,
                "id": 102,
                "requested_at": "2026-10-10T19:18:05Z",
                "status": "pending",
                "user": {
                  "id": 8070,
                  "username": "yzfxbew"
                }
              }
            ]
          }
        }
      }
    },
    {
      "id": "sharing.list_members",
      "method": "GET",
      "path": "/api/v1/markets/{code}/members",
      "summary": "Members of a private market you own.",
      "group": "sharing",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "number"
                },
                "limit": {
                  "type": "number"
                },
                "members": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "joined_at": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string"
                      },
                      "user_id": {
                        "type": "number"
                      },
                      "username": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "joined_at",
                      "role",
                      "user_id",
                      "username"
                    ]
                  }
                }
              },
              "required": [
                "count",
                "limit",
                "members"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "count": 0,
              "limit": 25,
              "members": []
            }
          }
        }
      }
    },
    {
      "id": "trade.create",
      "method": "POST",
      "path": "/api/v1/markets/{code}/positions",
      "summary": "Submit a forecast: bar probabilities, targets or a shift. Changes your forecast and points.",
      "group": "forecasting",
      "description": "Send `updates` (`[{\"submarket\": \"sm_42\", \"probability\": 0.65}]`), `targets` and/or a `shift`. Each update moves your forecast on that bar; the cost follows the LMSR. Returns 201.\n\nBars on a curve stay in order: date curves don't fall from earlier to later dates, count curves don't rise with the threshold. A forecast that breaks the order is refused (422 `out_of_order`, naming the bars, with `keep_in_order_preview`) unless `rest_of_curve` is `keep_in_order` (other bars move only as far as order needs) or `interpolate` (bars between yours sit on a straight line). Your bars are kept as sent.\n\nA target (`{\"curve\": ..., \"threshold\" or \"label\": ..., \"probability\": ...}`) sets one point exactly and the rest of its curve follows by the same log-odds change; several targets interpolate between them. A `shift` (`{\"curve\": ..., \"quantile\": 0.5, \"by\": \"+10%\"}` or `\"to\"`) moves a quantile. `curve` can be left out when the market has one open curve. With targets or a shift, `rest_of_curve` defaults to `keep_in_order`.\n\nWith `X-Antistatic-Run`, the forecast is on a question of your wargame run (a goal is scored this way), as of its clock.",
      "auth": "write",
      "headers": [
        "x-antistatic-run",
        "x-antistatic-as"
      ],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "updates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "probability": {
                  "type": [
                    "string",
                    "number"
                  ]
                },
                "submarket": {
                  "type": "string"
                },
                "submarket_id": {
                  "type": "number"
                }
              },
              "required": [
                "probability"
              ]
            }
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "probability": {
                  "type": "number"
                },
                "threshold": {
                  "type": "number"
                }
              },
              "required": [
                "probability",
                "threshold"
              ]
            }
          },
          "rest_of_curve": {
            "type": "string"
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "canonicalization_adjusted_count": {
                  "type": "number"
                },
                "results": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "canonicalization_adjusted": {
                        "type": "boolean"
                      },
                      "canonicalization_delta": {
                        "type": "number"
                      },
                      "cost": {
                        "type": "number"
                      },
                      "intended_probability": {
                        "type": "number"
                      },
                      "money_cost_delta": {
                        "type": "number"
                      },
                      "money_points_cashed_out": {
                        "type": "number"
                      },
                      "money_points_invested": {
                        "type": "number"
                      },
                      "money_shares_delta": {
                        "type": "number"
                      },
                      "requested_probability": {
                        "type": "number"
                      },
                      "shares_yes": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "submarket": {
                        "type": "string"
                      },
                      "topup_cost": {
                        "type": "number"
                      },
                      "topup_shares": {
                        "type": "number"
                      },
                      "filled": {
                        "type": "boolean"
                      },
                      "error": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "submarket"
                    ]
                  }
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "canonicalization_adjusted_count",
                "results",
                "status"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "updates": [
              {
                "probability": 0.7,
                "submarket": "sm_38885"
              }
            ]
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "canonicalization_adjusted_count": 0,
              "results": [
                {
                  "canonicalization_adjusted": false,
                  "canonicalization_delta": 0.0,
                  "cost": 0.0,
                  "intended_probability": 0.7,
                  "money_cost_delta": 0.0,
                  "money_points_cashed_out": 0.0,
                  "money_points_invested": 0.0,
                  "money_shares_delta": 0.0,
                  "requested_probability": 0.7,
                  "shares_yes": 4.4183275227903925e-10,
                  "status": "ok",
                  "submarket": "sm_38885",
                  "topup_cost": 0.0,
                  "topup_shares": 0.0
                }
              ],
              "status": "ok"
            }
          }
        }
      }
    },
    {
      "id": "comment.create",
      "method": "POST",
      "path": "/api/v1/markets/{code}/comments",
      "summary": "Post a comment or a reply.",
      "group": "comments",
      "description": "Send `body` (plain text, or Markdown with `format: \"markdown\"`) or `body_html`; `parent_id` replies. Returns 201 with the comment. A reply notifies the parent's author; @mentions notify those named.",
      "auth": "comment",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "parent_id": {
            "type": "number"
          },
          "body_html": {
            "type": "string"
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "body_html": {
                  "type": "string"
                },
                "body_text": {
                  "type": "string"
                },
                "created_via": {
                  "type": "string"
                },
                "edited_at": {
                  "type": "null"
                },
                "id": {
                  "type": "number"
                },
                "inserted_at": {
                  "type": "string"
                },
                "parent_id": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "reply_count": {
                  "type": "number"
                },
                "score": {
                  "type": "number"
                },
                "total_tips": {
                  "type": "number"
                },
                "user": {
                  "type": "object",
                  "properties": {
                    "bot": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "number"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "bot",
                    "id",
                    "username"
                  ]
                }
              },
              "required": [
                "body_html",
                "body_text",
                "created_via",
                "edited_at",
                "id",
                "inserted_at",
                "parent_id",
                "reply_count",
                "score",
                "total_tips",
                "user"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "body": "Bot here"
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "body_html": "Bot here",
              "body_text": "Bot here",
              "created_via": "web",
              "edited_at": null,
              "id": 1177,
              "inserted_at": "2026-10-10T19:22:20Z",
              "parent_id": null,
              "reply_count": 0,
              "score": 1,
              "total_tips": 0,
              "user": {
                "bot": true,
                "id": 8928,
                "username": "finn-bot"
              }
            }
          }
        }
      }
    },
    {
      "id": "comment.update",
      "method": "PUT",
      "path": "/api/v1/markets/{code}/comments/{comment_id}",
      "summary": "Edit your comment.",
      "group": "comments",
      "auth": "comment",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "body_html": {
                  "type": "string"
                },
                "body_text": {
                  "type": "string"
                },
                "created_via": {
                  "type": "string"
                },
                "edited_at": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "inserted_at": {
                  "type": "string"
                },
                "parent_id": {
                  "type": "null"
                },
                "reply_count": {
                  "type": "number"
                },
                "score": {
                  "type": "number"
                },
                "total_tips": {
                  "type": "number"
                },
                "user": {
                  "type": "object",
                  "properties": {
                    "bot": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "number"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "bot",
                    "id",
                    "username"
                  ]
                }
              },
              "required": [
                "body_html",
                "body_text",
                "created_via",
                "edited_at",
                "id",
                "inserted_at",
                "parent_id",
                "reply_count",
                "score",
                "total_tips",
                "user"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "body": "Edited"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "body_html": "Edited",
              "body_text": "Edited",
              "created_via": "api",
              "edited_at": "2026-10-10T19:22:20Z",
              "id": 1177,
              "inserted_at": "2026-10-10T19:22:20Z",
              "parent_id": null,
              "reply_count": 0,
              "score": 1,
              "total_tips": 0,
              "user": {
                "bot": true,
                "id": 8928,
                "username": "finn-bot"
              }
            }
          }
        }
      }
    },
    {
      "id": "pending_edit.update",
      "method": "PUT",
      "path": "/api/v1/markets/{code}/pending-edits",
      "summary": "Stage a forecast for review on the site, without submitting it.",
      "group": "forecasting",
      "description": "Takes the same `updates`, `targets`, `shift` and `rest_of_curve` as submitting a forecast, and leaves the change staged for you to review and submit on the market page. `mode: \"replace\"` replaces the staged forecast instead of merging into it.",
      "auth": "write",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "updates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "probability": {
                  "type": [
                    "string",
                    "number"
                  ]
                },
                "submarket_id": {
                  "type": "number"
                },
                "is_fixed": {
                  "type": "boolean"
                },
                "submarket": {
                  "type": "string"
                }
              },
              "required": [
                "probability"
              ]
            }
          },
          "mode": {
            "type": "string"
          },
          "rest_of_curve": {
            "type": "string"
          },
          "shift": {
            "type": "object",
            "properties": {
              "quantile": {
                "type": "number"
              },
              "to": {
                "type": "number"
              }
            },
            "required": [
              "quantile",
              "to"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "is_fixed": {
                    "type": "boolean"
                  },
                  "probability": {
                    "type": "number"
                  }
                },
                "required": [
                  "probability"
                ]
              }
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "updates": [
              {
                "probability": 0.7,
                "submarket": "sm_39053"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "sm_39053": {
                "probability": 0.7
              }
            }
          }
        }
      }
    },
    {
      "id": "pending_edit.delete",
      "method": "DELETE",
      "path": "/api/v1/markets/{code}/pending-edits",
      "summary": "Discard your staged forecast.",
      "group": "forecasting",
      "auth": "write",
      "headers": [
        "x-antistatic-as"
      ],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "status"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "status": "ok"
            }
          }
        }
      }
    },
    {
      "id": "bot.create",
      "method": "POST",
      "path": "/api/v1/me/bot",
      "summary": "Create your bot account.",
      "group": "account",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "bot": {
              "type": "object",
              "properties": {
                "paused": {
                  "type": "boolean"
                },
                "profile_url": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              },
              "required": [
                "paused",
                "profile_url",
                "username"
              ]
            }
          },
          "required": [
            "bot"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 201,
          "body": {
            "bot": {
              "paused": false,
              "profile_url": "http://localhost:4002/u/finn-bot",
              "username": "finn-bot"
            }
          }
        }
      }
    },
    {
      "id": "sandbox_curriculum.append_items",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/versions/{version}/items",
      "summary": "Add new questions to a published curriculum release mid-run.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "introduced_at": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "market": {
                  "type": "object",
                  "properties": {
                    "budget": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "cumulative": {
                      "type": "boolean"
                    },
                    "resolution_criteria": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "x_unit": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "budget",
                    "code",
                    "cumulative",
                    "resolution_criteria",
                    "type",
                    "x_unit"
                  ]
                },
                "submarkets": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "closes_at": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "initial_probability": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string"
                      },
                      "resolved_yes": {
                        "type": "boolean"
                      },
                      "resolves_at": {
                        "type": "string"
                      },
                      "threshold_date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "closes_at",
                      "end_date",
                      "initial_probability",
                      "key",
                      "resolves_at",
                      "threshold_date"
                    ]
                  }
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "introduced_at",
                "key",
                "market",
                "submarkets",
                "title"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "items": [
              {
                "introduced_at": "cp2",
                "key": "p",
                "market": {
                  "budget": "100",
                  "code": "wl4642p",
                  "cumulative": true,
                  "resolution_criteria": "First gadget shipped.",
                  "type": "date",
                  "x_unit": "date"
                },
                "submarkets": [
                  {
                    "closes_at": "cp3",
                    "end_date": "2001-12-31T00:00:00Z",
                    "initial_probability": "0.5",
                    "key": "dec",
                    "resolved_yes": true,
                    "resolves_at": "cp3",
                    "threshold_date": "2001-12-31T00:00:00Z"
                  },
                  {
                    "closes_at": "cp4",
                    "end_date": "2002-12-31T00:00:00Z",
                    "initial_probability": "0.8",
                    "key": "y02",
                    "resolved_yes": true,
                    "resolves_at": "cp4",
                    "threshold_date": "2002-12-31T00:00:00Z"
                  }
                ],
                "title": "When does gadget p ship?"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "added": [
                {
                  "appended_at": "2026-10-10T19:31:15Z",
                  "key": "p",
                  "title": "When does gadget p ship?"
                }
              ],
              "slug": "retro-4674",
              "status": "published",
              "unresolved_past_bar_count": 0,
              "version": "0.1",
              "warnings": []
            }
          }
        }
      }
    },
    {
      "id": "sandbox_curriculum.runs",
      "method": "GET",
      "path": "/api/v1/sandbox/curricula/{slug}/runs",
      "summary": "Runs of a curriculum you author.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "attempt": 1,
                "checkpoint_at": "2001-09-01T00:00:00Z",
                "checkpoint_key": "cp2",
                "checkpoint_sequence": 2,
                "id": 690,
                "learner": "fbhvkvm",
                "status": "active",
                "version": "0.1"
              }
            ]
          }
        }
      }
    },
    {
      "id": "sandbox_curriculum.resolve_bars",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/versions/{version}/resolutions",
      "summary": "Record outcomes for a curriculum version's bars.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "resolutions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "type": "string"
                },
                "outcome": {
                  "type": "string"
                },
                "resolves_at": {
                  "type": "string"
                },
                "submarket": {
                  "type": "string"
                }
              },
              "required": [
                "item",
                "outcome",
                "resolves_at",
                "submarket"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "resolutions": [
              {
                "item": "when",
                "outcome": "yes",
                "resolves_at": "cp4",
                "submarket": "y04"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "resolved": 1,
              "slug": "widget-open-86242"
            }
          }
        }
      }
    },
    {
      "id": "sandbox_curriculum.extend_item",
      "method": "POST",
      "path": "/api/v1/sandbox/curricula/{slug}/versions/{version}/items/{code}/extend",
      "summary": "Widen a published curriculum question's thresholds.",
      "group": "sandbox authoring",
      "description": "For curriculum owners and editors: widens a published how-much question's thresholds in place (`code`: its code or item key), as adding questions to a published release does. `thresholds` `{to, from}`: a new top and/or bottom, the ladder continued at its scale and spacing; `anchors`: as a market spec's (`[{period, quantiles: {10, 50, 90}}]`, periods by end date) to price the new bars, joined onto each period's end bar; each house reprice of the question prices them too. New bars settle from the question's count observations (at the end bar's resolves_at, or the observation's if later), else from the end bar's outcome (NO past a miss, YES below a reach), else from `values` (`{period: value}`, the period's recorded value); never drawn. In a release with `resolved_through` an undecided bar stays open (listed in `needs_value`, resolved through `resolutions`); otherwise the period needs a value. Every published minor of the major that has the question gets the same bars (`releases`). Runs see them from their next read; positions, forecasts and scores don't change. Each period keeps its liquidity. The release's structure now includes them, so a later minor of the same major must carry `bars` (manifest form). Later periods and when-questions change in a new major release. `preview: true` checks without changing anything.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "thresholds": {
            "type": "object",
            "properties": {
              "to": {
                "type": "number"
              },
              "from": {
                "type": "number"
              }
            }
          },
          "anchors": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "values": {
            "type": "object"
          },
          "preview": {
            "type": "boolean"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "preview": {
                  "type": "boolean"
                },
                "releases": {
                  "type": "number"
                },
                "added": {
                  "type": "number"
                },
                "settled": {
                  "type": "number"
                },
                "needs_value": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "bars": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "threshold": {
                        "type": "number"
                      },
                      "group": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "p0": {
                        "type": "number"
                      },
                      "closes_at": {
                        "type": "string"
                      },
                      "resolves_at": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "resolved_yes": {
                        "type": [
                          "boolean",
                          "null"
                        ]
                      },
                      "resolution": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "threshold",
                      "group",
                      "end_date",
                      "p0",
                      "closes_at",
                      "resolves_at",
                      "resolved_yes",
                      "resolution"
                    ]
                  }
                }
              },
              "required": [
                "slug",
                "version",
                "code",
                "preview",
                "releases",
                "added",
                "settled",
                "needs_value",
                "bars"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "thresholds": {
              "to": 50
            },
            "anchors": [
              {
                "period": "2002-12-31",
                "quantiles": {
                  "10": 10,
                  "50": 22,
                  "90": 42
                }
              }
            ],
            "preview": true
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "widget-counts",
              "version": "1.0",
              "code": "widgets",
              "preview": true,
              "releases": 1,
              "added": 1,
              "settled": 1,
              "needs_value": [],
              "bars": [
                {
                  "key": "y2002-40",
                  "threshold": 40.0,
                  "group": "y2002",
                  "end_date": "2002-12-31T00:00:00Z",
                  "p0": 0.12,
                  "closes_at": "d2002",
                  "resolves_at": "d2002",
                  "resolved_yes": true,
                  "resolution": "prepared"
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandbox_run.index",
      "method": "GET",
      "path": "/api/v1/sandbox/runs",
      "summary": "Your sandbox runs.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "blockers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "reason",
                        "title"
                      ]
                    }
                  },
                  "checkpoint": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "occurred_at": {
                        "type": "string"
                      },
                      "sequence": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "occurred_at",
                      "sequence",
                      "title"
                    ]
                  },
                  "complete": {
                    "type": "boolean"
                  },
                  "curriculum": {
                    "type": "object",
                    "properties": {
                      "slug": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "slug",
                      "title"
                    ]
                  },
                  "pending_resolutions": {
                    "type": "array"
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "contaminated": {
                          "type": "boolean"
                        },
                        "key": {
                          "type": "string"
                        },
                        "market_code": {
                          "type": "string"
                        },
                        "moderation": {
                          "type": "null"
                        },
                        "open": {
                          "type": "boolean"
                        },
                        "private": {
                          "type": "boolean"
                        },
                        "resolved": {
                          "type": "boolean"
                        },
                        "submitted": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "contaminated",
                        "key",
                        "market_code",
                        "moderation",
                        "open",
                        "private",
                        "resolved",
                        "submitted",
                        "title"
                      ]
                    }
                  },
                  "run_id": {
                    "type": "number"
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "blockers",
                  "checkpoint",
                  "complete",
                  "curriculum",
                  "pending_resolutions",
                  "questions",
                  "run_id",
                  "status"
                ]
              }
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "blockers": [
                  {
                    "key": "paper-a",
                    "reason": "forecast",
                    "title": "Will the paper's primary endpoint be positive?"
                  }
                ],
                "checkpoint": {
                  "key": "opening",
                  "occurred_at": "2020-01-01T00:00:00Z",
                  "sequence": 0,
                  "title": "Opening evidence"
                },
                "complete": false,
                "curriculum": {
                  "slug": "retro-35812",
                  "title": "Biology sandbox 35812"
                },
                "pending_resolutions": [],
                "questions": [
                  {
                    "contaminated": false,
                    "key": "paper-a",
                    "market_code": "rt35812",
                    "moderation": null,
                    "open": true,
                    "private": false,
                    "resolved": false,
                    "submitted": null,
                    "title": "Will the paper's primary endpoint be positive?"
                  }
                ],
                "run_id": 618,
                "status": "active"
              }
            ]
          }
        }
      }
    },
    {
      "id": "sandbox_run.advance",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/advance",
      "summary": "Move a run on to its next checkpoint, or by a week, month or year.",
      "group": "sandboxes",
      "description": "Refused with 422 `unanswered_items` while a question closing at the next checkpoint has neither a forecast nor a skip. With `by=week|month|year` it steps through checkpoints up to that much simulated time and stops early at one that discloses evidence, cuts liquidity, resolves or introduces a question; the response adds `step`. There is no endpoint for placing a sandbox forecast: forecasting happens in the web UI.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "by": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "blockers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "reason",
                      "title"
                    ]
                  }
                },
                "checkpoint": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "occurred_at": {
                      "type": "string"
                    },
                    "sequence": {
                      "type": "number"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "occurred_at",
                    "sequence",
                    "title"
                  ]
                },
                "complete": {
                  "type": "boolean"
                },
                "curriculum": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "slug",
                    "title"
                  ]
                },
                "pending_resolutions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "question": {
                        "type": "string"
                      },
                      "submarket_id": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "label",
                      "question",
                      "submarket_id",
                      "title"
                    ]
                  }
                },
                "questions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "contaminated": {
                        "type": "boolean"
                      },
                      "key": {
                        "type": "string"
                      },
                      "market_code": {
                        "type": "string"
                      },
                      "moderation": {
                        "type": "null"
                      },
                      "open": {
                        "type": "boolean"
                      },
                      "private": {
                        "type": "boolean"
                      },
                      "resolved": {
                        "type": "boolean"
                      },
                      "submitted": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "contaminated",
                      "key",
                      "market_code",
                      "moderation",
                      "open",
                      "private",
                      "resolved",
                      "submitted",
                      "title"
                    ]
                  }
                },
                "run_id": {
                  "type": "number"
                },
                "status": {
                  "type": "string"
                },
                "step": {
                  "type": "object",
                  "properties": {
                    "checkpoints_passed": {
                      "type": "number"
                    },
                    "landed_on_target": {
                      "type": "boolean"
                    },
                    "stopped": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "interrupts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "title"
                        ]
                      }
                    }
                  },
                  "required": [
                    "checkpoints_passed",
                    "landed_on_target",
                    "stopped",
                    "target"
                  ]
                }
              },
              "required": [
                "blockers",
                "checkpoint",
                "complete",
                "curriculum",
                "pending_resolutions",
                "questions",
                "run_id",
                "status"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [],
              "checkpoint": {
                "key": "paper-reveal",
                "occurred_at": "2020-01-01T00:00:00Z",
                "sequence": 1,
                "title": "Paper results"
              },
              "complete": false,
              "curriculum": {
                "slug": "retro-35972",
                "title": "Biology sandbox 35972"
              },
              "pending_resolutions": [],
              "questions": [
                {
                  "contaminated": false,
                  "key": "paper-a",
                  "market_code": "rt35972",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": "skipped",
                  "title": "Will the paper's primary endpoint be positive?"
                }
              ],
              "run_id": 621,
              "status": "active"
            }
          }
        }
      }
    },
    {
      "id": "sandbox_run.resolve",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/resolutions",
      "summary": "Resolve a bar in your run.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string"
          },
          "submarket_id": {
            "type": "number"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "outcome": "no",
            "submarket_id": 46960
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [],
              "checkpoint": {
                "key": "a2003",
                "occurred_at": "2003-01-01T00:00:00Z",
                "sequence": 2,
                "title": "a2003"
              },
              "complete": false,
              "curriculum": {
                "slug": "retro-69315",
                "title": "Learner resolution 69283"
              },
              "pending_resolutions": [],
              "questions": [
                {
                  "contaminated": false,
                  "key": "when",
                  "market_code": "lr69283",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": "skipped",
                  "title": "When will it happen?"
                }
              ],
              "resolution": {
                "implied_submarket_ids": [],
                "resolved_yes": false,
                "submarket_id": 46960
              },
              "run_id": 689,
              "status": "active"
            }
          }
        }
      }
    },
    {
      "id": "sandbox_run.questions",
      "method": "GET",
      "path": "/api/v1/sandbox/runs/{id}/questions",
      "summary": "Questions written in a run.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "bars": [
                  {
                    "closes_at": "cp2",
                    "end_date": "2001-09-30T23:59:59Z",
                    "key": "b1",
                    "label": "By end of Sep 2001",
                    "resolved": false,
                    "resolved_yes": null,
                    "submarket_id": 45553,
                    "threshold_date": "2001-09-30T23:59:59Z",
                    "threshold_decimal": null
                  },
                  {
                    "closes_at": "cp2",
                    "end_date": "2001-10-31T23:59:59Z",
                    "key": "b2",
                    "label": "By end of Oct 2001",
                    "resolved": false,
                    "resolved_yes": null,
                    "submarket_id": 45554,
                    "threshold_date": "2001-10-31T23:59:59Z",
                    "threshold_decimal": null
                  }
                ],
                "code": "p685-1",
                "created_at_checkpoint": "cp1",
                "created_on": "2001-09-01T00:00:00Z",
                "market_type": "date",
                "moderation": null,
                "title": "Date the first widget factory opens"
              }
            ]
          }
        }
      }
    },
    {
      "id": "sandbox_run.create_question",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/questions",
      "summary": "Write a question in a run.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "by",
                    "p"
                  ]
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array"
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "k",
                        "n",
                        "period",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "horizon",
              "question",
              "resolution",
              "title"
            ]
          }
        }
      },
      "responses": {
        "201": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "spec": {
              "anchors": [
                {
                  "by": "2002-06",
                  "p": 0.3
                },
                {
                  "by": "2003-12",
                  "p": 0.6
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Announced widget factories that opened",
                    "evidence": "Invented: 6 of 20 announced factories opened within two years.",
                    "k": 6,
                    "n": 20,
                    "period": "1990-2000",
                    "sources": []
                  }
                ]
              },
              "horizon": {
                "end": "2003-12"
              },
              "question": "when",
              "resolution": {
                "details": "A factory counts once it ships its first widget.",
                "source": "Reported by the widget trade gazette"
              },
              "title": "Date the first widget factory opens"
            }
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "code": "p679-1",
              "created_at_checkpoint": "cp1",
              "note": "Private to you in this run. It never joins the curriculum; a moderator may flag it, and its outcomes arrive as the run reaches them.",
              "private": true,
              "title": "Date the first widget factory opens",
              "url": "http://localhost:4002/sandbox/retro-354/m/p679-1"
            }
          }
        }
      }
    },
    {
      "id": "sandbox_run.add_question_item",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/questions/{code}/items",
      "summary": "Add an item to a question in a run.",
      "group": "sandboxes",
      "description": "Adds an item (a new event or party, as its own curve) to one of the run's own when-questions with items: `key` (new; lowercase letters, digits, - or _), `label`, `anchors` ([{by, p}]) and `basis` (reference classes with sources or k/n counts, checked as for a new question). The question's whole spec, with the item, is checked as a new question would be; only the new item's bars are added, dated from the run's clock (201). An existing item's `key` with only a `label` renames that item instead (200): its key, bars, anchors and basis stay. 422 `invalid_spec` lists the issues. `also_runs` (ids of the caller's other wargames) makes the same edit on each one's identical question (same `definition_sha256`), never otherwise; `data.also` gives each run's `status`: `edited`, `no_identical_question` or `failed`. A run that isn't the caller's wargame is refused (422).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "anchors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "by": {
                  "type": "string"
                },
                "p": {
                  "type": "number"
                }
              },
              "required": [
                "by",
                "p"
              ]
            }
          },
          "basis": {
            "type": "object"
          },
          "also_runs": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "required": [
          "key"
        ]
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        },
        "201": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "key": "newco",
            "label": "NewCo offer",
            "anchors": [
              {
                "by": "2027-01",
                "p": 0.05
              },
              {
                "by": "2027-06",
                "p": 0.12
              }
            ],
            "basis": {
              "reference_classes": [
                {
                  "description": "Final-round candidates hired",
                  "evidence": "1 in 7 reaching final interview were hired.",
                  "k": 1,
                  "n": 7,
                  "sources": [
                    {
                      "title": "CEA hiring data",
                      "url": "https://example.org/cea"
                    }
                  ]
                }
              ]
            }
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "code": "p30-2",
              "items": [
                {
                  "key": "govai",
                  "label": "GovAI offer"
                },
                {
                  "key": "newco",
                  "label": "NewCo offer"
                }
              ],
              "added": "newco"
            }
          }
        }
      }
    },
    {
      "id": "sandbox_run.preview_question",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/questions/preview",
      "summary": "Check a run question's spec without creating it.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "by",
                    "p"
                  ]
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array"
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "k",
                        "n",
                        "period",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "horizon",
              "question",
              "resolution",
              "title"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "spec": {
              "anchors": [
                {
                  "by": "2002-06",
                  "p": 0.3
                },
                {
                  "by": "2003-12",
                  "p": 0.6
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Announced widget factories that opened",
                    "evidence": "Invented: 6 of 20 announced factories opened within two years.",
                    "k": 6,
                    "n": 20,
                    "period": "1990-2000",
                    "sources": []
                  }
                ]
              },
              "horizon": {
                "end": "2003-12"
              },
              "question": "when",
              "resolution": {
                "details": "A factory counts once it ships its first widget.",
                "source": "Reported by the widget trade gazette"
              },
              "title": "Date the first widget factory opens"
            }
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "curves": [
                {
                  "bars": [
                    {
                      "label": "By end of Sep 2001",
                      "starting_probability": 0.035,
                      "threshold_date": "2001-09-30T23:59:59Z"
                    },
                    {
                      "label": "By end of Oct 2001",
                      "starting_probability": 0.069,
                      "threshold_date": "2001-10-31T23:59:59Z"
                    }
                  ],
                  "curve": "main",
                  "label": ""
                }
              ],
              "issues": [],
              "market": {
                "background_info_html": "<p>The starting probabilities of this market were calculated from base rates: how often comparable things have happened.</p>\n<table><thead><tr><th>Reference class</th><th>What it shows</th><th>Sources</th></tr></thead><tbody>\n<tr><td>Announced widget factories that opened</td><td>6 of 20 (1990-2000)…",
                "budget": 300,
                "cumulative": true,
                "end_date": "2003-12-31T23:59:59Z",
                "resolution_criteria": "<p>Resolves using Reported by the widget trade gazette.</p>\n<p>A factory counts once it ships its first widget.</p>",
                "status": "open",
                "svelte_params": {},
                "title": "Date the first widget factory opens",
                "type": "date",
                "visibility": "private",
                "x_unit": "month"
              },
              "next_options": [
                {
                  "default": "one event",
                  "example": "[{\"key\": \"ai_rd_high\", \"label\": \"AI R&D: high\"}]",
                  "required": false,
                  "set": false,
                  "setting": "items",
                  "values": null,
                  "why": "Several related events in one market, each with its own curve and tab."
                },
                {
                  "default": "none",
                  "example": "{\"kind\": \"after_trigger\", \"trigger\": \"1,000 US troops deploy to Iran\", \"deadline\": \"2027-12-31\", \"window\": {\"months\": 24}, \"title_after\": \"Time for US forces to leave Iran\"}, with anchors like [{\"within\": 6, \"p\": 0.2}, {\"within\": 24, \"p\": 0.6}]",
                  "required": false,
                  "set": false,
                  "setting": "condition",
                  "values": [
                    "none",
                    "after_trigger"
                  ],
                  "why": "After a trigger: count time from an event that hasn't happened yet (\"months after 1,000 troops deploy\"). The market voids if the trigger doesn't happen by its deadline. Anchors then say how likely the event is within N periods of the trigger."
                }
              ],
              "valid": true
            }
          }
        }
      }
    },
    {
      "id": "sandbox_run.moderate_question",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/questions/{code}/moderation",
      "summary": "Accept or reject a run question (curriculum owners).",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "accepted": true,
            "note": "Clear and resolvable."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "code": "p680-1",
              "moderation": {
                "note": "Clear and resolvable.",
                "status": "accepted"
              }
            }
          }
        }
      }
    },
    {
      "id": "sandbox_run.resolve_question",
      "method": "POST",
      "path": "/api/v1/sandbox/runs/{id}/questions/{code}/resolutions",
      "summary": "Resolve a run question's bars.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "resolutions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "outcome": {
                  "type": "string"
                },
                "resolves_at": {
                  "type": "string"
                },
                "submarket_id": {
                  "type": "number"
                }
              },
              "required": [
                "outcome",
                "resolves_at",
                "submarket_id"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "resolutions": [
              {
                "outcome": "yes",
                "resolves_at": "cp4",
                "submarket_id": 45553
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "code": "p685-1",
              "resolved": 1
            }
          }
        }
      }
    },
    {
      "id": "timelines.index",
      "method": "GET",
      "path": "/api/v1/timelines",
      "summary": "Sandboxes you can start (curricula and wargame templates), and your runs.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "curricula": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "run_id": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "slug": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "description",
                      "kind",
                      "run_id",
                      "slug",
                      "title",
                      "url"
                    ]
                  }
                },
                "runs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "checkpoint": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "title"
                        ]
                      },
                      "clock": {
                        "type": "string"
                      },
                      "complete": {
                        "type": "boolean"
                      },
                      "curriculum": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "slug",
                          "title"
                        ]
                      },
                      "kind": {
                        "type": "string"
                      },
                      "run_id": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "practice": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "archived": {
                        "type": "boolean"
                      },
                      "forked_from_run_id": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "checkpoint",
                      "clock",
                      "complete",
                      "curriculum",
                      "kind",
                      "run_id",
                      "status"
                    ]
                  }
                },
                "templates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "premise": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "title",
                      "kind",
                      "premise"
                    ]
                  }
                },
                "future_sandboxes": {
                  "type": "object",
                  "properties": {
                    "included": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    },
                    "ai_budget": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The monthly AI budget that server-planned turns, info answers and briefings use (client-planned turns use none): `plan` (free, pro or supporter), `allowance_usd`, `used_usd`, `remaining_usd` (null when uncapped), `uncapped` (true: never stopped; `allowance_usd` is then only a meter) and `resets_on` (a date, UTC).",
                      "properties": {
                        "plan": {
                          "type": "string"
                        },
                        "allowance_usd": {
                          "type": "number"
                        },
                        "used_usd": {
                          "type": "number"
                        },
                        "remaining_usd": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "uncapped": {
                          "type": "boolean"
                        },
                        "resets_on": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "plan",
                        "allowance_usd",
                        "used_usd",
                        "remaining_usd",
                        "uncapped",
                        "resets_on"
                      ]
                    }
                  },
                  "required": [
                    "included"
                  ]
                }
              },
              "required": [
                "curricula",
                "runs"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "curricula": [],
              "runs": [],
              "templates": [
                {
                  "key": "wargame-your-life",
                  "title": "Wargame your life",
                  "kind": "future",
                  "premise": "It is October 2026. …"
                }
              ],
              "future_sandboxes": {
                "included": true
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox"
      }
    },
    {
      "id": "timelines.show",
      "method": "GET",
      "path": "/api/v1/timelines/runs/{id}",
      "summary": "Where one of your sandbox runs stands: a past run's clock, checkpoint and questions, or a wargame's setup and history.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "blockers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "reason",
                          "title"
                        ]
                      }
                    },
                    "checkpoint": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "occurred_at": {
                          "type": "string"
                        },
                        "sequence": {
                          "type": "number"
                        },
                        "text": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "occurred_at",
                        "sequence",
                        "text",
                        "title"
                      ]
                    },
                    "clock": {
                      "type": "string"
                    },
                    "complete": {
                      "type": "boolean"
                    },
                    "curriculum": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "slug",
                        "title"
                      ]
                    },
                    "kind": {
                      "type": "string"
                    },
                    "pending_resolutions": {
                      "type": "array"
                    },
                    "previous_checkpoint_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "contaminated": {
                            "type": "boolean"
                          },
                          "key": {
                            "type": "string"
                          },
                          "market_code": {
                            "type": "string"
                          },
                          "moderation": {
                            "type": "null"
                          },
                          "open": {
                            "type": "boolean"
                          },
                          "private": {
                            "type": "boolean"
                          },
                          "resolved": {
                            "type": "boolean"
                          },
                          "submitted": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "contaminated",
                          "key",
                          "market_code",
                          "moderation",
                          "open",
                          "private",
                          "resolved",
                          "submitted",
                          "title"
                        ]
                      }
                    },
                    "run_id": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "blockers",
                    "checkpoint",
                    "clock",
                    "complete",
                    "curriculum",
                    "kind",
                    "pending_resolutions",
                    "previous_checkpoint_at",
                    "questions",
                    "run_id",
                    "status",
                    "url"
                  ]
                },
                {
                  "$ref": "#/$defs/timeline_future"
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [
                {
                  "key": "paper-a",
                  "reason": "forecast",
                  "title": "Will the paper's primary endpoint be positive?"
                }
              ],
              "checkpoint": {
                "key": "opening",
                "occurred_at": "2020-01-01T00:00:00Z",
                "sequence": 0,
                "text": "Only prior evidence is visible.",
                "title": "Opening evidence"
              },
              "clock": "2020-01-01T00:00:00Z",
              "complete": false,
              "curriculum": {
                "slug": "retro-42115",
                "title": "Biology sandbox 42115"
              },
              "kind": "past",
              "pending_resolutions": [],
              "previous_checkpoint_at": null,
              "questions": [
                {
                  "contaminated": false,
                  "key": "paper-a",
                  "market_code": "rt42115",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": null,
                  "title": "Will the paper's primary endpoint be positive?"
                }
              ],
              "run_id": 609,
              "status": "active",
              "url": "http://localhost:4002/sandbox/retro-42115"
            }
          }
        }
      },
      "description": "A past sandbox's position (`kind: past`), or a wargame's (`kind: future`): its clock, setup, the results of its last 50 turns and the questions written in it. Nothing past the clock.",
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs/{id}"
      }
    },
    {
      "id": "timelines.sources",
      "method": "GET",
      "path": "/api/v1/timelines/runs/{id}/sources",
      "summary": "A run's sources up to its clock: the briefing, reached disclosures and new feed items.",
      "group": "sandboxes",
      "description": "`since=YYYY-MM-DD` (default: the previous checkpoint's date; `since=start` for everything reached) bounds the disclosures and the feed. `limit` caps disclosures (max 200). The feed needs Pro or curriculum membership; otherwise its `status` is `not_included`.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "since": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "briefing": {
                  "type": "object",
                  "properties": {
                    "checkpoint": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "text",
                        "title"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "checkpoint",
                    "text",
                    "title"
                  ]
                },
                "clock": {
                  "type": "string"
                },
                "disclosures": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "at": {
                        "type": "string"
                      },
                      "checkpoint_key": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "question_code": {
                        "type": "string"
                      },
                      "source_url": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "text": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "at",
                      "checkpoint_key",
                      "key",
                      "kind",
                      "question_code",
                      "source_url",
                      "text",
                      "title"
                    ]
                  }
                },
                "feed": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "items",
                    "status"
                  ]
                },
                "since": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "briefing",
                "clock",
                "disclosures",
                "feed",
                "since"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "since": "start"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "briefing": {
                "checkpoint": {
                  "key": "opening",
                  "text": "Only prior evidence is visible.",
                  "title": "Opening evidence"
                },
                "text": "Historical biology questions.",
                "title": "Biology sandbox 42115"
              },
              "clock": "2020-01-01T00:00:00Z",
              "disclosures": [
                {
                  "at": "2020-01-01T00:00:00Z",
                  "checkpoint_key": "opening",
                  "key": "study-design",
                  "kind": "evidence",
                  "question_code": "rt42115",
                  "source_url": null,
                  "text": "Forty subjects and a preregistered endpoint.",
                  "title": "Study design"
                }
              ],
              "feed": {
                "items": [],
                "status": "unavailable"
              },
              "since": null
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs/{id}/sources"
      }
    },
    {
      "id": "timelines.library",
      "method": "GET",
      "path": "/api/v1/timelines/runs/{id}/library",
      "summary": "Search a run's library, capped at the run's clock.",
      "group": "sandboxes",
      "description": "`q` is required. `limit` (max 15), `offset`, `after=YYYY-MM-DD`, `sort=relevance|newest`. The cutoff comes from the run's clock: a source dated D is available from D+1. Needs Pro or curriculum membership.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "limit": {
            "type": "string"
          },
          "offset": {
            "type": "string"
          },
          "after": {
            "type": "string"
          },
          "sort": {
            "type": "string"
          }
        },
        "required": [
          "q"
        ]
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "cutoff": {
                  "type": "string"
                },
                "more": {
                  "type": "boolean"
                },
                "next_offset": {
                  "type": "null"
                },
                "results": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string"
                      },
                      "doc_id": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "date",
                      "doc_id",
                      "title"
                    ]
                  }
                }
              },
              "required": [
                "cutoff",
                "more",
                "next_offset",
                "results"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "q": "widget"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "cutoff": "2020-01-01",
              "more": false,
              "next_offset": null,
              "results": [
                {
                  "date": "2019-12-31",
                  "doc_id": "a",
                  "title": "Reached"
                }
              ]
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs/{id}/library"
      }
    },
    {
      "id": "timelines.turn_status",
      "method": "GET",
      "path": "/api/v1/timelines/runs/{id}/turn_status",
      "summary": "Where a wargame's next turn stands for you: players, the turn's length, what you do next; can long-poll.",
      "group": "sandboxes",
      "description": "For the run's host or a guest who joined it. `wait_seconds` (0-60) long-polls: the answer comes as soon as the status differs from `since` (a `version` from an earlier answer; absent, the status now), or after `wait_seconds` with the status as it is. 404 for a run you don't play.",
      "auth": "read",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": {
        "type": "object",
        "properties": {
          "wait_seconds": {
            "type": "string",
            "description": "Seconds to wait for a change, 0-60 (default 0)."
          },
          "since": {
            "type": "string",
            "description": "The `version` you last saw."
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/$defs/turn_status"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "query": {
            "wait_seconds": "30",
            "since": "1x9k1"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "turn": 4,
              "clock": "2026-11-14",
              "role": "guest",
              "multiplayer": true,
              "busy": null,
              "length": {
                "until": "2026-12-14",
                "label": "to 14 Dec 2026 (1 month)",
                "span": "1 month",
                "state": "locked"
              },
              "last_length": {
                "from": "2026-10-14",
                "to": "2026-11-14",
                "span": "1 month"
              },
              "players": [
                {
                  "key": "c1",
                  "name": "Ana",
                  "role": "host",
                  "status": "host",
                  "orders": null,
                  "submitted_for": null,
                  "submitted_for_label": null,
                  "stale": false,
                  "reopened": false,
                  "you": false
                },
                {
                  "key": "c2",
                  "name": "Rosa",
                  "role": "guest",
                  "status": "submitted",
                  "orders": 2,
                  "submitted_for": "2026-12-14",
                  "submitted_for_label": "to 14 Dec 2026 (1 month)",
                  "stale": false,
                  "reopened": false,
                  "you": true
                }
              ],
              "submitted": 1,
              "expected": 1,
              "can_run": false,
              "waiting_on": [],
              "open_questions": [],
              "next": {
                "action": "wait",
                "text": "Submitted. Waiting for the host to run the turn."
              },
              "version": "1x9k2"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs/{id}/turn_status"
      }
    },
    {
      "id": "timelines.start",
      "method": "POST",
      "path": "/api/v1/timelines/runs",
      "summary": "Start a sandbox: a future one from a template, or a past one from a curriculum.",
      "group": "sandboxes",
      "description": "`template` starts a wargame at today's date (Pro, or admin; at most 5 active), with an optional `model` (`opus`, the default, `sonnet` or `haiku`: the model that simulates the run): the response is the run with a `setup` object (template premise, bio prompt and choices, modification suggestions, pace options) whose answers go to `PATCH /sandbox/runs/{id}/setup`. `curriculum` (a slug) starts or resumes a past sandbox and returns its position (`kind: past`). `planner`: `client` (the default here: the caller's own agent plans through planner jobs, with no Antistatic model calls) or `server` (Antistatic's model, on the monthly AI budget in `GET /sandbox`); runs started on the website are server-planned. Errors: 429 `sandbox_quota`.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string"
          },
          "curriculum": {
            "type": "string"
          },
          "planner": {
            "type": "string",
            "enum": [
              "server",
              "client"
            ]
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "allOf": [
                    {
                      "$ref": "#/$defs/timeline_future"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "setup": {
                          "type": "object",
                          "description": "What a host collects before the first turn.",
                          "properties": {
                            "template": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "premise": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "key",
                                "title",
                                "premise"
                              ]
                            },
                            "bio_prompt": {
                              "type": "string"
                            },
                            "bio_choices": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "key",
                                  "label"
                                ]
                              }
                            },
                            "modification_suggestions": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "pace_options": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "key",
                                  "label"
                                ]
                              }
                            },
                            "default_pace": {
                              "type": "string"
                            },
                            "fields": {
                              "type": "object"
                            },
                            "privacy": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "template",
                            "bio_prompt",
                            "bio_choices",
                            "modification_suggestions",
                            "pace_options",
                            "default_pace"
                          ]
                        }
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "kind": {
                      "const": "past"
                    }
                  },
                  "required": [
                    "run_id",
                    "kind"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "template": "wargame-your-life"
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-10-10T09:00:00Z",
              "forked_from_run_id": null,
              "settings": {
                "bio": null,
                "modifications": null,
                "pace": "month",
                "complete": false
              },
              "setup": {
                "template": {
                  "key": "wargame-your-life",
                  "title": "Wargame your life",
                  "premise": "It is October 2026. …"
                },
                "bio_prompt": "Who is the player? …",
                "bio_choices": [
                  {
                    "key": "draft_from_context",
                    "label": "Let the assistant draft it from what it knows about you, then edit"
                  },
                  {
                    "key": "free_text",
                    "label": "Write it yourself"
                  },
                  {
                    "key": "skip",
                    "label": "Skip: play an unnamed person"
                  }
                ],
                "modification_suggestions": [
                  "Slower AI progress than the forecasts suggest"
                ],
                "pace_options": [
                  {
                    "key": "days",
                    "label": "A few days per turn (three days)"
                  },
                  {
                    "key": "week",
                    "label": "One week per turn"
                  },
                  {
                    "key": "month",
                    "label": "One month per turn"
                  },
                  {
                    "key": "quarter",
                    "label": "Three months per turn"
                  }
                ],
                "default_pace": "month",
                "fields": {
                  "bio": "text, at most 6000 characters"
                },
                "privacy": "The bio, modifications and actions go to Antistatic's planner …"
              },
              "turns": 0,
              "history": [],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs"
      }
    },
    {
      "id": "timelines.update_setup",
      "method": "PATCH",
      "path": "/api/v1/timelines/runs/{id}/setup",
      "summary": "Set a wargame's bio, modifications and pace.",
      "group": "sandboxes",
      "description": "Any of `bio` (at most 6,000 characters), `modifications` (2,000), `pace` (a pace option key) and `model` (`opus`, `sonnet` or `haiku`: the model that simulates the run's next turns, info answers and briefings); omitted fields stay, empty text clears. Choosing a pace completes the setup, which turns need. Returns the run.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "bio": {
            "type": [
              "string",
              "null"
            ]
          },
          "modifications": {
            "type": [
              "string",
              "null"
            ]
          },
          "pace": {
            "type": "string"
          },
          "duty_rates": {
            "type": "object",
            "description": "How often the planner's optional duties run, each a rate per 30 days from 0 to 1 (a turn of d days runs a duty with probability 1 − (1 − rate)^(d/30)): `curveball_scan` (unlikely life and world events drawn at their base rates; default 0.5), `question_review` (new run questions and items; 0.6), `ask_player` (questions for the player; 0.4).",
            "properties": {
              "curveball_scan": {
                "type": "number"
              },
              "question_review": {
                "type": "number"
              },
              "ask_player": {
                "type": "number"
              }
            }
          },
          "scout": {
            "type": "boolean",
            "description": "The world-market scout (default true): after each turn, real-world forecasts relevant to the player are checked and the few that clear its bar become run questions or items, listed in the next turn's `scout_added`."
          },
          "planner": {
            "type": "string",
            "enum": [
              "server",
              "client"
            ],
            "description": "Who plans the run's turns: server (Antistatic's model, on the monthly AI budget) or client (the player's own agent, through planner jobs; no Antistatic model calls, larger allowances)."
          },
          "ends_on": {
            "type": [
              "string",
              "null"
            ],
            "description": "The date the game is planned to end (YYYY-MM-DD, after the clock), or null for open-ended. Play carries on past it; reaching it makes the wrap-up."
          },
          "character": {
            "type": "string",
            "description": "A player with several characters: the one whose view comes back."
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "$ref": "#/$defs/timeline_future"
                },
                {
                  "type": "object",
                  "description": "A wargame as one of the caller's characters sees it (role guest).",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "guest"
                      ]
                    },
                    "character": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "tagline": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "bio": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "key",
                        "name",
                        "tagline",
                        "bio"
                      ]
                    },
                    "clock": {
                      "type": "string"
                    },
                    "settings": {
                      "type": "object"
                    },
                    "turns": {
                      "type": "number"
                    },
                    "history": {
                      "type": "array"
                    },
                    "questions": {
                      "type": "array"
                    },
                    "info_log": {
                      "type": "array"
                    },
                    "cast": {
                      "type": "array"
                    },
                    "url": {
                      "type": "string"
                    },
                    "turn_status": {
                      "$ref": "#/$defs/turn_status"
                    }
                  },
                  "required": [
                    "run_id",
                    "kind",
                    "role",
                    "character",
                    "clock",
                    "settings",
                    "turns",
                    "history",
                    "questions",
                    "url"
                  ]
                },
                {
                  "type": "object",
                  "description": "A player who no longer plays any character in the game.",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "left": {
                      "const": true
                    }
                  },
                  "required": [
                    "run_id",
                    "left"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "bio": "A nurse in Leeds.",
            "pace": "month"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-10-10T09:00:00Z",
              "forked_from_run_id": null,
              "settings": {
                "bio": "A nurse in Leeds.",
                "modifications": null,
                "pace": "month",
                "complete": true
              },
              "turns": 0,
              "history": [],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "PATCH /api/v1/sandbox/runs/{id}/setup"
      }
    },
    {
      "id": "timelines.take_turn",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/turns",
      "summary": "Take a wargame's turn.",
      "group": "sandboxes",
      "description": "The player's `actions` (at most 200,000 characters) and optionally `until` (an ISO date after the clock, at most a year ahead; a date-time counts as its date; default the clock plus the pace; `\"auto\"`: the planner chooses the date, keeping to the run's cadence (recent turn lengths, else the pace) or a sensible step, and the result's `until` gives it with a one-line reason, also stated under the script's header). The server plans the period, draws one outcome in code and moves the clock to midnight UTC of that date; the response holds the observations the clock has reached and the run's bars that resolved. Idempotent by `turn_id` (the client's key, per run): a completed turn sent again with the same `actions` and `until` returns its stored result with `replayed: true`; the same `turn_id` with other `actions` or another `until` is 409 `turn_id_conflict`. A daily turn quota. Errors: 409 `setup_incomplete`, 409 `turn_in_progress`, 409 `turn_id_conflict`, 429 `turn_quota`, 403 `model_requires_pro`, 402 `ai_budget_exhausted`, 502 `planner_invalid` / `planner_refused` and 503 `planner_unavailable` (the clock has not moved; retry with the same `turn_id`).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "turn_id": {
            "type": "string"
          },
          "actions": {
            "type": "string"
          },
          "until": {
            "type": "string",
            "description": "An ISO date, or \"auto\" (the planner chooses)."
          }
        },
        "required": [
          "turn_id",
          "actions"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_turn"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "turn_id": "7f9c2b1e-turn-1",
            "actions": "Ask my manager for a pay review."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "turn": {
                "index": 1,
                "from": "2026-10-10T09:00:00Z",
                "to": "2026-11-10T09:00:00Z"
              },
              "clock": "2026-11-10T09:00:00Z",
              "observations": [
                {
                  "at": "2026-10-24T09:00:00Z",
                  "text": "Your manager agrees to a pay review in January."
                }
              ],
              "resolved": [],
              "replayed": false
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/turns"
      }
    },
    {
      "id": "timelines.fork",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/forks",
      "summary": "Fork a sandbox run.",
      "group": "sandboxes",
      "description": "A wargame forks after `turn` (default its last; 0 is the start) into a new run with its history, clock and planner state up to then (`model` sets its planner model; default the original's), and a copy of every question as it stood after that turn: specs, links, goals, forecasts, positions, house line, liquidity and the resolutions reached by then, under the fork's own codes (p<fork id>-<n>, same n). Later changes in either run stay in that run. A past run forks at a reached `checkpoint` (key; default the current one) into a new run marked `practice`. The original is unchanged.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "turn": {
            "type": [
              "number",
              "string"
            ]
          },
          "checkpoint": {
            "type": "string"
          },
          "model": {
            "type": "string",
            "enum": [
              "opus",
              "sonnet",
              "haiku"
            ]
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "$ref": "#/$defs/timeline_future"
                },
                {
                  "type": "object",
                  "properties": {
                    "run_id": {
                      "type": "number"
                    },
                    "kind": {
                      "const": "past"
                    },
                    "practice": {
                      "type": "boolean"
                    },
                    "forked_from_run_id": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "run_id",
                    "kind",
                    "practice",
                    "forked_from_run_id"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "turn": 1
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "run_id": 713,
              "kind": "future",
              "template": {
                "key": "wargame-your-life",
                "title": "Wargame your life"
              },
              "status": "active",
              "clock": "2026-11-10T09:00:00Z",
              "forked_from_run_id": 712,
              "settings": {
                "bio": "A nurse in Leeds.",
                "modifications": null,
                "pace": "month",
                "complete": true
              },
              "turns": 1,
              "history": [
                {
                  "run_id": 712,
                  "turn": {
                    "index": 1,
                    "from": "2026-10-10T09:00:00Z",
                    "to": "2026-11-10T09:00:00Z"
                  },
                  "clock": "2026-11-10T09:00:00Z",
                  "observations": [
                    {
                      "at": "2026-10-24T09:00:00Z",
                      "text": "Your manager agrees to a pay review in January."
                    }
                  ],
                  "resolved": []
                }
              ],
              "questions": [],
              "url": "https://antistatic.exchange/sandbox/future-1a2b3c4d5e6f"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/forks"
      }
    },
    {
      "id": "timelines.delete",
      "method": "DELETE",
      "path": "/api/v1/timelines/runs/{id}",
      "summary": "Delete one of your sandbox runs.",
      "group": "sandboxes",
      "description": "Needs `confirm: true`. The run (a past sandbox's run, or a wargame) disappears for you everywhere: lists, `GET` and every write answer 404 for it, and its page is gone. It is a soft delete: the run and everything in it are kept, so the site's operators can restore it on request. Its forks stay, and show it as a deleted parent. A curriculum stays available: opening it again starts a new run. 404 for a run that isn't yours.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": [
              "boolean",
              "string"
            ]
          }
        },
        "required": [
          "confirm"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "deleted": {
                  "type": "boolean"
                },
                "run_id": {
                  "type": "number"
                }
              },
              "required": [
                "deleted",
                "run_id"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "confirm": true
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "deleted": true,
              "run_id": 712
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "DELETE /api/v1/sandbox/runs/{id}"
      }
    },
    {
      "id": "timelines.promote",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/questions/{code}/promote",
      "summary": "Copy a wargame's question into the real exchange today.",
      "group": "sandboxes",
      "description": "The question's definition is its spec in the run without the simulated `anchors` and `basis`; `spec` replaces any of its settings. Without `create` (or `create: false`) the answer is that spec and its preview as of today (as `POST /market-specs/preview`). Opening probabilities come from evidence available today, never from the sandbox's history: send `anchors` (and `basis`) in `spec`. With `create: true` it is created as `POST /market-specs` does, a normal private market owned by the caller (201); 422 `invalid_spec` while the spec has errors. The run is unchanged. `POST /markets/{code}/publication-request` can then ask for a public listing. 404 for a past sandbox's run or a code that isn't the run's question.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    },
                    "period": {
                      "type": "string"
                    },
                    "quantiles": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number"
                      }
                    }
                  }
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "title",
                              "url"
                            ]
                          }
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "cadence": {
                    "type": "string"
                  },
                  "end": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "excludes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "includes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              },
              "periods": {
                "type": "object",
                "properties": {
                  "cadence": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "cadence",
                  "from",
                  "to"
                ]
              },
              "thresholds": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "number"
                  },
                  "scale": {
                    "type": "string"
                  },
                  "to": {
                    "type": "number"
                  }
                },
                "required": [
                  "from",
                  "scale",
                  "to"
                ]
              },
              "unit": {
                "type": "string"
              }
            }
          },
          "create": {
            "type": [
              "boolean",
              "string"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "spec": {
                  "type": "object"
                },
                "preview": {
                  "type": "object",
                  "properties": {
                    "curves": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "bars": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "starting_probability": {
                                  "type": "number"
                                },
                                "threshold_date": {
                                  "type": "string"
                                },
                                "threshold": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "label",
                                "starting_probability"
                              ]
                            }
                          },
                          "curve": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "end_date": {
                            "type": "string"
                          },
                          "item": {
                            "type": "string"
                          },
                          "ladder": {
                            "type": "number"
                          },
                          "period": {
                            "type": "string"
                          },
                          "trimmed": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          }
                        },
                        "required": [
                          "bars",
                          "curve",
                          "label"
                        ]
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "example": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "field": {
                            "type": "string"
                          },
                          "fix": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "example",
                          "field",
                          "fix",
                          "message",
                          "severity"
                        ]
                      }
                    },
                    "market": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "background_info_html": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "budget": {
                          "type": "number"
                        },
                        "cumulative": {
                          "type": "boolean"
                        },
                        "end_date": {
                          "type": "string"
                        },
                        "resolution_criteria": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string"
                        },
                        "svelte_params": {
                          "type": "object",
                          "properties": {
                            "countObservationMode": {
                              "type": "string"
                            },
                            "defaultView": {
                              "type": "string"
                            },
                            "scaleBase": {
                              "type": "number"
                            },
                            "scaleType": {
                              "type": "string"
                            },
                            "timeCadence": {
                              "type": "string"
                            }
                          }
                        },
                        "title": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "visibility": {
                          "type": "string"
                        },
                        "x_unit": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "background_info_html",
                        "budget",
                        "cumulative",
                        "end_date",
                        "resolution_criteria",
                        "status",
                        "svelte_params",
                        "title",
                        "type",
                        "visibility",
                        "x_unit"
                      ]
                    },
                    "next_options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": [
                              "object",
                              "string",
                              "number",
                              "null"
                            ],
                            "properties": {
                              "end": {
                                "type": "string"
                              },
                              "start": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "end",
                              "start"
                            ]
                          },
                          "example": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "set": {
                            "type": "boolean"
                          },
                          "setting": {
                            "type": "string"
                          },
                          "values": {
                            "type": [
                              "object",
                              "array",
                              "null"
                            ],
                            "properties": {
                              "max": {
                                "type": "number"
                              },
                              "min": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "max",
                              "min"
                            ],
                            "items": {
                              "type": "string"
                            }
                          },
                          "why": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "default",
                          "example",
                          "required",
                          "set",
                          "setting",
                          "values",
                          "why"
                        ]
                      }
                    },
                    "valid": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "curves",
                    "issues",
                    "market",
                    "next_options",
                    "valid"
                  ]
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "spec",
                "preview",
                "note"
              ]
            }
          },
          "required": [
            "data"
          ]
        },
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "visibility": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "promoted_from": {
                  "type": "object",
                  "properties": {
                    "run_id": {
                      "type": "integer"
                    },
                    "market_code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "run_id",
                    "market_code"
                  ]
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "title",
                "visibility",
                "url",
                "promoted_from",
                "note"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "create": true,
            "spec": {
              "anchors": [
                {
                  "by": "2027-06",
                  "p": 0.3
                },
                {
                  "by": "2028-12",
                  "p": 0.7
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Career changes into nursing management",
                    "evidence": "About a third of ward nurses who apply are promoted within two years, from the NHS staff survey 2019-2024.",
                    "sources": [
                      {
                        "title": "NHS staff survey",
                        "url": "https://www.nhsstaffsurveys.com/"
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "code": "~6612",
              "title": "Date I become a ward manager",
              "visibility": "private",
              "url": "https://antistatic.exchange/m/~6612",
              "promoted_from": {
                "run_id": 712,
                "market_code": "p712-1"
              },
              "note": "A normal private market, owned by you, with nothing from the sandbox but its definition. To let others forecast on it, ask for a public listing (antistatic_request_public_listing)."
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions/{code}/promote"
      }
    },
    {
      "id": "timelines_authoring.limits",
      "method": "GET",
      "path": "/api/v1/timelines/limits",
      "summary": "Curriculum upload limits, field limits, lint rules and the T5 hindsight list.",
      "group": "sandbox authoring",
      "description": "The same numbers the server's changesets enforce; `antistatic sandbox check` applies them locally. Rule IDs are those of priv/sandboxes/RULES.md.",
      "auth": "none",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "schema_versions",
                "manifest",
                "fields",
                "rules",
                "hindsight_terms"
              ],
              "properties": {
                "schema_versions": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "manifest": {
                  "type": "object",
                  "required": [
                    "max_part_bytes",
                    "max_top_bytes",
                    "max_parts",
                    "max_items",
                    "max_checkpoints",
                    "max_bars",
                    "max_bars_per_item",
                    "max_bars_per_part"
                  ],
                  "additionalProperties": {
                    "type": "integer"
                  }
                },
                "fields": {
                  "type": "object",
                  "description": "\"<schema>.<field>\" => {min, max, pattern}; lengths in characters.",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "min": {
                        "type": "integer"
                      },
                      "max": {
                        "type": "integer"
                      },
                      "pattern": {
                        "type": "string"
                      }
                    }
                  }
                },
                "rules": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "severity",
                      "summary"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "severity": {
                        "enum": [
                          "error",
                          "warning"
                        ]
                      },
                      "summary": {
                        "type": "string"
                      }
                    }
                  }
                },
                "hindsight_terms": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "RULES.md T5: whole-word, case-insensitive; /.../ is a regular expression."
                }
              }
            }
          }
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "schema_versions": [
                2
              ],
              "manifest": {
                "max_part_bytes": 2000000,
                "max_top_bytes": 6000000,
                "max_parts": 400,
                "max_items": 1000,
                "max_checkpoints": 5000,
                "max_bars": 300000,
                "max_bars_per_item": 3000,
                "max_bars_per_part": 6000
              },
              "fields": {
                "bar.key": {
                  "max": 255
                }
              },
              "rules": [
                {
                  "id": "T5",
                  "severity": "warning",
                  "summary": "Hindsight vocabulary (hindsight_terms) in learner-visible text."
                }
              ],
              "hindsight_terms": [
                "seminal",
                "would later"
              ]
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/limits"
      }
    },
    {
      "id": "timelines_authoring.put_part",
      "method": "PUT",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/parts/{sha256}",
      "summary": "Store one content-addressed part of a curriculum draft.",
      "group": "sandbox authoring",
      "description": "`sha256` is the hex SHA-256 of the exact body. 201 when stored, 200 (`stored: false`) when the draft already has it. Creates the draft if new. Parts hold compact items with their own disclosures and resolution requests; nothing is imported until the manifest arrives.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object"
            },
            "description": "Compact (schema_version 2) items."
          },
          "disclosures": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "resolution_requests": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "stored",
                "sha256",
                "items",
                "bars",
                "bytes"
              ],
              "properties": {
                "stored": {
                  "type": "boolean"
                },
                "sha256": {
                  "type": "string"
                },
                "items": {
                  "type": "integer"
                },
                "bars": {
                  "type": "integer"
                },
                "bytes": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "201": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "stored",
                "sha256",
                "items",
                "bars",
                "bytes"
              ],
              "properties": {
                "stored": {
                  "type": "boolean"
                },
                "sha256": {
                  "type": "string"
                },
                "items": {
                  "type": "integer"
                },
                "bars": {
                  "type": "integer"
                },
                "bytes": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "413": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "items": [
              {
                "key": "b001"
              }
            ]
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "stored": true,
              "sha256": "a100000000000000000000000000000000000000000000000000000000000000",
              "items": 1,
              "bars": 24,
              "bytes": 5120
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "PUT /api/v1/sandbox/curricula/{slug}/drafts/{version}/parts/{sha256}"
      }
    },
    {
      "id": "timelines_authoring.put_manifest",
      "method": "PUT",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/manifest",
      "summary": "Send a draft's manifest (top level and ordered part hashes) and start its import.",
      "group": "sandbox authoring",
      "description": "202 starts a background import (one part per transaction); poll status. 200 when the draft already has this manifest. 409 `draft_changed` when `base_sha256` is not the draft's current manifest; 422 `missing_parts` lists the hashes to send. Sending the manifest again resumes a failed or interrupted import.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "schema_version",
          "manifest_sha256",
          "top",
          "parts"
        ],
        "properties": {
          "schema_version": {
            "const": 2
          },
          "source": {
            "type": "object",
            "properties": {
              "commit": {
                "type": "string"
              },
              "dirty": {
                "type": "boolean"
              }
            }
          },
          "manifest_sha256": {
            "type": "string"
          },
          "base_sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "top": {
            "type": "object",
            "required": [
              "checkpoints"
            ],
            "properties": {
              "curriculum": {
                "type": "object"
              },
              "checkpoints": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "disclosures": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "resolution_requests": {
                "type": "array",
                "maxItems": 0
              },
              "resolved_through": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "parts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "202": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "413": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "schema_version": 2,
            "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000",
            "base_sha256": null,
            "source": {
              "commit": "5b2e6c65b",
              "dirty": false
            },
            "top": {
              "curriculum": {
                "title": "Biology"
              },
              "checkpoints": [
                {
                  "key": "cp000"
                }
              ],
              "disclosures": []
            },
            "parts": [
              "a100000000000000000000000000000000000000000000000000000000000000",
              "b200000000000000000000000000000000000000000000000000000000000000"
            ]
          }
        },
        "response": {
          "status": 202,
          "body": {
            "data": {
              "slug": "biology",
              "version": "1.1",
              "state": "importing",
              "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000",
              "source_commit": "5b2e6c65b",
              "schema_version": 2,
              "parts_expected": 2,
              "parts_received": 2,
              "parts_imported": 0,
              "received": [
                "a100000000000000000000000000000000000000000000000000000000000000",
                "b200000000000000000000000000000000000000000000000000000000000000"
              ],
              "error": null
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "PUT /api/v1/sandbox/curricula/{slug}/drafts/{version}/manifest"
      }
    },
    {
      "id": "timelines_authoring.draft_status",
      "method": "GET",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/status",
      "summary": "A curriculum version's push and import status.",
      "group": "sandbox authoring",
      "description": "Counts and hashes only. `error` has a code and a path; its message only for owners and editors who are not learners of the curriculum.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "biology",
              "version": "1.1",
              "state": "imported",
              "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000",
              "source_commit": "5b2e6c65b",
              "schema_version": 2,
              "parts_expected": 2,
              "parts_received": 2,
              "parts_imported": 2,
              "received": [
                "a100000000000000000000000000000000000000000000000000000000000000",
                "b200000000000000000000000000000000000000000000000000000000000000"
              ],
              "error": null
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/curricula/{slug}/drafts/{version}/status"
      }
    },
    {
      "id": "timelines_authoring.create_draft",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}",
      "summary": "Start a curriculum draft built a piece at a time.",
      "group": "sandbox authoring",
      "description": "Makes the curriculum when the slug is new (a first curriculum is free; more need Pro, 403 `pro_required`; non-admins' curricula stay `restricted`) and starts, or reopens, the version's draft with an empty working manifest. `title`, `description` (plain text) and `resolved_through` (a date) are optional. A draft already pushed with a manifest is 409 `pushed_draft`. Then add checkpoints, questions and disclosures and validate: `validate` imports the working manifest first. Limits: 40 questions, 60 checkpoints, 200 disclosures; push larger curricula.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "resolved_through": {
            "type": "string"
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "title": "RNAi, 1998-2006",
            "description": "From the first worm papers to the first trials."
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [],
                "questions": [],
                "disclosures": []
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/drafts/{version}"
      }
    },
    {
      "id": "timelines_authoring.add_checkpoint",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/checkpoints",
      "summary": "Add or replace a checkpoint in a draft's working manifest.",
      "group": "sandbox authoring",
      "description": "`key`, `title` and `occurred_at` (a date or ISO date-time), optional `body_html`. An entry with the same key replaces the earlier one. `sequence` follows `occurred_at`, then the order added. Returns the draft status (`receiving`).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "key",
          "title",
          "occurred_at"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string"
          },
          "body_html": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "key": "cp01",
            "title": "February 1998",
            "occurred_at": "1998-02-19"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [
                  "cp01"
                ],
                "questions": [],
                "disclosures": []
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/drafts/{version}/checkpoints"
      }
    },
    {
      "id": "timelines_authoring.add_question",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/questions",
      "summary": "Add or replace a question (one compact-manifest item) in a draft.",
      "group": "sandbox authoring",
      "description": "One item in the compact format (`/sandbox/manifest.md`). Its shape is checked now (422 with a `path`, never a value); the publish rules run on validate. An item with the same key replaces the earlier one.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "key",
          "title",
          "introduced_at",
          "market"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "introduced_at": {
            "type": "string",
            "description": "A checkpoint key."
          },
          "sort_order": {
            "type": "integer"
          },
          "market": {
            "type": "object",
            "required": [
              "code",
              "type",
              "budget",
              "resolution_criteria",
              "x_unit"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "2-40 characters, [a-z0-9_-]; the question's stable identity in the curriculum."
              },
              "type": {
                "enum": [
                  "count",
                  "date"
                ]
              },
              "budget": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "resolution_criteria": {
                "type": "string"
              },
              "x_unit": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "background_info_html": {
                "type": "string"
              },
              "cumulative": {
                "type": "boolean"
              },
              "end_date": {
                "type": "string"
              },
              "resolution_date": {
                "type": "string"
              },
              "number_format": {
                "type": "string"
              },
              "svelte_params": {
                "type": "object"
              }
            }
          },
          "curves": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "keys",
                "thresholds",
                "p0"
              ],
              "properties": {
                "group": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "projection_group; omit for none."
                },
                "keys": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "thresholds": {
                  "type": "array",
                  "items": {
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "description": "Numbers on count markets, ISO date-times on date markets."
                },
                "p0": {
                  "type": "array",
                  "items": {
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "description": "Opening probabilities, 0.001-0.999."
                },
                "labels": {
                  "type": [
                    "array",
                    "string",
                    "null"
                  ]
                },
                "end_dates": {
                  "type": [
                    "array",
                    "string",
                    "null"
                  ]
                },
                "closes_at": {
                  "type": [
                    "array",
                    "string"
                  ]
                },
                "resolves_at": {
                  "type": [
                    "array",
                    "string",
                    "null"
                  ]
                },
                "outcomes": {
                  "type": [
                    "array",
                    "boolean",
                    "null"
                  ]
                },
                "resolution": {
                  "type": [
                    "array",
                    "string"
                  ],
                  "description": "prepared (default) or learner."
                },
                "liquidity_schedule": {
                  "type": [
                    "array",
                    "object",
                    "null"
                  ]
                }
              }
            }
          },
          "submarkets": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "The per-bar form, instead of curves."
          },
          "liquidity_cuts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "house_reprices": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "occurrences": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "count_observations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "key": "q01",
            "title": "First RNAi therapy enters human trials",
            "introduced_at": "cp01",
            "market": {
              "code": "rnai-trial",
              "type": "date",
              "budget": 100,
              "resolution_criteria": "A registered trial of an RNAi therapeutic doses its first patient.",
              "x_unit": "date"
            },
            "curves": [
              {
                "keys": [
                  "y2002",
                  "y2004"
                ],
                "thresholds": [
                  "2002-12-31T23:59:59Z",
                  "2004-12-31T23:59:59Z"
                ],
                "p0": [
                  0.1,
                  0.3
                ],
                "closes_at": "cp02",
                "resolves_at": [
                  "cp02",
                  "cp03"
                ],
                "outcomes": [
                  false,
                  true
                ]
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [
                  "cp01",
                  "cp02",
                  "cp03"
                ],
                "questions": [
                  "q01"
                ],
                "disclosures": []
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/drafts/{version}/questions"
      }
    },
    {
      "id": "timelines_authoring.add_disclosure",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/disclosures",
      "summary": "Add or replace a disclosure in a draft's working manifest.",
      "group": "sandbox authoring",
      "description": "`key`, `checkpoint`, `title` and `body_html`; optional `item` (a question key), `kind` (`evidence`, `result`, `admin_explanation`) and `source_url` (an archived link, RULES.md S2). An entry with the same key replaces the earlier one.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "key",
          "checkpoint",
          "title",
          "body_html"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "checkpoint": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body_html": {
            "type": "string"
          },
          "item": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "source_url": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/timeline_draft_status"
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {
          "body": {
            "key": "d01",
            "checkpoint": "cp01",
            "item": "q01",
            "kind": "evidence",
            "title": "Fire and Mello in Nature",
            "body_html": "<p>Double-stranded RNA silences genes in worms.</p>"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "rnai-history",
              "version": "1.0",
              "state": "receiving",
              "manifest_sha256": null,
              "source_commit": null,
              "schema_version": null,
              "parts_expected": 0,
              "parts_received": 0,
              "parts_imported": 0,
              "received": [],
              "error": null,
              "authoring": {
                "checkpoints": [
                  "cp01",
                  "cp02",
                  "cp03"
                ],
                "questions": [
                  "q01"
                ],
                "disclosures": [
                  "d01"
                ]
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/drafts/{version}/disclosures"
      }
    },
    {
      "id": "timelines_authoring.validate_draft",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/validate",
      "summary": "Validate an imported draft: publish rules (errors) and lint (warnings tagged with RULES.md IDs).",
      "group": "sandbox authoring",
      "description": "A draft built a piece at a time (`POST drafts/{version}` and its checkpoints, questions and disclosures) is imported first when it has changed: 422 with a `path` when it lacks checkpoints or questions or its import fails. A learner of the curriculum gets counts only (`errors` redacted, `lint` empty, `lint_counts` kept).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "valid",
                "errors",
                "warnings",
                "unresolved_past_bar_count",
                "lint",
                "lint_counts"
              ],
              "properties": {
                "valid": {
                  "type": "boolean"
                },
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unresolved_past_bar_count": {
                  "type": "integer"
                },
                "lint": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "rule",
                      "where"
                    ],
                    "properties": {
                      "rule": {
                        "type": "string"
                      },
                      "where": {
                        "type": "string"
                      },
                      "term": {
                        "type": "string"
                      }
                    }
                  }
                },
                "lint_counts": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "valid": true,
              "errors": [],
              "warnings": [],
              "unresolved_past_bar_count": 0,
              "lint": [
                {
                  "rule": "T5",
                  "where": "items[b012].title",
                  "term": "eventually"
                }
              ],
              "lint_counts": {
                "T5": 1
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/drafts/{version}/validate"
      }
    },
    {
      "id": "timelines_authoring.publish_draft",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}/publish",
      "summary": "Publish an imported, valid draft atomically.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "slug",
                "version",
                "status",
                "published_at",
                "manifest_sha256"
              ],
              "properties": {
                "slug": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "published_at": {
                  "type": "string"
                },
                "manifest_sha256": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        },
        "422": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "slug": "biology",
              "version": "1.1",
              "status": "published",
              "published_at": "2026-10-10T20:00:00Z",
              "manifest_sha256": "9f2c000000000000000000000000000000000000000000000000000000000000"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/drafts/{version}/publish"
      }
    },
    {
      "id": "timelines_authoring.delete_draft",
      "method": "DELETE",
      "path": "/api/v1/timelines/curricula/{slug}/drafts/{version}",
      "summary": "Delete a curriculum draft and its staged parts.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "deleted"
              ],
              "properties": {
                "deleted": {
                  "const": true
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "409": {
          "$ref": "#/$defs/push_error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "deleted": true
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "DELETE /api/v1/sandbox/curricula/{slug}/drafts/{version}"
      }
    },
    {
      "id": "timelines_authoring.grant",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/members",
      "summary": "Make an account (username or email) a learner, editor or owner of a curriculum.",
      "group": "sandbox authoring",
      "description": "Bots are refused, and an account with a run in the curriculum cannot be an editor or owner.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "required": [
          "user",
          "role"
        ],
        "properties": {
          "user": {
            "type": "string"
          },
          "role": {
            "enum": [
              "learner",
              "editor",
              "owner"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "user_id",
                "username",
                "role"
              ],
              "properties": {
                "user_id": {
                  "type": "integer"
                },
                "username": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "role": {
                  "type": "string"
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "422": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {
          "body": {
            "user": "nonstationary",
            "role": "learner"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "user_id": 42,
              "username": "nonstationary",
              "role": "learner"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/members"
      }
    },
    {
      "id": "timelines_authoring.revoke",
      "method": "DELETE",
      "path": "/api/v1/timelines/curricula/{slug}/members/{user_id}",
      "summary": "Remove an account from a curriculum.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "removed"
              ],
              "properties": {
                "removed": {
                  "const": true
                }
              }
            }
          }
        },
        "403": {
          "$ref": "#/$defs/error"
        },
        "404": {
          "$ref": "#/$defs/error"
        },
        "422": {
          "$ref": "#/$defs/error"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "removed": true
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "DELETE /api/v1/sandbox/curricula/{slug}/members/{user_id}"
      }
    },
    {
      "id": "timelines_curriculum.append_items",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/versions/{version}/items",
      "summary": "Add new questions to a published curriculum release mid-run.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "introduced_at": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "market": {
                  "type": "object",
                  "properties": {
                    "budget": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "cumulative": {
                      "type": "boolean"
                    },
                    "resolution_criteria": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "x_unit": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "budget",
                    "code",
                    "cumulative",
                    "resolution_criteria",
                    "type",
                    "x_unit"
                  ]
                },
                "submarkets": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "closes_at": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "initial_probability": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string"
                      },
                      "resolved_yes": {
                        "type": "boolean"
                      },
                      "resolves_at": {
                        "type": "string"
                      },
                      "threshold_date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "closes_at",
                      "end_date",
                      "initial_probability",
                      "key",
                      "resolves_at",
                      "threshold_date"
                    ]
                  }
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "introduced_at",
                "key",
                "market",
                "submarkets",
                "title"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "items": [
              {
                "introduced_at": "cp2",
                "key": "p",
                "market": {
                  "budget": "100",
                  "code": "wl4642p",
                  "cumulative": true,
                  "resolution_criteria": "First gadget shipped.",
                  "type": "date",
                  "x_unit": "date"
                },
                "submarkets": [
                  {
                    "closes_at": "cp3",
                    "end_date": "2001-12-31T00:00:00Z",
                    "initial_probability": "0.5",
                    "key": "dec",
                    "resolved_yes": true,
                    "resolves_at": "cp3",
                    "threshold_date": "2001-12-31T00:00:00Z"
                  },
                  {
                    "closes_at": "cp4",
                    "end_date": "2002-12-31T00:00:00Z",
                    "initial_probability": "0.8",
                    "key": "y02",
                    "resolved_yes": true,
                    "resolves_at": "cp4",
                    "threshold_date": "2002-12-31T00:00:00Z"
                  }
                ],
                "title": "When does gadget p ship?"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "added": [
                {
                  "appended_at": "2026-10-10T19:31:15Z",
                  "key": "p",
                  "title": "When does gadget p ship?"
                }
              ],
              "slug": "retro-4674",
              "status": "published",
              "unresolved_past_bar_count": 0,
              "version": "0.1",
              "warnings": []
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/versions/{version}/items"
      }
    },
    {
      "id": "timelines_curriculum.runs",
      "method": "GET",
      "path": "/api/v1/timelines/curricula/{slug}/runs",
      "summary": "Runs of a curriculum you author.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "attempt": 1,
                "checkpoint_at": "2001-09-01T00:00:00Z",
                "checkpoint_key": "cp2",
                "checkpoint_sequence": 2,
                "id": 690,
                "learner": "fbhvkvm",
                "status": "active",
                "version": "0.1"
              }
            ]
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/curricula/{slug}/runs"
      }
    },
    {
      "id": "timelines_curriculum.resolve_bars",
      "method": "POST",
      "path": "/api/v1/timelines/curricula/{slug}/versions/{version}/resolutions",
      "summary": "Record outcomes for a curriculum version's bars.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "resolutions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "type": "string"
                },
                "outcome": {
                  "type": "string"
                },
                "resolves_at": {
                  "type": "string"
                },
                "submarket": {
                  "type": "string"
                }
              },
              "required": [
                "item",
                "outcome",
                "resolves_at",
                "submarket"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "resolutions": [
              {
                "item": "when",
                "outcome": "yes",
                "resolves_at": "cp4",
                "submarket": "y04"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "resolved": 1,
              "slug": "widget-open-86242"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/versions/{version}/resolutions"
      }
    },
    {
      "id": "timelines_run.index",
      "method": "GET",
      "path": "/api/v1/timelines/runs",
      "summary": "Your sandbox runs.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "blockers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "reason",
                        "title"
                      ]
                    }
                  },
                  "checkpoint": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "occurred_at": {
                        "type": "string"
                      },
                      "sequence": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "occurred_at",
                      "sequence",
                      "title"
                    ]
                  },
                  "complete": {
                    "type": "boolean"
                  },
                  "curriculum": {
                    "type": "object",
                    "properties": {
                      "slug": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "slug",
                      "title"
                    ]
                  },
                  "pending_resolutions": {
                    "type": "array"
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "contaminated": {
                          "type": "boolean"
                        },
                        "key": {
                          "type": "string"
                        },
                        "market_code": {
                          "type": "string"
                        },
                        "moderation": {
                          "type": "null"
                        },
                        "open": {
                          "type": "boolean"
                        },
                        "private": {
                          "type": "boolean"
                        },
                        "resolved": {
                          "type": "boolean"
                        },
                        "submitted": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "contaminated",
                        "key",
                        "market_code",
                        "moderation",
                        "open",
                        "private",
                        "resolved",
                        "submitted",
                        "title"
                      ]
                    }
                  },
                  "run_id": {
                    "type": "number"
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "blockers",
                  "checkpoint",
                  "complete",
                  "curriculum",
                  "pending_resolutions",
                  "questions",
                  "run_id",
                  "status"
                ]
              }
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "blockers": [
                  {
                    "key": "paper-a",
                    "reason": "forecast",
                    "title": "Will the paper's primary endpoint be positive?"
                  }
                ],
                "checkpoint": {
                  "key": "opening",
                  "occurred_at": "2020-01-01T00:00:00Z",
                  "sequence": 0,
                  "title": "Opening evidence"
                },
                "complete": false,
                "curriculum": {
                  "slug": "retro-35812",
                  "title": "Biology sandbox 35812"
                },
                "pending_resolutions": [],
                "questions": [
                  {
                    "contaminated": false,
                    "key": "paper-a",
                    "market_code": "rt35812",
                    "moderation": null,
                    "open": true,
                    "private": false,
                    "resolved": false,
                    "submitted": null,
                    "title": "Will the paper's primary endpoint be positive?"
                  }
                ],
                "run_id": 618,
                "status": "active"
              }
            ]
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs"
      }
    },
    {
      "id": "timelines_run.advance",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/advance",
      "summary": "Move a run on to its next checkpoint, or by a week, month or year.",
      "group": "sandboxes",
      "description": "Refused with 422 `unanswered_items` while a question closing at the next checkpoint has neither a forecast nor a skip. With `by=week|month|year` it steps through checkpoints up to that much simulated time and stops early at one that discloses evidence, cuts liquidity, resolves or introduces a question; the response adds `step`. There is no endpoint for placing a sandbox forecast: forecasting happens in the web UI.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "by": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "blockers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "reason",
                      "title"
                    ]
                  }
                },
                "checkpoint": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "occurred_at": {
                      "type": "string"
                    },
                    "sequence": {
                      "type": "number"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "occurred_at",
                    "sequence",
                    "title"
                  ]
                },
                "complete": {
                  "type": "boolean"
                },
                "curriculum": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "slug",
                    "title"
                  ]
                },
                "pending_resolutions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "question": {
                        "type": "string"
                      },
                      "submarket_id": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "label",
                      "question",
                      "submarket_id",
                      "title"
                    ]
                  }
                },
                "questions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "contaminated": {
                        "type": "boolean"
                      },
                      "key": {
                        "type": "string"
                      },
                      "market_code": {
                        "type": "string"
                      },
                      "moderation": {
                        "type": "null"
                      },
                      "open": {
                        "type": "boolean"
                      },
                      "private": {
                        "type": "boolean"
                      },
                      "resolved": {
                        "type": "boolean"
                      },
                      "submitted": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "contaminated",
                      "key",
                      "market_code",
                      "moderation",
                      "open",
                      "private",
                      "resolved",
                      "submitted",
                      "title"
                    ]
                  }
                },
                "run_id": {
                  "type": "number"
                },
                "status": {
                  "type": "string"
                },
                "step": {
                  "type": "object",
                  "properties": {
                    "checkpoints_passed": {
                      "type": "number"
                    },
                    "landed_on_target": {
                      "type": "boolean"
                    },
                    "stopped": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "interrupts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "title"
                        ]
                      }
                    }
                  },
                  "required": [
                    "checkpoints_passed",
                    "landed_on_target",
                    "stopped",
                    "target"
                  ]
                }
              },
              "required": [
                "blockers",
                "checkpoint",
                "complete",
                "curriculum",
                "pending_resolutions",
                "questions",
                "run_id",
                "status"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [],
              "checkpoint": {
                "key": "paper-reveal",
                "occurred_at": "2020-01-01T00:00:00Z",
                "sequence": 1,
                "title": "Paper results"
              },
              "complete": false,
              "curriculum": {
                "slug": "retro-35972",
                "title": "Biology sandbox 35972"
              },
              "pending_resolutions": [],
              "questions": [
                {
                  "contaminated": false,
                  "key": "paper-a",
                  "market_code": "rt35972",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": "skipped",
                  "title": "Will the paper's primary endpoint be positive?"
                }
              ],
              "run_id": 621,
              "status": "active"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/advance"
      }
    },
    {
      "id": "timelines_run.resolve",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/resolutions",
      "summary": "Resolve a bar in your run.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string"
          },
          "submarket_id": {
            "type": "number"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "outcome": "no",
            "submarket_id": 46960
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [],
              "checkpoint": {
                "key": "a2003",
                "occurred_at": "2003-01-01T00:00:00Z",
                "sequence": 2,
                "title": "a2003"
              },
              "complete": false,
              "curriculum": {
                "slug": "retro-69315",
                "title": "Learner resolution 69283"
              },
              "pending_resolutions": [],
              "questions": [
                {
                  "contaminated": false,
                  "key": "when",
                  "market_code": "lr69283",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": "skipped",
                  "title": "When will it happen?"
                }
              ],
              "resolution": {
                "implied_submarket_ids": [],
                "resolved_yes": false,
                "submarket_id": 46960
              },
              "run_id": 689,
              "status": "active"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/resolutions"
      }
    },
    {
      "id": "timelines_run.questions",
      "method": "GET",
      "path": "/api/v1/timelines/runs/{id}/questions",
      "summary": "Questions written in a run.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "bars": [
                  {
                    "closes_at": "cp2",
                    "end_date": "2001-09-30T23:59:59Z",
                    "key": "b1",
                    "label": "By end of Sep 2001",
                    "resolved": false,
                    "resolved_yes": null,
                    "submarket_id": 45553,
                    "threshold_date": "2001-09-30T23:59:59Z",
                    "threshold_decimal": null
                  },
                  {
                    "closes_at": "cp2",
                    "end_date": "2001-10-31T23:59:59Z",
                    "key": "b2",
                    "label": "By end of Oct 2001",
                    "resolved": false,
                    "resolved_yes": null,
                    "submarket_id": 45554,
                    "threshold_date": "2001-10-31T23:59:59Z",
                    "threshold_decimal": null
                  }
                ],
                "code": "p685-1",
                "created_at_checkpoint": "cp1",
                "created_on": "2001-09-01T00:00:00Z",
                "market_type": "date",
                "moderation": null,
                "title": "Date the first widget factory opens"
              }
            ]
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs/{id}/questions"
      }
    },
    {
      "id": "timelines_run.create_question",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/questions",
      "summary": "Write a question in a run.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "by",
                    "p"
                  ]
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array"
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "k",
                        "n",
                        "period",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "horizon",
              "question",
              "resolution",
              "title"
            ]
          }
        }
      },
      "responses": {
        "201": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "spec": {
              "anchors": [
                {
                  "by": "2002-06",
                  "p": 0.3
                },
                {
                  "by": "2003-12",
                  "p": 0.6
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Announced widget factories that opened",
                    "evidence": "Invented: 6 of 20 announced factories opened within two years.",
                    "k": 6,
                    "n": 20,
                    "period": "1990-2000",
                    "sources": []
                  }
                ]
              },
              "horizon": {
                "end": "2003-12"
              },
              "question": "when",
              "resolution": {
                "details": "A factory counts once it ships its first widget.",
                "source": "Reported by the widget trade gazette"
              },
              "title": "Date the first widget factory opens"
            }
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "code": "p679-1",
              "created_at_checkpoint": "cp1",
              "note": "Private to you in this run. It never joins the curriculum; a moderator may flag it, and its outcomes arrive as the run reaches them.",
              "private": true,
              "title": "Date the first widget factory opens",
              "url": "http://localhost:4002/sandbox/retro-354/m/p679-1"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions"
      }
    },
    {
      "id": "timelines_run.preview_question",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/questions/preview",
      "summary": "Check a run question's spec without creating it.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "by",
                    "p"
                  ]
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array"
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "k",
                        "n",
                        "period",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "horizon",
              "question",
              "resolution",
              "title"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "spec": {
              "anchors": [
                {
                  "by": "2002-06",
                  "p": 0.3
                },
                {
                  "by": "2003-12",
                  "p": 0.6
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Announced widget factories that opened",
                    "evidence": "Invented: 6 of 20 announced factories opened within two years.",
                    "k": 6,
                    "n": 20,
                    "period": "1990-2000",
                    "sources": []
                  }
                ]
              },
              "horizon": {
                "end": "2003-12"
              },
              "question": "when",
              "resolution": {
                "details": "A factory counts once it ships its first widget.",
                "source": "Reported by the widget trade gazette"
              },
              "title": "Date the first widget factory opens"
            }
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "curves": [
                {
                  "bars": [
                    {
                      "label": "By end of Sep 2001",
                      "starting_probability": 0.035,
                      "threshold_date": "2001-09-30T23:59:59Z"
                    },
                    {
                      "label": "By end of Oct 2001",
                      "starting_probability": 0.069,
                      "threshold_date": "2001-10-31T23:59:59Z"
                    }
                  ],
                  "curve": "main",
                  "label": ""
                }
              ],
              "issues": [],
              "market": {
                "background_info_html": "<p>The starting probabilities of this market were calculated from base rates: how often comparable things have happened.</p>\n<table><thead><tr><th>Reference class</th><th>What it shows</th><th>Sources</th></tr></thead><tbody>\n<tr><td>Announced widget factories that opened</td><td>6 of 20 (1990-2000)…",
                "budget": 300,
                "cumulative": true,
                "end_date": "2003-12-31T23:59:59Z",
                "resolution_criteria": "<p>Resolves using Reported by the widget trade gazette.</p>\n<p>A factory counts once it ships its first widget.</p>",
                "status": "open",
                "svelte_params": {},
                "title": "Date the first widget factory opens",
                "type": "date",
                "visibility": "private",
                "x_unit": "month"
              },
              "next_options": [
                {
                  "default": "one event",
                  "example": "[{\"key\": \"ai_rd_high\", \"label\": \"AI R&D: high\"}]",
                  "required": false,
                  "set": false,
                  "setting": "items",
                  "values": null,
                  "why": "Several related events in one market, each with its own curve and tab."
                },
                {
                  "default": "none",
                  "example": "{\"kind\": \"after_trigger\", \"trigger\": \"1,000 US troops deploy to Iran\", \"deadline\": \"2027-12-31\", \"window\": {\"months\": 24}, \"title_after\": \"Time for US forces to leave Iran\"}, with anchors like [{\"within\": 6, \"p\": 0.2}, {\"within\": 24, \"p\": 0.6}]",
                  "required": false,
                  "set": false,
                  "setting": "condition",
                  "values": [
                    "none",
                    "after_trigger"
                  ],
                  "why": "After a trigger: count time from an event that hasn't happened yet (\"months after 1,000 troops deploy\"). The market voids if the trigger doesn't happen by its deadline. Anchors then say how likely the event is within N periods of the trigger."
                }
              ],
              "valid": true
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions/preview"
      }
    },
    {
      "id": "timelines_run.moderate_question",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/questions/{code}/moderation",
      "summary": "Accept or reject a run question (curriculum owners).",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "accepted": true,
            "note": "Clear and resolvable."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "code": "p680-1",
              "moderation": {
                "note": "Clear and resolvable.",
                "status": "accepted"
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions/{code}/moderation"
      }
    },
    {
      "id": "timelines_run.resolve_question",
      "method": "POST",
      "path": "/api/v1/timelines/runs/{id}/questions/{code}/resolutions",
      "summary": "Resolve a run question's bars.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "resolutions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "outcome": {
                  "type": "string"
                },
                "resolves_at": {
                  "type": "string"
                },
                "submarket_id": {
                  "type": "number"
                }
              },
              "required": [
                "outcome",
                "resolves_at",
                "submarket_id"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "resolutions": [
              {
                "outcome": "yes",
                "resolves_at": "cp4",
                "submarket_id": 45553
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "code": "p685-1",
              "resolved": 1
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions/{code}/resolutions"
      }
    },
    {
      "id": "retrocasting.append_items",
      "method": "POST",
      "path": "/api/v1/retrocasting/curricula/{slug}/versions/{version}/items",
      "summary": "Add new questions to a published curriculum release mid-run.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "introduced_at": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "market": {
                  "type": "object",
                  "properties": {
                    "budget": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "cumulative": {
                      "type": "boolean"
                    },
                    "resolution_criteria": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "x_unit": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "budget",
                    "code",
                    "cumulative",
                    "resolution_criteria",
                    "type",
                    "x_unit"
                  ]
                },
                "submarkets": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "closes_at": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "initial_probability": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string"
                      },
                      "resolved_yes": {
                        "type": "boolean"
                      },
                      "resolves_at": {
                        "type": "string"
                      },
                      "threshold_date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "closes_at",
                      "end_date",
                      "initial_probability",
                      "key",
                      "resolves_at",
                      "threshold_date"
                    ]
                  }
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "introduced_at",
                "key",
                "market",
                "submarkets",
                "title"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "items": [
              {
                "introduced_at": "cp2",
                "key": "p",
                "market": {
                  "budget": "100",
                  "code": "wl4642p",
                  "cumulative": true,
                  "resolution_criteria": "First gadget shipped.",
                  "type": "date",
                  "x_unit": "date"
                },
                "submarkets": [
                  {
                    "closes_at": "cp3",
                    "end_date": "2001-12-31T00:00:00Z",
                    "initial_probability": "0.5",
                    "key": "dec",
                    "resolved_yes": true,
                    "resolves_at": "cp3",
                    "threshold_date": "2001-12-31T00:00:00Z"
                  },
                  {
                    "closes_at": "cp4",
                    "end_date": "2002-12-31T00:00:00Z",
                    "initial_probability": "0.8",
                    "key": "y02",
                    "resolved_yes": true,
                    "resolves_at": "cp4",
                    "threshold_date": "2002-12-31T00:00:00Z"
                  }
                ],
                "title": "When does gadget p ship?"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "added": [
                {
                  "appended_at": "2026-10-10T19:31:15Z",
                  "key": "p",
                  "title": "When does gadget p ship?"
                }
              ],
              "slug": "retro-4674",
              "status": "published",
              "unresolved_past_bar_count": 0,
              "version": "0.1",
              "warnings": []
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/versions/{version}/items"
      }
    },
    {
      "id": "retrocasting.runs",
      "method": "GET",
      "path": "/api/v1/retrocasting/curricula/{slug}/runs",
      "summary": "Runs of a curriculum you author.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "attempt": 1,
                "checkpoint_at": "2001-09-01T00:00:00Z",
                "checkpoint_key": "cp2",
                "checkpoint_sequence": 2,
                "id": 690,
                "learner": "fbhvkvm",
                "status": "active",
                "version": "0.1"
              }
            ]
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/curricula/{slug}/runs"
      }
    },
    {
      "id": "retrocasting.resolve_bars",
      "method": "POST",
      "path": "/api/v1/retrocasting/curricula/{slug}/versions/{version}/resolutions",
      "summary": "Record outcomes for a curriculum version's bars.",
      "group": "sandbox authoring",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "resolutions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "type": "string"
                },
                "outcome": {
                  "type": "string"
                },
                "resolves_at": {
                  "type": "string"
                },
                "submarket": {
                  "type": "string"
                }
              },
              "required": [
                "item",
                "outcome",
                "resolves_at",
                "submarket"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "resolutions": [
              {
                "item": "when",
                "outcome": "yes",
                "resolves_at": "cp4",
                "submarket": "y04"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "resolved": 1,
              "slug": "widget-open-86242"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/curricula/{slug}/versions/{version}/resolutions"
      }
    },
    {
      "id": "retrocasting_run.index",
      "method": "GET",
      "path": "/api/v1/retrocasting/runs",
      "summary": "Your retrocasting runs.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "blockers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "reason",
                        "title"
                      ]
                    }
                  },
                  "checkpoint": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "occurred_at": {
                        "type": "string"
                      },
                      "sequence": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "occurred_at",
                      "sequence",
                      "title"
                    ]
                  },
                  "complete": {
                    "type": "boolean"
                  },
                  "curriculum": {
                    "type": "object",
                    "properties": {
                      "slug": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "slug",
                      "title"
                    ]
                  },
                  "pending_resolutions": {
                    "type": "array"
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "contaminated": {
                          "type": "boolean"
                        },
                        "key": {
                          "type": "string"
                        },
                        "market_code": {
                          "type": "string"
                        },
                        "moderation": {
                          "type": "null"
                        },
                        "open": {
                          "type": "boolean"
                        },
                        "private": {
                          "type": "boolean"
                        },
                        "resolved": {
                          "type": "boolean"
                        },
                        "submitted": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "contaminated",
                        "key",
                        "market_code",
                        "moderation",
                        "open",
                        "private",
                        "resolved",
                        "submitted",
                        "title"
                      ]
                    }
                  },
                  "run_id": {
                    "type": "number"
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "blockers",
                  "checkpoint",
                  "complete",
                  "curriculum",
                  "pending_resolutions",
                  "questions",
                  "run_id",
                  "status"
                ]
              }
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "blockers": [
                  {
                    "key": "paper-a",
                    "reason": "forecast",
                    "title": "Will the paper's primary endpoint be positive?"
                  }
                ],
                "checkpoint": {
                  "key": "opening",
                  "occurred_at": "2020-01-01T00:00:00Z",
                  "sequence": 0,
                  "title": "Opening evidence"
                },
                "complete": false,
                "curriculum": {
                  "slug": "retro-35812",
                  "title": "Biology sandbox 35812"
                },
                "pending_resolutions": [],
                "questions": [
                  {
                    "contaminated": false,
                    "key": "paper-a",
                    "market_code": "rt35812",
                    "moderation": null,
                    "open": true,
                    "private": false,
                    "resolved": false,
                    "submitted": null,
                    "title": "Will the paper's primary endpoint be positive?"
                  }
                ],
                "run_id": 618,
                "status": "active"
              }
            ]
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs"
      }
    },
    {
      "id": "retrocasting_run.show",
      "method": "GET",
      "path": "/api/v1/retrocasting/runs/{id}",
      "summary": "One of your retrocasting runs.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "blockers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "reason",
                      "title"
                    ]
                  }
                },
                "checkpoint": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "occurred_at": {
                      "type": "string"
                    },
                    "sequence": {
                      "type": "number"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "occurred_at",
                    "sequence",
                    "title"
                  ]
                },
                "complete": {
                  "type": "boolean"
                },
                "curriculum": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "slug",
                    "title"
                  ]
                },
                "pending_resolutions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "question": {
                        "type": "string"
                      },
                      "submarket_id": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "label",
                      "question",
                      "submarket_id",
                      "title"
                    ]
                  }
                },
                "questions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "contaminated": {
                        "type": "boolean"
                      },
                      "key": {
                        "type": "string"
                      },
                      "market_code": {
                        "type": "string"
                      },
                      "moderation": {
                        "type": "null"
                      },
                      "open": {
                        "type": "boolean"
                      },
                      "private": {
                        "type": "boolean"
                      },
                      "resolved": {
                        "type": "boolean"
                      },
                      "submitted": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "contaminated",
                      "key",
                      "market_code",
                      "moderation",
                      "open",
                      "private",
                      "resolved",
                      "submitted",
                      "title"
                    ]
                  }
                },
                "run_id": {
                  "type": "number"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "blockers",
                "checkpoint",
                "complete",
                "curriculum",
                "pending_resolutions",
                "questions",
                "run_id",
                "status"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [],
              "checkpoint": {
                "key": "a2002",
                "occurred_at": "2002-01-01T00:00:00Z",
                "sequence": 1,
                "title": "a2002"
              },
              "complete": false,
              "curriculum": {
                "slug": "retro-69315",
                "title": "Learner resolution 69283"
              },
              "pending_resolutions": [],
              "questions": [
                {
                  "contaminated": false,
                  "key": "when",
                  "market_code": "lr69283",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": "skipped",
                  "title": "When will it happen?"
                }
              ],
              "run_id": 689,
              "status": "active"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs/{id}"
      }
    },
    {
      "id": "retrocasting_run.advance",
      "method": "POST",
      "path": "/api/v1/retrocasting/runs/{id}/advance",
      "summary": "Move a run on to its next checkpoint, or by a week, month or year.",
      "group": "sandboxes",
      "description": "Refused with 422 `unanswered_items` while a question closing at the next checkpoint has neither a forecast nor a skip. With `by=week|month|year` it steps through checkpoints up to that much simulated time and stops early at one that discloses evidence, cuts liquidity, resolves or introduces a question; the response adds `step`. There is no endpoint for placing a retrocasting forecast: forecasting happens in the web UI.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "by": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "blockers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "reason",
                      "title"
                    ]
                  }
                },
                "checkpoint": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "occurred_at": {
                      "type": "string"
                    },
                    "sequence": {
                      "type": "number"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "occurred_at",
                    "sequence",
                    "title"
                  ]
                },
                "complete": {
                  "type": "boolean"
                },
                "curriculum": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "slug",
                    "title"
                  ]
                },
                "pending_resolutions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "question": {
                        "type": "string"
                      },
                      "submarket_id": {
                        "type": "number"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "label",
                      "question",
                      "submarket_id",
                      "title"
                    ]
                  }
                },
                "questions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "contaminated": {
                        "type": "boolean"
                      },
                      "key": {
                        "type": "string"
                      },
                      "market_code": {
                        "type": "string"
                      },
                      "moderation": {
                        "type": "null"
                      },
                      "open": {
                        "type": "boolean"
                      },
                      "private": {
                        "type": "boolean"
                      },
                      "resolved": {
                        "type": "boolean"
                      },
                      "submitted": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "contaminated",
                      "key",
                      "market_code",
                      "moderation",
                      "open",
                      "private",
                      "resolved",
                      "submitted",
                      "title"
                    ]
                  }
                },
                "run_id": {
                  "type": "number"
                },
                "status": {
                  "type": "string"
                },
                "step": {
                  "type": "object",
                  "properties": {
                    "checkpoints_passed": {
                      "type": "number"
                    },
                    "landed_on_target": {
                      "type": "boolean"
                    },
                    "stopped": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "interrupts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "title"
                        ]
                      }
                    }
                  },
                  "required": [
                    "checkpoints_passed",
                    "landed_on_target",
                    "stopped",
                    "target"
                  ]
                }
              },
              "required": [
                "blockers",
                "checkpoint",
                "complete",
                "curriculum",
                "pending_resolutions",
                "questions",
                "run_id",
                "status"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [],
              "checkpoint": {
                "key": "paper-reveal",
                "occurred_at": "2020-01-01T00:00:00Z",
                "sequence": 1,
                "title": "Paper results"
              },
              "complete": false,
              "curriculum": {
                "slug": "retro-35972",
                "title": "Biology sandbox 35972"
              },
              "pending_resolutions": [],
              "questions": [
                {
                  "contaminated": false,
                  "key": "paper-a",
                  "market_code": "rt35972",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": "skipped",
                  "title": "Will the paper's primary endpoint be positive?"
                }
              ],
              "run_id": 621,
              "status": "active"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/advance"
      }
    },
    {
      "id": "retrocasting_run.resolve",
      "method": "POST",
      "path": "/api/v1/retrocasting/runs/{id}/resolutions",
      "summary": "Resolve a bar in your run.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string"
          },
          "submarket_id": {
            "type": "number"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "outcome": "no",
            "submarket_id": 46960
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "blockers": [],
              "checkpoint": {
                "key": "a2003",
                "occurred_at": "2003-01-01T00:00:00Z",
                "sequence": 2,
                "title": "a2003"
              },
              "complete": false,
              "curriculum": {
                "slug": "retro-69315",
                "title": "Learner resolution 69283"
              },
              "pending_resolutions": [],
              "questions": [
                {
                  "contaminated": false,
                  "key": "when",
                  "market_code": "lr69283",
                  "moderation": null,
                  "open": true,
                  "private": false,
                  "resolved": false,
                  "submitted": "skipped",
                  "title": "When will it happen?"
                }
              ],
              "resolution": {
                "implied_submarket_ids": [],
                "resolved_yes": false,
                "submarket_id": 46960
              },
              "run_id": 689,
              "status": "active"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/resolutions"
      }
    },
    {
      "id": "retrocasting_run.questions",
      "method": "GET",
      "path": "/api/v1/retrocasting/runs/{id}/questions",
      "summary": "Questions written in a run.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "bars": [
                  {
                    "closes_at": "cp2",
                    "end_date": "2001-09-30T23:59:59Z",
                    "key": "b1",
                    "label": "By end of Sep 2001",
                    "resolved": false,
                    "resolved_yes": null,
                    "submarket_id": 45553,
                    "threshold_date": "2001-09-30T23:59:59Z",
                    "threshold_decimal": null
                  },
                  {
                    "closes_at": "cp2",
                    "end_date": "2001-10-31T23:59:59Z",
                    "key": "b2",
                    "label": "By end of Oct 2001",
                    "resolved": false,
                    "resolved_yes": null,
                    "submarket_id": 45554,
                    "threshold_date": "2001-10-31T23:59:59Z",
                    "threshold_decimal": null
                  }
                ],
                "code": "p685-1",
                "created_at_checkpoint": "cp1",
                "created_on": "2001-09-01T00:00:00Z",
                "market_type": "date",
                "moderation": null,
                "title": "Date the first widget factory opens"
              }
            ]
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "GET /api/v1/sandbox/runs/{id}/questions"
      }
    },
    {
      "id": "retrocasting_run.create_question",
      "method": "POST",
      "path": "/api/v1/retrocasting/runs/{id}/questions",
      "summary": "Write a question in a run.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "by",
                    "p"
                  ]
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array"
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "k",
                        "n",
                        "period",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "horizon",
              "question",
              "resolution",
              "title"
            ]
          }
        }
      },
      "responses": {
        "201": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "spec": {
              "anchors": [
                {
                  "by": "2002-06",
                  "p": 0.3
                },
                {
                  "by": "2003-12",
                  "p": 0.6
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Announced widget factories that opened",
                    "evidence": "Invented: 6 of 20 announced factories opened within two years.",
                    "k": 6,
                    "n": 20,
                    "period": "1990-2000",
                    "sources": []
                  }
                ]
              },
              "horizon": {
                "end": "2003-12"
              },
              "question": "when",
              "resolution": {
                "details": "A factory counts once it ships its first widget.",
                "source": "Reported by the widget trade gazette"
              },
              "title": "Date the first widget factory opens"
            }
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "code": "p679-1",
              "created_at_checkpoint": "cp1",
              "note": "Private to you in this run. It never joins the curriculum; a moderator may flag it, and its outcomes arrive as the run reaches them.",
              "private": true,
              "title": "Date the first widget factory opens",
              "url": "http://localhost:4002/sandbox/retro-354/m/p679-1"
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions"
      }
    },
    {
      "id": "retrocasting_run.preview_question",
      "method": "POST",
      "path": "/api/v1/retrocasting/runs/{id}/questions/preview",
      "summary": "Check a run question's spec without creating it.",
      "group": "sandboxes",
      "auth": "read",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "by",
                    "p"
                  ]
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array"
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "k",
                        "n",
                        "period",
                        "sources"
                      ]
                    }
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "horizon",
              "question",
              "resolution",
              "title"
            ]
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "spec": {
              "anchors": [
                {
                  "by": "2002-06",
                  "p": 0.3
                },
                {
                  "by": "2003-12",
                  "p": 0.6
                }
              ],
              "basis": {
                "reference_classes": [
                  {
                    "description": "Announced widget factories that opened",
                    "evidence": "Invented: 6 of 20 announced factories opened within two years.",
                    "k": 6,
                    "n": 20,
                    "period": "1990-2000",
                    "sources": []
                  }
                ]
              },
              "horizon": {
                "end": "2003-12"
              },
              "question": "when",
              "resolution": {
                "details": "A factory counts once it ships its first widget.",
                "source": "Reported by the widget trade gazette"
              },
              "title": "Date the first widget factory opens"
            }
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "curves": [
                {
                  "bars": [
                    {
                      "label": "By end of Sep 2001",
                      "starting_probability": 0.035,
                      "threshold_date": "2001-09-30T23:59:59Z"
                    },
                    {
                      "label": "By end of Oct 2001",
                      "starting_probability": 0.069,
                      "threshold_date": "2001-10-31T23:59:59Z"
                    }
                  ],
                  "curve": "main",
                  "label": ""
                }
              ],
              "issues": [],
              "market": {
                "background_info_html": "<p>The starting probabilities of this market were calculated from base rates: how often comparable things have happened.</p>\n<table><thead><tr><th>Reference class</th><th>What it shows</th><th>Sources</th></tr></thead><tbody>\n<tr><td>Announced widget factories that opened</td><td>6 of 20 (1990-2000)…",
                "budget": 300,
                "cumulative": true,
                "end_date": "2003-12-31T23:59:59Z",
                "resolution_criteria": "<p>Resolves using Reported by the widget trade gazette.</p>\n<p>A factory counts once it ships its first widget.</p>",
                "status": "open",
                "svelte_params": {},
                "title": "Date the first widget factory opens",
                "type": "date",
                "visibility": "private",
                "x_unit": "month"
              },
              "next_options": [
                {
                  "default": "one event",
                  "example": "[{\"key\": \"ai_rd_high\", \"label\": \"AI R&D: high\"}]",
                  "required": false,
                  "set": false,
                  "setting": "items",
                  "values": null,
                  "why": "Several related events in one market, each with its own curve and tab."
                },
                {
                  "default": "none",
                  "example": "{\"kind\": \"after_trigger\", \"trigger\": \"1,000 US troops deploy to Iran\", \"deadline\": \"2027-12-31\", \"window\": {\"months\": 24}, \"title_after\": \"Time for US forces to leave Iran\"}, with anchors like [{\"within\": 6, \"p\": 0.2}, {\"within\": 24, \"p\": 0.6}]",
                  "required": false,
                  "set": false,
                  "setting": "condition",
                  "values": [
                    "none",
                    "after_trigger"
                  ],
                  "why": "After a trigger: count time from an event that hasn't happened yet (\"months after 1,000 troops deploy\"). The market voids if the trigger doesn't happen by its deadline. Anchors then say how likely the event is within N periods of the trigger."
                }
              ],
              "valid": true
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions/preview"
      }
    },
    {
      "id": "retrocasting_run.moderate_question",
      "method": "POST",
      "path": "/api/v1/retrocasting/runs/{id}/questions/{code}/moderation",
      "summary": "Accept or reject a run question (curriculum owners).",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "accepted": true,
            "note": "Clear and resolvable."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "code": "p680-1",
              "moderation": {
                "note": "Clear and resolvable.",
                "status": "accepted"
              }
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions/{code}/moderation"
      }
    },
    {
      "id": "retrocasting_run.resolve_question",
      "method": "POST",
      "path": "/api/v1/retrocasting/runs/{id}/questions/{code}/resolutions",
      "summary": "Resolve a run question's bars.",
      "group": "sandboxes",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "resolutions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "outcome": {
                  "type": "string"
                },
                "resolves_at": {
                  "type": "string"
                },
                "submarket_id": {
                  "type": "number"
                }
              },
              "required": [
                "outcome",
                "resolves_at",
                "submarket_id"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "resolutions": [
              {
                "outcome": "yes",
                "resolves_at": "cp4",
                "submarket_id": 45553
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "code": "p685-1",
              "resolved": 1
            }
          }
        }
      },
      "deprecated": {
        "since": "2026-10-11",
        "sunset": "2027-04-11",
        "link": "https://antistatic.exchange/api.md#deprecated-routes",
        "use": "POST /api/v1/sandbox/runs/{id}/questions/{code}/resolutions"
      }
    },
    {
      "id": "market_spec.create",
      "method": "POST",
      "path": "/api/v1/market-specs",
      "summary": "Create a private market from a spec.",
      "group": "making markets",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "spec": {
            "type": "object",
            "properties": {
              "anchors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "by": {
                      "type": "string"
                    },
                    "p": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "by",
                    "p"
                  ]
                }
              },
              "basis": {
                "type": "object",
                "properties": {
                  "reference_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": "string"
                        },
                        "k": {
                          "type": "number"
                        },
                        "n": {
                          "type": "number"
                        },
                        "period": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "title"
                            ]
                          }
                        }
                      },
                      "required": [
                        "description",
                        "evidence",
                        "k",
                        "n",
                        "period",
                        "sources"
                      ]
                    }
                  },
                  "judgement": {
                    "type": "string"
                  }
                },
                "required": [
                  "reference_classes"
                ]
              },
              "horizon": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string"
                  }
                },
                "required": [
                  "end"
                ]
              },
              "question": {
                "type": "string"
              },
              "resolution": {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "string"
                  },
                  "excludes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "includes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "details",
                  "excludes",
                  "source"
                ]
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "anchors",
              "basis",
              "horizon",
              "question",
              "resolution",
              "title"
            ]
          },
          "question": {
            "type": "string"
          }
        },
        "required": [
          "spec"
        ]
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "following": {
                  "type": "boolean"
                },
                "local_code": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "subscribed_to_comments": {
                  "type": "boolean"
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "visibility": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "following",
                "local_code",
                "note",
                "reference",
                "subscribed_to_comments",
                "title",
                "url",
                "visibility"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "spec": {
              "anchors": [
                {
                  "by": "2028-12",
                  "p": 0.15
                },
                {
                  "by": "2032-12",
                  "p": 0.55
                }
              ],
              "basis": {
                "judgement": "Sample market for directory reviewers.",
                "reference_classes": [
                  {
                    "description": "Years since Apollo 17 with a crewed lunar landing",
                    "evidence": "None in the 53 years 1973-2025: Laplace's rule gives about 2% a year, raised for the crewed landing programmes now under way.",
                    "k": 0,
                    "n": 53,
                    "period": "1973-2025",
                    "sources": [
                      {
                        "title": "NASA history of the Apollo programme"
                      }
                    ]
                  }
                ]
              },
              "horizon": {
                "end": "2032-12"
              },
              "question": "when",
              "resolution": {
                "details": "A spacecraft carrying at least one person lands on the Moon's surface, as announced by whoever flew it.",
                "excludes": [
                  "Uncrewed landings",
                  "Crewed flybys and orbits without a landing"
                ],
                "source": "The space agency or company that flew the mission"
              },
              "title": "Date a crewed spacecraft next lands on the Moon"
            }
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "code": "~6590",
              "following": true,
              "local_code": "crewed",
              "note": "Private to you and your API tokens. To let others forecast on it, ask for a public listing (the antistatic_request_public_listing tool, or antistatic market request-public on the command line). Admins review requests and you are notified by email and on the site when they decide.",
              "reference": "~6590",
              "subscribed_to_comments": true,
              "title": "Date a crewed spacecraft next lands on the Moon",
              "url": "http://localhost:4002/m/~6590",
              "visibility": "private"
            }
          }
        }
      }
    },
    {
      "id": "feedback.create",
      "method": "POST",
      "path": "/api/v1/feedback",
      "summary": "Send a problem or suggestion to the Antistatic team.",
      "group": "account",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "client": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ]
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string"
            },
            "ok": {
              "type": "boolean"
            }
          },
          "required": [
            "kind",
            "ok"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "client": "MCP (default)",
            "kind": "suggestion",
            "message": "Previews could show bar counts"
          }
        },
        "response": {
          "status": 201,
          "body": {
            "kind": "suggestion",
            "ok": true
          }
        }
      }
    },
    {
      "id": "settings.update",
      "method": "PATCH",
      "path": "/api/v1/me/settings",
      "summary": "Change your settings (a partial object of the GET shape).",
      "group": "account",
      "description": "Unknown keys are refused with 422. Email, password, API tokens, connections and billing change only at `sensitive_settings_url`.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "auto_double_down": {
            "type": "boolean"
          },
          "email": {
            "type": "object",
            "properties": {
              "double_down_opportunities": {
                "type": "boolean"
              },
              "replies": {
                "type": "boolean"
              },
              "password": {
                "type": "boolean"
              },
              "bot_comments": {
                "type": "boolean"
              }
            }
          },
          "follow_own_markets": {
            "type": [
              "string",
              "boolean"
            ]
          },
          "bot": {
            "type": "object",
            "properties": {
              "paused": {
                "type": "boolean"
              },
              "username": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "settings": {
              "type": "object",
              "properties": {
                "auto_double_down": {
                  "type": "boolean"
                },
                "bot": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "paused": {
                      "type": "boolean"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "paused",
                    "username"
                  ]
                },
                "email": {
                  "type": "object",
                  "properties": {
                    "bot_comments": {
                      "type": "boolean"
                    },
                    "double_down_opportunities": {
                      "type": "boolean"
                    },
                    "forecast_resolution": {
                      "type": "boolean"
                    },
                    "market_resolution": {
                      "type": "boolean"
                    },
                    "mentions": {
                      "type": "boolean"
                    },
                    "new_comments": {
                      "type": "boolean"
                    },
                    "replies": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "bot_comments",
                    "double_down_opportunities",
                    "forecast_resolution",
                    "market_resolution",
                    "mentions",
                    "new_comments",
                    "replies"
                  ]
                },
                "follow_own_markets": {
                  "type": "boolean"
                },
                "sensitive_settings_url": {
                  "type": "string"
                },
                "subscribe_to_own_market_comments": {
                  "type": "boolean"
                },
                "show_other_players_comments": {
                  "type": "boolean"
                },
                "share_sandbox_comments": {
                  "type": "boolean"
                }
              },
              "required": [
                "auto_double_down",
                "bot",
                "email",
                "follow_own_markets",
                "sensitive_settings_url",
                "share_sandbox_comments",
                "show_other_players_comments",
                "subscribe_to_own_market_comments"
              ]
            }
          },
          "required": [
            "settings"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "email": {
              "bot_comments": true
            }
          }
        },
        "response": {
          "status": 200,
          "body": {
            "settings": {
              "auto_double_down": false,
              "bot": null,
              "email": {
                "bot_comments": true,
                "double_down_opportunities": true,
                "forecast_resolution": true,
                "market_resolution": true,
                "mentions": true,
                "new_comments": true,
                "replies": true
              },
              "follow_own_markets": true,
              "sensitive_settings_url": "http://localhost:4002/users/settings",
              "subscribe_to_own_market_comments": true,
              "show_other_players_comments": false,
              "share_sandbox_comments": false
            }
          }
        }
      }
    },
    {
      "id": "market.update",
      "method": "PATCH",
      "path": "/api/v1/markets/{code}",
      "summary": "Edit a market you own: title, unit, item labels and colours, resolution and background.",
      "group": "your markets",
      "description": "Any of `title`, `unit`, `items` (`[{key, label, color}]`), and for private markets `resolution_criteria` and `background` (HTML).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "background": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "color": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "color",
                "key",
                "label"
              ]
            }
          },
          "resolution_criteria": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "background_info_html": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "budget": {
                  "type": "number"
                },
                "code": {
                  "type": "string"
                },
                "cumulative": {
                  "type": "boolean"
                },
                "end_date": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": "number"
                },
                "inserted_at": {
                  "type": "string"
                },
                "local_code": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "resolution_criteria": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "visibility": {
                  "type": "string"
                },
                "x_unit": {
                  "type": "string"
                }
              },
              "required": [
                "background_info_html",
                "budget",
                "code",
                "cumulative",
                "end_date",
                "id",
                "inserted_at",
                "local_code",
                "reference",
                "resolution_criteria",
                "status",
                "title",
                "type",
                "visibility",
                "x_unit"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "title": "Renamed",
            "unit": "cases"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "background_info_html": null,
              "budget": 100.0,
              "code": "mcp-test",
              "cumulative": true,
              "end_date": "2027-11-14T19:22:06Z",
              "id": 5647,
              "inserted_at": "2026-10-10T19:22:06Z",
              "local_code": "mcp-test",
              "reference": "mcp-test",
              "resolution_criteria": "Criteria",
              "status": "open",
              "title": "Renamed",
              "type": "count",
              "visibility": "public",
              "x_unit": "cases"
            }
          }
        }
      }
    },
    {
      "id": "market.extend",
      "method": "POST",
      "path": "/api/v1/markets/{code}/extend",
      "summary": "Widen a how-much market's thresholds, add later periods, or move a when-market's horizon later.",
      "group": "your markets",
      "description": "For a market you own. How-much: widen its thresholds when values near its top or bottom bar; add later periods when its last period is ending. `thresholds` `{to, from}`: a new top and/or bottom, the ladder continued at its scale and spacing; `to`: the last new period (\"YYYY-MM\" or a date), at the market's cadence; `anchors`: as a market spec's (`[{period, quantiles: {10, 50, 90}}]` or `[{period, points}]`), naming open or new periods. When: `to` is the new last date, at the market's cadence, and `anchors` (`[{by, p}]`) name dates after the curve's last bar, at or above its chance. A market with items takes anchors by item key (`{\"anthropic\": [...]}`); `items` (keys) picks the items to extend, all of them by default (a when-market's open ones); each item's curve extends on its own ladder and periods. New bars are priced from the anchors' fitted line, joined onto each curve's current end bar. Existing bars, positions, forecasts and resolutions stay. Each period keeps its total liquidity (a widened period's bars share it); new periods bring their own at the market's rate, and the budget grows by that. A settled period's new bars settle from its recorded value (or the bars it settled); past its old end bar with no recorded value they stay open and are listed in `needs_value` (period ends, prefixed by the item key on a market with items) to resolve. `preview: true` checks it and returns the bars without changing anything. Errors: 422 `invalid_params`, or `invalid_spec` with `issues`.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "thresholds": {
            "type": "object",
            "properties": {
              "to": {
                "type": "number"
              },
              "from": {
                "type": "number"
              }
            }
          },
          "to": {
            "type": "string"
          },
          "anchors": {
            "type": [
              "array",
              "object"
            ]
          },
          "preview": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "market": {
                  "type": "object",
                  "properties": {
                    "background_info_html": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "budget": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "cumulative": {
                      "type": "boolean"
                    },
                    "end_date": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "id": {
                      "type": "number"
                    },
                    "inserted_at": {
                      "type": "string"
                    },
                    "local_code": {
                      "type": "string"
                    },
                    "reference": {
                      "type": "string"
                    },
                    "resolution_criteria": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "visibility": {
                      "type": "string"
                    },
                    "x_unit": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "background_info_html",
                    "budget",
                    "code",
                    "cumulative",
                    "end_date",
                    "id",
                    "inserted_at",
                    "local_code",
                    "reference",
                    "resolution_criteria",
                    "status",
                    "title",
                    "type",
                    "visibility",
                    "x_unit"
                  ]
                },
                "preview": {
                  "type": "boolean"
                },
                "added": {
                  "type": "number"
                },
                "settled": {
                  "type": "number"
                },
                "needs_value": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "bars": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "threshold": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "probability": {
                        "type": "number"
                      },
                      "resolved_yes": {
                        "type": [
                          "boolean",
                          "null"
                        ]
                      },
                      "item": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "threshold",
                      "end_date",
                      "probability",
                      "resolved_yes"
                    ]
                  }
                }
              },
              "required": [
                "added",
                "settled",
                "needs_value"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "thresholds": {
              "to": 70
            },
            "anchors": [
              {
                "period": "2026-11",
                "quantiles": {
                  "10": 15,
                  "50": 35,
                  "90": 60
                }
              }
            ],
            "preview": true
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "preview": true,
              "added": 2,
              "settled": 0,
              "needs_value": [],
              "bars": [
                {
                  "threshold": 60.0,
                  "end_date": "2026-11-30T23:59:59Z",
                  "probability": 0.042,
                  "resolved_yes": null,
                  "item": null
                },
                {
                  "threshold": 70.0,
                  "end_date": "2026-11-30T23:59:59Z",
                  "probability": 0.009,
                  "resolved_yes": null,
                  "item": null
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "market_follow.follow",
      "method": "PUT",
      "path": "/api/v1/markets/{code}/follow",
      "summary": "Follow a market.",
      "group": "account",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object"
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "following": {
              "type": "boolean"
            }
          },
          "required": [
            "following"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "following": true
          }
        }
      }
    },
    {
      "id": "market_follow.unfollow",
      "method": "DELETE",
      "path": "/api/v1/markets/{code}/follow",
      "summary": "Unfollow a market.",
      "group": "account",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "following": {
              "type": "boolean"
            }
          },
          "required": [
            "following"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "following": false
          }
        }
      }
    },
    {
      "id": "market_follow.subscribe",
      "method": "PUT",
      "path": "/api/v1/markets/{code}/comment-subscription",
      "summary": "Get notified of a market's new comments.",
      "group": "account",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object"
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "subscribed": {
              "type": "boolean"
            }
          },
          "required": [
            "subscribed"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "subscribed": true
          }
        }
      }
    },
    {
      "id": "market_follow.unsubscribe",
      "method": "DELETE",
      "path": "/api/v1/markets/{code}/comment-subscription",
      "summary": "Stop notifications of a market's new comments.",
      "group": "account",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "subscribed": {
              "type": "boolean"
            }
          },
          "required": [
            "subscribed"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "subscribed": false
          }
        }
      }
    },
    {
      "id": "publication_request.create",
      "method": "POST",
      "path": "/api/v1/markets/{code}/publication-request",
      "summary": "Ask for a market you own to be listed publicly.",
      "group": "your markets",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "market": {
                  "type": "string"
                },
                "request": {
                  "type": "object",
                  "properties": {
                    "admin_note": {
                      "type": "null"
                    },
                    "decided_at": {
                      "type": "null"
                    },
                    "id": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "admin_note",
                    "decided_at",
                    "id",
                    "message",
                    "requested_at",
                    "status",
                    "updated_at"
                  ]
                },
                "visibility": {
                  "type": "string"
                }
              },
              "required": [
                "market",
                "request",
                "visibility"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "message": "Useful for everyone"
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "market": "t4615",
              "request": {
                "admin_note": null,
                "decided_at": null,
                "id": 71,
                "message": "Useful for everyone",
                "requested_at": "2026-10-10T19:17:22Z",
                "status": "pending",
                "updated_at": "2026-10-10T19:17:22Z"
              },
              "visibility": "private"
            }
          }
        }
      }
    },
    {
      "id": "publication_request.delete",
      "method": "DELETE",
      "path": "/api/v1/markets/{code}/publication-request",
      "summary": "Withdraw a public-listing request.",
      "group": "your markets",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "market": {
                  "type": "string"
                },
                "request": {
                  "type": "object",
                  "properties": {
                    "admin_note": {
                      "type": "null"
                    },
                    "decided_at": {
                      "type": "null"
                    },
                    "id": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "admin_note",
                    "decided_at",
                    "id",
                    "message",
                    "requested_at",
                    "status",
                    "updated_at"
                  ]
                },
                "visibility": {
                  "type": "string"
                }
              },
              "required": [
                "market",
                "request",
                "visibility"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "market": "t2342",
              "request": {
                "admin_note": null,
                "decided_at": null,
                "id": 70,
                "message": "first",
                "requested_at": "2026-10-10T19:17:16Z",
                "status": "withdrawn",
                "updated_at": "2026-10-10T19:17:21Z"
              },
              "visibility": "private"
            }
          }
        }
      }
    },
    {
      "id": "sharing.create_link",
      "method": "POST",
      "path": "/api/v1/markets/{code}/share-link",
      "summary": "Create (or replace) a private market's share link (Pro).",
      "group": "sharing",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "ttl_days": {
            "type": "number"
          }
        }
      },
      "responses": {
        "201": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "created_at": {
                  "type": "string"
                },
                "expires_at": {
                  "type": "string"
                },
                "revoked_at": {
                  "type": "null"
                },
                "state": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "created_at",
                "expires_at",
                "revoked_at",
                "state",
                "url"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "ttl_days": 7
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "created_at": "2026-10-10T19:18:06Z",
              "expires_at": "2026-10-17T19:18:06Z",
              "revoked_at": null,
              "state": "active",
              "url": "http://localhost:4002/share/qXKUlRVlSVL_Fi379UhTKauk"
            }
          }
        }
      }
    },
    {
      "id": "sharing.revoke_link",
      "method": "DELETE",
      "path": "/api/v1/markets/{code}/share-link",
      "summary": "Revoke a private market's share link.",
      "group": "sharing",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "created_at": {
                  "type": "string"
                },
                "expires_at": {
                  "type": "string"
                },
                "revoked_at": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "created_at",
                "expires_at",
                "revoked_at",
                "state",
                "url"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "created_at": "2026-10-10T19:18:06Z",
              "expires_at": "2026-10-17T19:18:06Z",
              "revoked_at": "2026-10-10T19:18:06Z",
              "state": "revoked",
              "url": "http://localhost:4002/share/qXKUlRVlSVL_Fi379UhTKauk"
            }
          }
        }
      }
    },
    {
      "id": "sharing.approve_request",
      "method": "POST",
      "path": "/api/v1/markets/{code}/access-requests/{id}/approve",
      "summary": "Approve a request to join a private market.",
      "group": "sharing",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object"
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "decided_at": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "requested_at": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "user": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "username"
                  ]
                }
              },
              "required": [
                "decided_at",
                "id",
                "requested_at",
                "status",
                "user"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "decided_at": "2026-10-10T19:18:05Z",
              "id": 102,
              "requested_at": "2026-10-10T19:18:05Z",
              "status": "approved",
              "user": {
                "id": 8070,
                "username": "yzfxbew"
              }
            }
          }
        }
      }
    },
    {
      "id": "sharing.decline_request",
      "method": "POST",
      "path": "/api/v1/markets/{code}/access-requests/{id}/decline",
      "summary": "Decline a request to join a private market.",
      "group": "sharing",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object"
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "decided_at": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "requested_at": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "user": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "username"
                  ]
                }
              },
              "required": [
                "decided_at",
                "id",
                "requested_at",
                "status",
                "user"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "decided_at": "2026-10-10T19:18:08Z",
              "id": 103,
              "requested_at": "2026-10-10T19:18:08Z",
              "status": "declined",
              "user": {
                "id": 8124,
                "username": "vanwtas"
              }
            }
          }
        }
      }
    },
    {
      "id": "sharing.remove_member",
      "method": "DELETE",
      "path": "/api/v1/markets/{code}/members/{user_id}",
      "summary": "Remove a member from a private market.",
      "group": "sharing",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "removed": {
                  "type": "boolean"
                },
                "user_id": {
                  "type": "number"
                }
              },
              "required": [
                "removed",
                "user_id"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "removed": true,
              "user_id": 8146
            }
          }
        }
      }
    },
    {
      "id": "upload.create",
      "method": "POST",
      "path": "/api/v1/uploads",
      "summary": "Upload an analysis asset (image, script or zip) for a market. Multipart.",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string"
          },
          "market_code": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "file": "(upload)"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "content_type": "text/plain",
              "filename": "fixture.txt",
              "id": "4f57f553-dd01-4ea7-ae44-857f5a7e180a",
              "state": "pending",
              "url": "http://localhost:4002/attachments/4f57f553-dd01-4ea7-ae44-857f5a7e180a"
            }
          }
        }
      }
    },
    {
      "id": "sandbox_comment_review.index",
      "method": "GET",
      "path": "/api/v1/admin/sandbox/comment-reviews",
      "summary": "Pending shared sandbox comments (contamination review queue), oldest first, with automatic flags: later_date:<text>, link_unverified:<url> (not returned by the library before the comment's sandbox day, which applies the archive's date gate and exclusion lists), library_unavailable.",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "At most 200 (default 50)."
          },
          "sandbox": {
            "type": "string",
            "description": "Only this sandbox (slug)."
          }
        }
      },
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "query": {
            "limit": 10
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "pending": [
                {
                  "id": 101,
                  "sandbox": "biology-2020",
                  "market_code": "rt123",
                  "market_title": "Paper A primary endpoint",
                  "author": "sam",
                  "sandbox_date": "2020-01-01",
                  "posted_at": "2026-10-12T15:00:00Z",
                  "text": "Effect looks real.",
                  "flags": []
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "sandbox_comment_review.approve",
      "method": "POST",
      "path": "/api/v1/admin/sandbox/comment-reviews/approve",
      "summary": "Approve pending shared sandbox comments: other players whose clock is at or past each comment's sandbox date (and who show other players' comments) then see it.",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Comment ids."
          }
        },
        "required": [
          "ids"
        ]
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "ids": [
              101
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "approved": 1
            }
          }
        }
      }
    },
    {
      "id": "sandbox_comment_review.reject",
      "method": "POST",
      "path": "/api/v1/admin/sandbox/comment-reviews/reject",
      "summary": "Reject pending shared sandbox comments with a reason the author sees.",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Comment ids."
          },
          "reason": {
            "type": "string",
            "description": "Required, at most 500 characters."
          }
        },
        "required": [
          "ids",
          "reason"
        ]
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "ids": [
              101
            ],
            "reason": "Names a result from 2021."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "rejected": 1
            }
          }
        }
      }
    },
    {
      "id": "sandbox_ante.post",
      "method": "POST",
      "path": "/api/v1/admin/sandbox/{slug}/ante-comments",
      "summary": "Post a library item as Ante's (bot) comment on a market of a past sandbox, approved and stamped at the end of the item's day; posted once per sandbox, market and doc_id.",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "market_code": {
            "type": "string"
          },
          "doc_id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "description": "YYYY, YYYY-MM or YYYY-MM-DD."
          },
          "title": {
            "type": "string"
          },
          "why": {
            "type": "string",
            "description": "One line on why it matters."
          },
          "url": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "market_code",
          "doc_id",
          "date",
          "title",
          "why"
        ]
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "market_code": "rt123",
            "doc_id": "newsrooms:7",
            "date": "2020-03-15",
            "title": "Trial enrols its last patient",
            "why": "Enrolment closing sets when the endpoint can read out."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "posted": true,
              "comment_id": 102
            }
          }
        }
      }
    },
    {
      "id": "sandbox_ante.curate",
      "method": "POST",
      "path": "/api/v1/admin/sandbox/{slug}/ante-curate",
      "summary": "Run the first (placeholder) curator over a past sandbox: for each checkpoint, the library feed since the previous one, each item posted as Ante's comment on the open question sharing the most title words (at least min_overlap).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "dry_run": {
            "type": "boolean"
          },
          "per_checkpoint": {
            "type": "integer"
          },
          "min_overlap": {
            "type": "integer"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "dry_run": true
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "posted": 0,
              "existing": 0,
              "windows": 3,
              "picks": [
                {
                  "market_code": "rt123",
                  "doc_id": "n:1",
                  "date": "2020-02-01",
                  "why": "May bear on \"Paper A primary endpoint\": it mentions endpoint, paper, primary."
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "market.create_market",
      "method": "POST",
      "path": "/api/v1/markets",
      "summary": "Create a market from CSV-style rows (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "budget": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "resolution_criteria": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "visibility": {
            "type": "string"
          },
          "x_unit": {
            "type": "string"
          }
        }
      },
      "responses": {
        "201": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "budget": "100",
            "code": "ct-made5539",
            "resolution_criteria": "Criteria",
            "status": "draft",
            "title": "Made over the API",
            "type": "date",
            "visibility": "private",
            "x_unit": "date"
          }
        },
        "response": {
          "status": 201,
          "body": {
            "data": {
              "background_info_html": null,
              "budget": 100.0,
              "code": "~6655",
              "cumulative": true,
              "end_date": null,
              "following": true,
              "id": 6655,
              "inserted_at": "2026-10-10T19:44:29Z",
              "local_code": "ct-made5539",
              "reference": "~6655",
              "resolution_criteria": "Criteria",
              "status": "draft",
              "subscribed_to_comments": true,
              "title": "Made over the API",
              "type": "date",
              "visibility": "private",
              "x_unit": "date"
            }
          }
        }
      }
    },
    {
      "id": "market.update_liquidity",
      "method": "POST",
      "path": "/api/v1/markets/{code}/liquidity",
      "summary": "Set a market's liquidity (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "mode": "multiply",
            "value": "2"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "mode": "multiply",
              "total_after": 100.0,
              "total_before": 50.0,
              "updated_submarkets": 1,
              "value": 2.0
            }
          }
        }
      }
    },
    {
      "id": "market.get_draft",
      "method": "GET",
      "path": "/api/v1/markets/{code}/staging",
      "summary": "A market's staged draft (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "draft": {
                "background_info_html": null,
                "changes": [],
                "id": 61,
                "market_id": 6654,
                "number_format": null,
                "resolution_criteria": "Revised criteria",
                "svelte_params": null,
                "target_major": 1,
                "target_minor": 0,
                "updated_at": "2026-10-10T19:44:28Z",
                "updated_by_id": 10469,
                "x_unit": null
              }
            }
          }
        }
      }
    },
    {
      "id": "market.upsert_draft",
      "method": "PUT",
      "path": "/api/v1/markets/{code}/staging",
      "summary": "Create or update a market's staged draft (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "background_info_html": {
            "type": "string"
          },
          "resolution_criteria": {
            "type": "string"
          },
          "version_bump": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "resolution_criteria": "Revised criteria"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "background_info_html": null,
              "changes": [],
              "id": 61,
              "market_id": 6654,
              "number_format": null,
              "resolution_criteria": "Revised criteria",
              "svelte_params": null,
              "target_major": 1,
              "target_minor": 0,
              "updated_at": "2026-10-10T19:44:28Z",
              "updated_by_id": 10469,
              "x_unit": null
            }
          }
        }
      }
    },
    {
      "id": "market.stage_draft_probability_update",
      "method": "POST",
      "path": "/api/v1/markets/{code}/staging/probability-update",
      "summary": "Stage starting-probability changes and new bars (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "additions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "initial_probability": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "projection_group": {
                  "type": "string"
                },
                "threshold_date": {
                  "type": "string"
                },
                "end_date": {
                  "type": "string"
                },
                "budget_allocation": {
                  "type": "string"
                },
                "threshold_decimal": {
                  "type": "string"
                }
              },
              "required": [
                "initial_probability",
                "label",
                "projection_group"
              ]
            }
          },
          "updates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "initial_probability": {
                  "type": "string"
                },
                "submarket_id": {
                  "type": "number"
                },
                "end_date": {
                  "type": "string"
                }
              },
              "required": [
                "initial_probability",
                "submarket_id"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "additions": [
              {
                "initial_probability": "0.3",
                "label": "By Feb 2029",
                "projection_group": "main",
                "threshold_date": "2029-02-28T23:59:59Z"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "background_info_html": null,
              "changes": [
                {
                  "action": "add",
                  "budget_allocation": null,
                  "end_date": "2029-02-28T23:59:59Z",
                  "existing_submarket_id": null,
                  "id": 42,
                  "initial_probability": 0.3,
                  "label": "By Feb 2029",
                  "projection_group": "main",
                  "threshold_date": "2029-02-28T23:59:59Z",
                  "threshold_decimal": null
                }
              ],
              "id": 46,
              "market_id": 5113,
              "number_format": null,
              "resolution_criteria": null,
              "svelte_params": null,
              "target_major": 1,
              "target_minor": 0,
              "updated_at": "2026-10-10T19:17:57Z",
              "updated_by_id": 7940,
              "x_unit": null
            },
            "warnings": []
          }
        }
      }
    },
    {
      "id": "market.publish_draft",
      "method": "POST",
      "path": "/api/v1/markets/{code}/staging/publish",
      "summary": "Publish a market's staged draft (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "description_change_summary": {
            "type": "string"
          },
          "external_commit_url": {
            "type": "string"
          },
          "version_bump": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "market": {
                "background_info_html": null,
                "budget": 120.0,
                "code": "de12680",
                "cumulative": true,
                "end_date": null,
                "id": 5113,
                "inserted_at": "2026-10-10T19:17:57Z",
                "local_code": "de12680",
                "reference": "de12680",
                "resolution_criteria": "Criteria",
                "status": "draft",
                "title": "Date end default market",
                "type": "date",
                "visibility": "public",
                "x_unit": "date"
              },
              "trading_status": "draft",
              "version": {
                "change_summary": null,
                "external_commit_url": null,
                "id": 764,
                "major_version": 1,
                "minor_version": 0,
                "version_kind": "published"
              },
              "version_major": 1,
              "version_minor": 0
            }
          }
        }
      }
    },
    {
      "id": "market.discard_draft",
      "method": "POST",
      "path": "/api/v1/markets/{code}/staging/discard",
      "summary": "Discard a market's staged draft (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object"
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "status": "ok"
            }
          }
        }
      }
    },
    {
      "id": "market.preview_liquidity_adjustment",
      "method": "POST",
      "path": "/api/v1/markets/{code}/liquidity-adjustments/preview",
      "summary": "Preview a liquidity adjustment (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reduction_pct": {
            "type": "string"
          },
          "scheduled_for": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "categories": [
              "g01"
            ],
            "reduction_pct": "50",
            "scheduled_for": "2026-10-10T19:16:25Z"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "actual_pct": 24.9999,
              "after_max_points": 51.911,
              "before_max_points": 69.2146,
              "categories": [
                "g01"
              ],
              "multiplier": 0.5,
              "per_category": [
                {
                  "affected": true,
                  "after_max_points": 17.3037,
                  "before_max_points": 34.6073,
                  "category": "g01"
                },
                {
                  "affected": false,
                  "after_max_points": 34.6073,
                  "before_max_points": 34.6073,
                  "category": "g02"
                }
              ],
              "per_submarket": [
                {
                  "affected": true,
                  "after_max_points": 17.3037,
                  "before_max_points": 34.6073,
                  "label": "g01 at least 10",
                  "multiplier": 0.5,
                  "projection_group": "g01",
                  "submarket_id": 35269
                },
                {
                  "affected": false,
                  "after_max_points": 34.6073,
                  "before_max_points": 34.6073,
                  "label": "g02 at least 10",
                  "multiplier": 1.0,
                  "projection_group": "g02",
                  "submarket_id": 35270
                }
              ],
              "reduction_pct": 50.0,
              "scheduled_for": "2026-10-10T19:16:25Z",
              "warnings": [
                "scheduled_for is in the past; apply-now may be more appropriate"
              ]
            }
          }
        }
      }
    },
    {
      "id": "market.schedule_liquidity_adjustment",
      "method": "POST",
      "path": "/api/v1/markets/{code}/liquidity-adjustments/schedule",
      "summary": "Schedule a liquidity adjustment (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "reduction_pct": {
            "type": "string"
          },
          "scheduled_for": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "reduction_pct": "10",
            "scheduled_for": "2026-10-11T19:44:28Z",
            "type": "proactive"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "adjustment": {
                "applied_at": null,
                "categories": null,
                "created_by_id": 10469,
                "description": "Scheduled liquidity reduction of 10% max points",
                "id": 227,
                "inserted_at": "2026-10-10T19:44:28Z",
                "kind": "max_points_reduction",
                "market_id": 6654,
                "multiplier": 0.9,
                "notes": null,
                "reduction_pct": 10.0,
                "scheduled_for": "2026-10-11T19:44:28Z",
                "status": "scheduled",
                "type": "proactive"
              },
              "preview": {
                "actual_pct": 10.0,
                "after_max_points": 95.0606,
                "before_max_points": 105.6229,
                "categories": null,
                "multiplier": 0.9,
                "per_category": [
                  {
                    "affected": true,
                    "after_max_points": 95.0606,
                    "before_max_points": 105.6229,
                    "category": "2026"
                  }
                ],
                "per_submarket": [
                  {
                    "affected": true,
                    "after_max_points": 41.0752,
                    "before_max_points": 45.6391,
                    "label": "At least 100",
                    "multiplier": 0.9,
                    "projection_group": "2026",
                    "submarket_id": 48368
                  },
                  {
                    "affected": true,
                    "after_max_points": 53.9854,
                    "before_max_points": 59.9838,
                    "label": "At least 200",
                    "multiplier": 0.9,
                    "projection_group": "2026",
                    "submarket_id": 48369
                  }
                ],
                "reduction_pct": 10.0,
                "scheduled_for": "2026-10-11T19:44:28Z",
                "warnings": []
              }
            }
          }
        }
      }
    },
    {
      "id": "market.list_liquidity_adjustments",
      "method": "GET",
      "path": "/api/v1/markets/{code}/liquidity-adjustments",
      "summary": "A market's liquidity adjustments (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": [
              {
                "applied_at": "2026-10-10T19:17:26Z",
                "categories": [
                  "g01"
                ],
                "created_by_id": 7517,
                "description": "Retroactive liquidity reduction of 50% max points in category g01",
                "id": 155,
                "inserted_at": "2026-10-10T19:17:26Z",
                "kind": "max_points_reduction",
                "market_id": 4916,
                "multiplier": 0.5,
                "notes": null,
                "reduction_pct": 50.0,
                "scheduled_for": "2026-10-10T19:16:25Z",
                "status": "applied",
                "type": "retroactive"
              }
            ]
          }
        }
      }
    },
    {
      "id": "market.cancel_liquidity_adjustment",
      "method": "POST",
      "path": "/api/v1/markets/{code}/liquidity-adjustments/{id}/cancel",
      "summary": "Cancel a scheduled liquidity adjustment (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object"
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "applied_at": null,
              "categories": null,
              "created_by_id": 10469,
              "description": "Scheduled liquidity reduction of 10% max points",
              "id": 227,
              "inserted_at": "2026-10-10T19:44:28Z",
              "kind": "max_points_reduction",
              "market_id": 6654,
              "multiplier": 0.9,
              "notes": null,
              "reduction_pct": 10.0,
              "scheduled_for": "2026-10-11T19:44:28Z",
              "status": "cancelled",
              "type": "proactive"
            }
          }
        }
      }
    },
    {
      "id": "market.apply_liquidity_adjustment_now",
      "method": "POST",
      "path": "/api/v1/markets/{code}/liquidity-adjustments/{id}/apply-now",
      "summary": "Apply a scheduled liquidity adjustment now (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object"
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "applied_at": "2026-10-10T19:44:29Z",
              "categories": null,
              "created_by_id": 10469,
              "description": "Scheduled liquidity reduction of 10% max points",
              "id": 228,
              "inserted_at": "2026-10-10T19:44:29Z",
              "kind": "max_points_reduction",
              "market_id": 6654,
              "multiplier": 0.9,
              "notes": null,
              "reduction_pct": 10.0,
              "scheduled_for": "2026-10-11T19:44:28Z",
              "status": "applied",
              "type": "proactive"
            }
          }
        }
      }
    },
    {
      "id": "market.historical_resolutions",
      "method": "POST",
      "path": "/api/v1/markets/{code}/historical-resolutions",
      "summary": "Record historical resolutions for a market's bars (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "projection_group": {
                  "type": "string"
                },
                "resolved_value": {
                  "type": "string"
                },
                "resolved_at": {
                  "type": "string"
                }
              },
              "required": [
                "projection_group",
                "resolved_value"
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "entries": [
              {
                "projection_group": "2019",
                "resolved_value": "100"
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "entries": [
                {
                  "action": "updated_resolution",
                  "created_submarket_ids": [],
                  "existing_submarket_ids": [
                    37690
                  ],
                  "index": 0,
                  "projection_group": "2019",
                  "resolved_submarket_ids": [
                    37690
                  ]
                }
              ]
            }
          }
        }
      }
    },
    {
      "id": "market.activate_conditional_date",
      "method": "POST",
      "path": "/api/v1/markets/{code}/activate-conditional-date",
      "summary": "Activate a conditional date market (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "deployed_at_utc": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "deployed_at_utc": "2026-05-01T00:00:00Z"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "background_info_html": null,
              "budget": 1000.0,
              "code": "cda20547",
              "cumulative": true,
              "end_date": "2026-08-13T00:00:00Z",
              "id": 5322,
              "inserted_at": "2026-10-10T19:18:15Z",
              "local_code": "cda20547",
              "reference": "cda20547",
              "resolution_criteria": "Conditional criteria",
              "status": "open",
              "title": "Activated title",
              "type": "date",
              "visibility": "public",
              "x_unit": "date"
            }
          }
        }
      }
    },
    {
      "id": "market.activate_conditional_multicount",
      "method": "POST",
      "path": "/api/v1/markets/{code}/activate-conditional-multicount",
      "summary": "Activate a condition of a conditional count market (admin).",
      "group": "admin",
      "auth": "admin",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "condition_key": {
            "type": "string"
          }
        }
      },
      "responses": {
        "200": {
          "$ref": "#/$defs/envelope"
        }
      },
      "example": {
        "request": {
          "body": {
            "condition_key": "scenario-a"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "background_info_html": null,
              "budget": 1000.0,
              "code": "mca17799",
              "cumulative": true,
              "end_date": "2027-10-10T19:18:01Z",
              "id": 5139,
              "inserted_at": "2026-10-10T19:18:01Z",
              "local_code": "mca17799",
              "reference": "mca17799",
              "resolution_criteria": "Conditional criteria",
              "status": "open",
              "title": "Activated multicount title",
              "type": "count",
              "visibility": "public",
              "x_unit": "units"
            }
          }
        }
      }
    },
    {
      "id": "market.update_status",
      "method": "PUT",
      "path": "/api/v1/markets/{code}/status",
      "summary": "Resolve, close, reopen or open a market or some of its bars (owner of a private market, or admin).",
      "group": "your markets",
      "description": "`status` is `resolved`, `closed` or `open` (only admins and owners of private markets close or reopen). Resolve a when-market with `event_occurred` and `resolved_at`, a how-much period with `projection_group` and `resolved_value`, or named bars with `submarket_ids`/`submarket_outcomes`. Trades made once the outcome was known (`known_at`) are voided.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "strict",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "known_at": {
            "type": "string"
          },
          "resolved_value": {
            "type": [
              "string",
              "number"
            ]
          },
          "submarket_ids": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "submarket_outcomes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resolved_yes": {
                  "type": "boolean"
                },
                "submarket_id": {
                  "type": "number"
                },
                "reopen": {
                  "type": "boolean"
                }
              },
              "required": [
                "submarket_id"
              ]
            }
          },
          "count_auto_update": {
            "type": "boolean"
          },
          "resolved_at": {
            "type": "string"
          },
          "projection_group": {
            "type": "string"
          },
          "event_occurred": {
            "type": "boolean"
          }
        }
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "background_info_html": {
                  "type": "null"
                },
                "budget": {
                  "type": "number"
                },
                "code": {
                  "type": "string"
                },
                "cumulative": {
                  "type": "boolean"
                },
                "end_date": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": "number"
                },
                "inserted_at": {
                  "type": "string"
                },
                "local_code": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "resolution_criteria": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "visibility": {
                  "type": "string"
                },
                "x_unit": {
                  "type": "string"
                }
              },
              "required": [
                "background_info_html",
                "budget",
                "code",
                "cumulative",
                "end_date",
                "id",
                "inserted_at",
                "local_code",
                "reference",
                "resolution_criteria",
                "status",
                "title",
                "type",
                "visibility",
                "x_unit"
              ]
            },
            "resolution": {
              "type": "object",
              "properties": {
                "affected_users": {
                  "type": "number"
                },
                "known_at": {
                  "type": "string"
                },
                "money_unreversed": {
                  "type": "number"
                },
                "restored_trades": {
                  "type": "number"
                },
                "voided_trades": {
                  "type": "number"
                }
              },
              "required": [
                "affected_users",
                "known_at",
                "money_unreversed",
                "restored_trades",
                "voided_trades"
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "status": "open"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "background_info_html": null,
              "budget": 120.5,
              "code": "~5145",
              "cumulative": true,
              "end_date": null,
              "id": 5145,
              "inserted_at": "2026-10-10T19:18:02Z",
              "local_code": "t17252",
              "reference": "~5145",
              "resolution_criteria": "some resolution_criteria",
              "status": "open",
              "title": "some title",
              "type": "count",
              "visibility": "private",
              "x_unit": "some x_unit"
            }
          }
        }
      }
    },
    {
      "id": "contract.show",
      "method": "GET",
      "path": "/api/v1/contract.json",
      "summary": "This contract: every /api/v1 route with its auth, request and response schemas and an example.",
      "group": "meta",
      "description": "Public and secret-free. Served with an ETag; send `If-None-Match` for a 304.",
      "auth": "none",
      "headers": [],
      "rate_limit": "read",
      "schema_status": "strict",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "$ref": "#/$defs/contract"
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "contract_version": "1",
            "routes": []
          }
        }
      }
    },
    {
      "id": "sandbox.planner_job",
      "method": "GET",
      "path": "/api/v1/sandbox/planner_jobs/{job_id}",
      "summary": "A client planner's job: the brief.",
      "group": "sandboxes",
      "description": "The planner job of a client-planned turn: the versioned job (`contract`), instructions, the events it may declare, the plan's schema, info questions, the planner notes and any revealed draws. The job id is the token take_turn returned with `status: \"planner_job\"` for a run with `planner: \"client\"`; only the run's owner can use it. Errors: 404 (no such job), 409 `job_drawn` / `job_submitted` / `job_closed`, 410 `job_expired` (take the turn again with the same turn_id). A wrap-up job (`kind: wrapup`, from POST /api/v1/sandbox/runs/{id}/wrapup) has `facts` and `instructions` instead of a turn: nothing to draw or plan. A questions job (`kind: questions`, from take_turn's `questions_needed` before the first turn) has `scenario`, `question_set` (`tracked`, `opening`, `aim`) and `instructions`: the planner makes the run's questions with POST /api/v1/sandbox/runs/{id}/questions.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "contract": "antistatic.planner-job/1",
              "job_id": "pj_x",
              "status": "open",
              "job": {},
              "events": [],
              "plan_schema": {},
              "planner_notes": null
            }
          }
        }
      }
    },
    {
      "id": "sandbox.planner_draw",
      "method": "POST",
      "path": "/api/v1/sandbox/planner_jobs/{job_id}/draws",
      "summary": "Declare a turn's uncertain events and reveal their draws.",
      "group": "sandboxes",
      "description": "Declares every uncertain event of the turn (`events`: `{tool, input}`, tool draw, sample, curveball, adjust, settle_item, create_question, add_item, extend_question or ask_player, each with p and basis as its schema says). The server draws them all with the turn's seed, rolls the run questions and returns the results. A malformed batch returns 422 invalid_params with validation errors, reveals no draws or question rolls and leaves the job open for correction. An exact retry of an accepted batch returns its stored reveal; a changed batch cannot reroll. The job id is the token take_turn returned with `status: \"planner_job\"` for a run with `planner: \"client\"`; only the run's owner can use it. Errors: 404 (no such job), 409 `job_drawn` / `job_submitted` / `job_closed`, 410 `job_expired` (take the turn again with the same turn_id).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "events"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "events": [
              {
                "tool": "draw",
                "input": {
                  "label": "The grant officer replies",
                  "p": 0.4,
                  "basis": "Replies within a month: 4 of 10 past emails",
                  "visible": true
                }
              }
            ]
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "results": [
                {
                  "tool": "draw",
                  "result": {
                    "n": 1,
                    "label": "The grant officer replies",
                    "result": "no"
                  },
                  "error": false
                }
              ],
              "question_rolls": []
            }
          }
        }
      }
    },
    {
      "id": "sandbox.submit_plan",
      "method": "POST",
      "path": "/api/v1/sandbox/planner_jobs/{job_id}/plan",
      "summary": "Commit a client planner's plan.",
      "group": "sandboxes",
      "description": "The plan (`plan`: branches with weights, observations, action outcomes and sealed updates, consistent with the revealed draws; optional info_answers and questions_for_player; in a game with other players, an observation's optional `audience`: the character keys who alone see it; an observation's optional `as_of`, the date its contents are measured at, on or before its visible_at). Validated like the server planner's; an observation dated outside the turn's window, with as_of after visible_at, or whose text names a later date than its visible_at returns 422 `invalid_plan` with `problems` (`field`, `value`, `problem`) and leaves the job open for correction; the server samples the branch from the seed, builds the script in code, moves the clock and returns the turn's result. Once per job. The job id is the token take_turn returned with `status: \"planner_job\"` for a run with `planner: \"client\"`; only the run's owner can use it. Errors: 404 (no such job), 409 `job_drawn` / `job_submitted` / `job_closed`, 410 `job_expired` (take the turn again with the same turn_id).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "object"
          }
        },
        "required": [
          "plan"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "plan": {
              "branches": [],
              "evidence": [],
              "assumptions": []
            }
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "run_id": 712,
              "mode": "client",
              "script": "…",
              "replayed": false
            }
          }
        }
      }
    },
    {
      "id": "sandbox.submit_script",
      "method": "POST",
      "path": "/api/v1/sandbox/planner_jobs/{job_id}/script",
      "summary": "Replace a client-planned turn's story with the client's prose.",
      "group": "sandboxes",
      "description": "The client's prose for the committed turn (`script`): it replaces the code-built story; the header, Results, Markets and Questions stay the server's. Days outside the turn are refused. The job id is the token take_turn returned with `status: \"planner_job\"` for a run with `planner: \"client\"`; only the run's owner can use it. Errors: 404 (no such job), 409 `job_drawn` / `job_submitted` / `job_closed`, 410 `job_expired` (take the turn again with the same turn_id). For a wrap-up job, `script` is the wrap-up's arc (once); the response has `wrapup`.",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "script": {
            "type": "string"
          }
        },
        "required": [
          "script"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "script": "On Tuesday you send the email."
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "script": "**2026-10-12 to 2026-10-18 · T+6 days**\n\nOn Tuesday you send the email.\n\n…"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.planner_notes",
      "method": "GET",
      "path": "/api/v1/sandbox/planner_jobs/{job_id}/notes",
      "summary": "Read a client planner's sealed notes.",
      "group": "sandboxes",
      "description": "The run's planner notes, a sealed scratchpad carried across turns; readable with a job of the run that is open or done within the day. The job id is the token take_turn returned with `status: \"planner_job\"` for a run with `planner: \"client\"`; only the run's owner can use it. Errors: 404 (no such job), 409 `job_drawn` / `job_submitted` / `job_closed`, 410 `job_expired` (take the turn again with the same turn_id).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": null,
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {},
        "response": {
          "status": 200,
          "body": {
            "data": {
              "notes": "Commitments: …"
            }
          }
        }
      }
    },
    {
      "id": "sandbox.put_planner_notes",
      "method": "PUT",
      "path": "/api/v1/sandbox/planner_jobs/{job_id}/notes",
      "summary": "Replace a client planner's sealed notes.",
      "group": "sandboxes",
      "description": "Replaces the run's planner notes (`notes`, at most 20,000 characters). The job id is the token take_turn returned with `status: \"planner_job\"` for a run with `planner: \"client\"`; only the run's owner can use it. Errors: 404 (no such job), 409 `job_drawn` / `job_submitted` / `job_closed`, 410 `job_expired` (take the turn again with the same turn_id).",
      "auth": "write",
      "headers": [],
      "rate_limit": "write",
      "schema_status": "envelope",
      "query": null,
      "body": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "notes"
        ]
      },
      "responses": {
        "200": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object"
            }
          },
          "required": [
            "data"
          ]
        }
      },
      "example": {
        "request": {
          "body": {
            "notes": "Commitments: …"
          }
        },
        "response": {
          "status": 200,
          "body": {
            "data": {
              "notes": "Commitments: …"
            }
          }
        }
      }
    }
  ]
}
