{"openapi":"3.1.0","info":{"title":"acceptodds API","version":"1.0.0","description":"A prediction-market venue priced by LMSR, trading a non-convertible play currency called reputation. Amounts are integer micro-units (1 unit = 1,000,000) sent as decimal strings. Errors are always `{ \"error\": { \"code\", \"message\", \"details\"? } }` with a stable `code`."},"servers":[{"url":"/api/v1"}],"tags":[{"name":"markets","description":"Public market data."},{"name":"listings","description":"Opaque subjects that group markets."},{"name":"trading","description":"Quotes and orders."},{"name":"accounts","description":"Public profiles and the leaderboard."},{"name":"groups","description":"Reading groups: shared reading lists and traders ranked among themselves, joined by invite code."},{"name":"me","description":"The authenticated account."},{"name":"onboarding","description":"Signing up: plainly, or by choosing a first bet."},{"name":"admin","description":"Requires the `admin` scope."}],"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"A signed-in browser session (sign up and sign in at /api/auth, with an email address at an approved institution). Equivalent to the `read` and `trade` scopes, plus `admin` if your email is in the server’s `ADMIN_EMAILS`. Writes must come from our own Origin."},"bearer":{"type":"http","scheme":"bearer","description":"An API token, `pm_live_…`. Scopes: `read` (me endpoints), `trade` (placing orders), `admin` (creating, closing and settling markets). No scope implies another. Every request made with a token counts against that token’s rate-limit bucket."}},"schemas":{"MarketList":{"type":"object","properties":{"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"nextCursor":{"type":["string","null"],"description":"Opaque. Pass as `cursor` to get the next page; `null` on the last page."}},"required":["markets","nextCursor"]},"Market":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"question":{"type":"string"},"description":{"type":["string","null"]},"contract":{"type":["string","null"],"description":"How the market resolves, in detail. Markdown, supplied by the creating client."},"kind":{"type":"string","description":"Opaque to the venue; whatever the creating client groups by."},"status":{"type":"string","enum":["draft","open","closed","settled","void"]},"b":{"type":"number","exclusiveMinimum":0,"description":"LMSR liquidity parameter, in micro-units. Computed once at creation and frozen: it never changes."},"outcomes":{"type":"array","items":{"$ref":"#/components/schemas/Outcome"}},"volumeMicro":{"type":"string","pattern":"^-?\\d+$","description":"Sum of |cost| over every fill.","example":"1500000"},"orderCount":{"type":"integer"},"opensAt":{"type":["string","null"],"format":"date-time"},"closesAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"resolutionSource":{"type":["string","null"]},"resolvedOutcomeId":{"type":["string","null"],"format":"uuid"},"resolutionEvidenceUrl":{"type":["string","null"]},"settledAt":{"type":["string","null"],"format":"date-time"},"listingId":{"type":["string","null"],"format":"uuid","description":"The listing this market belongs to, if any."},"listingRank":{"type":"integer","description":"Order within its listing. The lowest (0) is the listing’s main market."}},"required":["id","slug","question","description","contract","kind","status","b","outcomes","volumeMicro","orderCount","opensAt","closesAt","createdAt","resolutionSource","resolvedOutcomeId","resolutionEvidenceUrl","settledAt","listingId","listingRank"]},"Outcome":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"},"ordinal":{"type":"integer"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Outstanding shares of this outcome (the `q_i` of the cost function).","example":"1500000"},"price":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."}},"required":["id","label","ordinal","sharesMicro","price"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found","market_not_open","market_closed","market_already_settled","invalid_size","insufficient_balance","insufficient_shares","slippage_exceeded","house_underfunded","invalid_market","validation_error","unauthorized","forbidden","session_required","rate_limited","slug_taken","idempotency_key_reused","not_verified","insufficient_stake","own_comment","email_domain_not_allowed","already_affiliated","too_many_pending","invalid_code","affiliation_taken","primary_affiliation","password_already_set","too_many_groups","group_admin","method_not_allowed","internal_error"],"description":"Stable and machine-readable. Branch on this, not on `message`."},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message"]}},"required":["error"]},"PriceHistory":{"type":"object","properties":{"marketId":{"type":"string","format":"uuid"},"outcomes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"},"ordinal":{"type":"integer"}},"required":["id","label","ordinal"]}},"points":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"prices":{"type":"array","items":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"description":"Every outcome’s price, indexed by `ordinal`."}},"required":["at","prices"]},"description":"Oldest first. One point per fill, plus the opening point on the first page. Reconstructed from the fills, not sampled."},"nextCursor":{"type":["string","null"],"description":"Opaque. Pass as `cursor` to get the next page; `null` on the last page."}},"required":["marketId","outcomes","points","nextCursor"]},"Tape":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/TapeEntry"},"description":"Newest first."},"nextCursor":{"type":["string","null"],"description":"Opaque. Pass as `cursor` to get the next page; `null` on the last page."}},"required":["orders","nextCursor"]},"TapeEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"outcomeId":{"type":"string","format":"uuid"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Signed: negative is a sell.","example":"1500000"},"costMicro":{"type":"string","pattern":"^-?\\d+$","description":"Signed: negative is proceeds paid to the seller.","example":"1500000"},"priceBefore":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"priceAfter":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","outcomeId","sharesMicro","costMicro","priceBefore","priceAfter","createdAt"],"description":"A fill, without the identity of who made it."},"Quote":{"type":"object","properties":{"marketId":{"type":"string","format":"uuid"},"outcomeId":{"type":"string","format":"uuid"},"outcomeLabel":{"type":"string"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"costMicro":{"type":"string","pattern":"^-?\\d+$","description":"Priced for the whole size, slippage included — not shares × price. Positive is paid; negative is received. Advisory: a trade re-prices.","example":"1500000"},"priceBefore":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"priceAfter":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."}},"required":["marketId","outcomeId","outcomeLabel","sharesMicro","costMicro","priceBefore","priceAfter"]},"QuoteRequest":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid"},"sharesMicro":{"anyOf":[{"type":"string","pattern":"^-?\\d{1,19}$"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"Shares to trade, in micro-shares. Negative to sell. Must not be zero.","example":"10000000"}},"required":["outcomeId","sharesMicro"]},"ListingList":{"type":"object","properties":{"listings":{"type":"array","items":{"$ref":"#/components/schemas/Listing"}},"nextCursor":{"type":["string","null"],"description":"Opaque. Pass as `cursor` to get the next page; `null` on the last page."}},"required":["listings","nextCursor"]},"Listing":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"summary":{"type":["string","null"]},"tldr":{"type":["string","null"],"description":"A one-line summary."},"authors":{"type":"array","items":{"type":"string"}},"authorIds":{"type":"array","items":{"type":"string"},"description":"One opaque id per name in `authors`, in the same order, or empty. Never resolved by the venue."},"keywords":{"type":"array","items":{"type":"string"}},"primaryArea":{"type":["string","null"],"description":"Opaque."},"links":{"type":"array","items":{"$ref":"#/components/schemas/ListingLink"}},"kind":{"type":["string","null"],"description":"Opaque to the venue; whatever the creating client groups by."},"createdAt":{"type":"string","format":"date-time"},"followers":{"type":"integer","minimum":0,"description":"How many accounts follow this listing. Never who."},"views":{"type":"integer","minimum":0,"description":"Unique viewers per day, summed over every day so far."},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"},"description":"Its markets, drafts excluded, by `listingRank` ascending: the first is the main market."}},"required":["id","slug","title","summary","tldr","authors","authorIds","keywords","primaryArea","links","kind","createdAt","followers","views","markets"],"description":"An opaque subject that markets are grouped under, supplied whole by the creating client. The venue never fetches or interprets any of it."},"ListingLink":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["label","url"]},"ListingCitations":{"type":"object","properties":{"references":{"type":"array","items":{"$ref":"#/components/schemas/ListingReference"},"description":"The listing’s bibliography, in its own order."},"citedBy":{"type":"array","items":{"$ref":"#/components/schemas/CitedListing"},"description":"Listings whose bibliography names this one, newest first, at most 100."},"citedByTotal":{"type":"integer","minimum":0}},"required":["references","citedBy","citedByTotal"],"description":"Supplied by the creating client with the listing; the venue extracts nothing. A listing citing itself is left out."},"ListingReference":{"type":"object","properties":{"title":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"year":{"type":["integer","null"]},"venue":{"type":["string","null"]},"url":{"type":["string","null"]},"slug":{"type":["string","null"],"description":"The cited work’s listing slug, as the creating client gave it."},"listing":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"kind":{"type":["string","null"]},"market":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"question":{"type":"string"},"description":{"type":["string","null"]},"contract":{"type":["string","null"],"description":"How the market resolves, in detail. Markdown, supplied by the creating client."},"kind":{"type":"string","description":"Opaque to the venue; whatever the creating client groups by."},"status":{"type":"string","enum":["draft","open","closed","settled","void"]},"b":{"type":"number","exclusiveMinimum":0,"description":"LMSR liquidity parameter, in micro-units. Computed once at creation and frozen: it never changes."},"outcomes":{"type":"array","items":{"$ref":"#/components/schemas/Outcome"}},"volumeMicro":{"type":"string","pattern":"^-?\\d+$","description":"Sum of |cost| over every fill.","example":"1500000"},"orderCount":{"type":"integer"},"opensAt":{"type":["string","null"],"format":"date-time"},"closesAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"resolutionSource":{"type":["string","null"]},"resolvedOutcomeId":{"type":["string","null"],"format":"uuid"},"resolutionEvidenceUrl":{"type":["string","null"]},"settledAt":{"type":["string","null"],"format":"date-time"},"listingId":{"type":["string","null"],"format":"uuid","description":"The listing this market belongs to, if any."},"listingRank":{"type":"integer","description":"Order within its listing. The lowest (0) is the listing’s main market."}},"required":["id","slug","question","description","contract","kind","status","b","outcomes","volumeMicro","orderCount","opensAt","closesAt","createdAt","resolutionSource","resolvedOutcomeId","resolutionEvidenceUrl","settledAt","listingId","listingRank"],"description":"Its main market; `null` when it has no visible one."}},"required":["id","slug","title","authors","kind","market"],"description":"The listing that `slug` names, when there is one here now. Matched on every read."}},"required":["title","authors","year","venue","url","slug","listing"]},"CitedListing":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"kind":{"type":["string","null"]},"market":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"question":{"type":"string"},"description":{"type":["string","null"]},"contract":{"type":["string","null"],"description":"How the market resolves, in detail. Markdown, supplied by the creating client."},"kind":{"type":"string","description":"Opaque to the venue; whatever the creating client groups by."},"status":{"type":"string","enum":["draft","open","closed","settled","void"]},"b":{"type":"number","exclusiveMinimum":0,"description":"LMSR liquidity parameter, in micro-units. Computed once at creation and frozen: it never changes."},"outcomes":{"type":"array","items":{"$ref":"#/components/schemas/Outcome"}},"volumeMicro":{"type":"string","pattern":"^-?\\d+$","description":"Sum of |cost| over every fill.","example":"1500000"},"orderCount":{"type":"integer"},"opensAt":{"type":["string","null"],"format":"date-time"},"closesAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"resolutionSource":{"type":["string","null"]},"resolvedOutcomeId":{"type":["string","null"],"format":"uuid"},"resolutionEvidenceUrl":{"type":["string","null"]},"settledAt":{"type":["string","null"],"format":"date-time"},"listingId":{"type":["string","null"],"format":"uuid","description":"The listing this market belongs to, if any."},"listingRank":{"type":"integer","description":"Order within its listing. The lowest (0) is the listing’s main market."}},"required":["id","slug","question","description","contract","kind","status","b","outcomes","volumeMicro","orderCount","opensAt","closesAt","createdAt","resolutionSource","resolvedOutcomeId","resolutionEvidenceUrl","settledAt","listingId","listingRank"],"description":"Its main market; `null` when it has no visible one."}},"required":["id","slug","title","authors","kind","market"]},"ListingRelated":{"type":"object","properties":{"related":{"type":"array","items":{"$ref":"#/components/schemas/CitedListing"},"description":"Best match first. Entries with no listing here are left out."}},"required":["related"],"description":"Listings a separate similarity service named as related. The venue computes no similarity."},"Minimap":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/MapPoint"},"description":"The listing, the papers nearest it and its related papers."},"vectors":{"type":["array","null"],"items":{"type":"array","items":{"type":"number"}},"description":"The supplied vector of each point, in `points`’ order; `null` unless every point has one."},"self":{"type":"integer","minimum":0,"description":"Index of the listing itself in `points`."},"related":{"type":"array","items":{"type":"integer","minimum":0},"description":"Indexes of its related papers, best first."},"relatedElsewhere":{"type":"integer","minimum":0,"description":"Related papers that are listed but not on the map."},"edges":{"type":"array","items":{"type":"array","prefixItems":[{"type":"integer","minimum":0},{"type":"integer","minimum":0}]},"description":"Every related pair between `points`, as indexes."},"clusters":{"type":"array","items":{"$ref":"#/components/schemas/MapTopic"},"description":"Names of the fine groupings among `points`."}},"required":["points","vectors","self","related","relatedElsewhere","edges","clusters"],"description":"A listing’s piece of the paper map, with what a client needs to lay it out again round the listing. All supplied by other services."},"MapPoint":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"primaryArea":{"type":["string","null"]},"x":{"type":"number"},"y":{"type":"number"},"region":{"type":["integer","null"]},"cluster":{"type":["integer","null"]},"headline":{"type":["number","null"],"description":"The main market’s headline price (accepted in any form, for a paper); 1/0 once settled; `null` when void or there is no market. A price, never a value."}},"required":["slug","title","primaryArea","x","y","region","cluster","headline"]},"MapTopic":{"type":"object","properties":{"number":{"type":"integer"},"label":{"type":"string"}},"required":["number","label"]},"SetRelatedResult":{"type":"object","properties":{"listingId":{"type":"string","format":"uuid"},"count":{"type":"integer","minimum":0}},"required":["listingId","count"]},"SetRelatedRequest":{"type":"object","properties":{"related":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$"},"score":{"type":"number","description":"The service’s own similarity. Not interpreted."}},"required":["slug","score"]},"maxItems":200,"description":"Best match first. Replaced whole; empty clears it."}},"required":["related"]},"PaperMap":{"type":"object","properties":{"slugs":{"type":"array","items":{"type":"string"},"description":"Every listing on the map, by slug, sorted. Index `i` of every other column is this listing."},"x":{"type":"array","items":{"type":"number"},"description":"Horizontal coordinate, in the layout’s own units."},"y":{"type":"array","items":{"type":"number"},"description":"Vertical coordinate, in the layout’s own units."},"region":{"type":"array","items":{"type":["integer","null"]},"description":"Coarse grouping (`regions`)."},"cluster":{"type":"array","items":{"type":["integer","null"]},"description":"Fine grouping (`clusters`)."},"area":{"type":"array","items":{"type":["integer","null"],"minimum":0},"description":"Index into `areas` of the listing’s primary area."},"areas":{"type":"array","items":{"type":"string"},"description":"The distinct primary areas, sorted."},"headline":{"type":"array","items":{"type":["number","null"]},"description":"The main market’s headline price (accepted in any form, for a paper); 1/0 once settled; `null` when void or there is no market. A price, never a value."},"regions":{"type":"array","items":{"$ref":"#/components/schemas/MapTopic"},"description":"Names of the coarse groupings."},"clusters":{"type":"array","items":{"$ref":"#/components/schemas/MapTopic"},"description":"Names of the fine groupings."}},"required":["slugs","x","y","region","cluster","area","areas","headline","regions","clusters"],"description":"A 2D layout of the listings, supplied by a separate service, by column, without titles (`GET /map/titles`). Coordinates are in its own units; the venue computes no layout."},"MapTitles":{"type":"object","properties":{"titles":{"type":"object","additionalProperties":{"type":"string"},"description":"Each listing’s title, by slug."}},"required":["titles"],"description":"The title of every listing on the paper map."},"MapSearch":{"type":"object","properties":{"slugs":{"type":"array","items":{"type":"string"},"description":"Every matching listing’s slug, most relevant first."},"errors":{"type":"array","items":{"type":"string"},"description":"Terms the parser could not use and left out."}},"required":["slugs","errors"],"description":"The home page’s search syntax (words, `key:value` filters, `OR`, groups, `-` negation) over every listing, for the map to highlight. Every status unless the query names one."},"MapRelated":{"type":"object","properties":{"slugs":{"type":"array","items":{"type":"string"},"description":"The listings the edges name, each once."},"edges":{"type":"array","items":{"type":"integer","minimum":0},"description":"Flattened pairs `[from, to, from, to, …]` of indexes into `slugs`: each listing’s best related entries, directional, in the supplier’s order."}},"required":["slugs","edges"],"description":"The related lists between papers on the map, compactly, for a client that re-lays out a subset. Supplied by the similarity service; the venue computes none."},"Transitions":{"type":"object","properties":{"transitions":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"Slug of the listing read first."},"to":{"type":"string","description":"Slug of the listing read next."},"count":{"type":"integer","minimum":1,"description":"Unique visitors per day who did, summed."}},"required":["from","to","count"]}}},"required":["transitions"],"description":"How many visitors read one listing and then another, per ordered pair, most first. Totals only: no visitor, time or sequence is kept. For a similarity service; the venue interprets none of it."},"SetMapResult":{"type":"object","properties":{"count":{"type":"integer","minimum":0}},"required":["count"]},"SetMapRequest":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$"},"x":{"type":"number"},"y":{"type":"number"},"region":{"type":["integer","null"],"minimum":0},"cluster":{"type":["integer","null"],"minimum":0},"vector":{"type":["array","null"],"items":{"type":"number"},"minItems":2,"maxItems":256,"description":"The paper’s embedding, compressed to a few dozen dimensions (int8-range integers keep pages small). Any scale: only cosine distances are read, to lay out a paper’s neighbourhood."}},"required":["slug","x","y"]},"maxItems":200000,"description":"One per listing; a repeated slug keeps its first point. Replaced whole; empty clears it."},"regions":{"type":"array","items":{"type":"object","properties":{"number":{"type":"integer","minimum":0},"label":{"type":"string","minLength":1,"maxLength":200}},"required":["number","label"]},"maxItems":1000,"default":[],"description":"Names of the coarse groupings."},"clusters":{"type":"array","items":{"type":"object","properties":{"number":{"type":"integer","minimum":0},"label":{"type":"string","minLength":1,"maxLength":200}},"required":["number","label"]},"maxItems":10000,"default":[],"description":"Names of the fine groupings."}},"required":["points"]},"Leaderboard":{"type":"object","properties":{"basis":{"type":"string","enum":["settled_pnl","net_worth"],"description":"`settled_pnl` (the default): P&L over settled markets only; accounts with no settled market are not listed. `net_worth`: every trader, by liquidation value — cash plus what selling every open holding now would actually pay. That cannot be inflated by the trader’s own price impact, because the exit quote walks back down the curve the buy walked up. Mark-based (mid-market) net worth can be, and is never a ranking basis."},"fieldSize":{"type":"integer","minimum":0,"description":"Traders on this board, after `institution` and `group`, before `q`: what a rank is out of."},"entries":{"type":"array","items":{"$ref":"#/components/schemas/LeaderboardEntry"}},"nextCursor":{"type":["string","null"],"description":"Opaque. Pass as `cursor` to get the next page; `null` on the last page."}},"required":["basis","fieldSize","entries","nextCursor"]},"LeaderboardEntry":{"type":"object","properties":{"rank":{"type":"integer","minimum":1,"description":"Ties share a rank."},"handle":{"type":"string"},"displayName":{"type":"string"},"isBot":{"type":"boolean"},"institutions":{"type":"array","items":{"type":"string"},"description":"Every institution the trader has a confirmed email address at, the one they signed up with first. Empty for a bot or an unverified account."},"settledPnlMicro":{"type":"string","pattern":"^-?\\d+$","description":"Realized: net reputation from trading and settlement, over settled markets only.","example":"1500000"},"settledMarkets":{"type":"integer"},"netWorthMicro":{"type":"string","pattern":"^-?\\d+$","description":"Liquidation value: cash + what selling every open holding now would actually pay (real quotes, slippage included). Not a mark.","example":"1500000"},"unrealizedPnlMicro":{"type":"string","pattern":"^-?\\d+$","description":"What selling every open holding now would pay, minus what those markets’ trades cost net of sales, over markets not yet settled.","example":"1500000"}},"required":["rank","handle","displayName","isBot","institutions","settledPnlMicro","settledMarkets","netWorthMicro","unrealizedPnlMicro"]},"PublicAccount":{"type":"object","properties":{"handle":{"type":"string"},"displayName":{"type":"string"},"isBot":{"type":"boolean"},"institutions":{"type":"array","items":{"type":"string"},"description":"Every institution the trader has a confirmed email address at, the one they signed up with first. Empty for a bot or an unverified account."},"rorId":{"type":["string","null"]},"verifiedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"settledRecord":{"$ref":"#/components/schemas/SettledRecord"}},"required":["handle","displayName","isBot","institutions","rorId","verifiedAt","createdAt","settledRecord"]},"SettledRecord":{"type":"object","properties":{"settledPnlMicro":{"type":"string","pattern":"^-?\\d+$","description":"Net reputation from trading and settlement, over settled markets only.","example":"1500000"},"settledMarkets":{"type":"integer"}},"required":["settledPnlMicro","settledMarkets"]},"PublicPositionList":{"type":"object","properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/PublicPosition"}}},"required":["positions"]},"PublicPosition":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time","description":"When it was made public."},"trader":{"type":"object","properties":{"handle":{"type":"string"},"displayName":{"type":"string"},"isBot":{"type":"boolean"}},"required":["handle","displayName","isBot"]},"market":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"question":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["draft","open","closed","settled","void"]},"listingSlug":{"type":["string","null"]},"listingTitle":{"type":["string","null"]}},"required":["id","slug","question","kind","status","listingSlug","listingTitle"]},"outcome":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"},"ordinal":{"type":"integer","minimum":0},"count":{"type":"integer","exclusiveMinimum":0,"description":"How many outcomes its market has."}},"required":["id","label","ordinal","count"]},"price":{"type":"number","minimum":0,"maximum":1,"description":"The outcome’s price now."},"state":{"type":"string","enum":["held","sold","won","lost","void"],"description":"`held`: shares are held now. `sold`: none are. `won`/`lost`: held into settlement. `void`: the market was voided."},"sharedSharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Shares held when it was made public.","example":"1500000"},"heldMicro":{"type":"string","pattern":"^-?\\d+$","description":"Shares held now; once settled, those held into settlement.","example":"1500000"},"boughtMicro":{"type":"string","pattern":"^-?\\d+$","description":"Σ shares bought, over every fill.","example":"1500000"},"paidMicro":{"type":"string","pattern":"^-?\\d+$","description":"Σ cost of the buys.","example":"1500000"},"soldMicro":{"type":"string","pattern":"^-?\\d+$","description":"Σ proceeds of the sells.","example":"1500000"},"costBasisMicro":{"type":"string","pattern":"^-?\\d+$","description":"What the shares held cost, by average cost. Not a value.","example":"1500000"},"quotedExitMicro":{"type":["string","null"],"pattern":"^-?\\d+$","description":"What selling the shares held would pay now, slippage included; null unless the market trades and shares are held. Never a mark.","example":"1500000"},"payoutMicro":{"type":"string","pattern":"^-?\\d+$","description":"1 per share held into settlement if this outcome won, else 0.","example":"1500000"},"pnlMicro":{"type":"string","pattern":"^-?\\d+$","description":"soldMicro + payoutMicro + quotedExitMicro − paidMicro.","example":"1500000"}},"required":["id","createdAt","trader","market","outcome","price","state","sharedSharesMicro","heldMicro","boughtMicro","paidMicro","soldMicro","costBasisMicro","quotedExitMicro","payoutMicro","pnlMicro"],"description":"A position its holder chose to make public, read live: it follows the position as it is sold or settled."},"CommentList":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"},"description":"Top-level comments, in the requested `sort` order."},"replies":{"type":"array","items":{"$ref":"#/components/schemas/Comment"},"description":"A preview of the replies under them, flat, oldest first: the first 3 replies to each comment, 3 levels down. `parentId` makes the tree."},"nextCursor":{"type":["string","null"],"description":"Opaque. Pass as `cursor` to get the next page; `null` on the last page."},"total":{"type":"integer","minimum":0,"description":"Every comment on the market, replies included."},"viewer":{"type":["object","null"],"properties":{"alias":{"type":["string","null"],"description":"The caller's alias on this paper; `null` until they first comment on it."},"available":{"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid"},"outcomeLabel":{"type":"string"},"heldMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"allocatedMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"}},"required":["outcomeId","outcomeLabel","heldMicro","allocatedMicro"]},"description":"Outcomes of this market the caller holds, with how much is already backing comments. `heldMicro − allocatedMicro` is what can still be put behind one."}},"required":["alias","available"],"description":"The caller's stake available for backing. `null` when anonymous."}},"required":["comments","replies","nextCursor","total","viewer"]},"Comment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"parentId":{"type":["string","null"],"format":"uuid","description":"The comment this replies to; `null` on a top-level comment."},"body":{"type":"string","description":"Raw text, as posted. Clients render it as Markdown (GFM) with $…$ / $$…$$ TeX math."},"createdAt":{"type":"string","format":"date-time"},"replyCount":{"type":"integer","minimum":0,"description":"Direct replies to this comment. More than are loaded: fetch `GET /comments/{id}/replies`."},"mentions":{"type":"array","items":{"type":"string"},"description":"Aliases `@`-mentioned in `body` (`@k3xm`, case-insensitive) that belong to a commenter on this paper, lower case, in order of first mention."},"author":{"type":"object","properties":{"alias":{"type":"string","description":"The author's pseudonym on this paper, OpenReview-style (shown as `User k3xm`): the same on all their comments on the paper's markets, unrelated to their alias on any other paper.","example":"k3xm"},"isBot":{"type":"boolean"},"isYou":{"type":"boolean","description":"True when the authenticated caller wrote this comment."},"stake":{"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid"},"outcomeLabel":{"type":"string"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"}},"required":["outcomeId","outcomeLabel","sharesMicro"]},"description":"The author's current holdings in this market, each rounded down to two significant figures so it cannot be matched against the tape. Empty once it settles."}},"required":["alias","isBot","isYou","stake"],"description":"Pseudonymous by design: an alias per paper, never a handle or an account id."},"backing":{"$ref":"#/components/schemas/CommentBacking"}},"required":["id","parentId","body","createdAt","replyCount","mentions","author","backing"]},"CommentBacking":{"type":"object","properties":{"totalMicro":{"type":"string","pattern":"^-?\\d+$","description":"Σ `valueMicro`: the relevance weight. A **mark** (backed shares × current price), not a sale price; after settlement, 1 per winning share and 0 otherwise.","example":"1500000"},"byOutcome":{"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid"},"outcomeLabel":{"type":"string"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"valueMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"}},"required":["outcomeId","outcomeLabel","sharesMicro","valueMicro"]},"description":"Backed shares per outcome, in ordinal order. Outcomes with none are left out."},"backers":{"type":"integer","minimum":0,"description":"How many accounts back it. Never who."},"yours":{"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"}},"required":["outcomeId","sharesMicro"]},"description":"The caller's own backing on this comment. Empty when anonymous."}},"required":["totalMicro","byOutcome","backers","yours"],"description":"Shares traders have put behind this comment."},"CommentRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2000},"parentId":{"type":"string","format":"uuid","description":"Reply to this comment, on the same market, at any depth."}},"required":["body"]},"CommentReplies":{"type":"object","properties":{"replies":{"type":"array","items":{"$ref":"#/components/schemas/Comment"},"description":"Up to `limit` direct replies, oldest first, then a preview of the replies under each (3 per comment, 2 levels down). Flat: `parentId` makes the tree. More remain while `replyCount` exceeds the direct replies loaded."}},"required":["replies"]},"CommentBackingRequest":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid","description":"An outcome of the comment's market that you hold."},"sharesMicro":{"anyOf":[{"type":"string","pattern":"^-?\\d{1,19}$"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"Integer micro-units (1 unit = 1,000,000), as a decimal string. A JSON integer is also accepted.","example":"10000000"}},"required":["outcomeId","sharesMicro"]},"Fill":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid"},"marketId":{"type":"string","format":"uuid"},"outcomeId":{"type":"string","format":"uuid"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"costMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"priceBefore":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"priceAfter":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"balanceAfterMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"positionAfterMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"createdAt":{"type":"string","format":"date-time"},"replayed":{"type":"boolean","description":"True when this is the original fill returned for a retried `Idempotency-Key`."},"firstTrade":{"type":"boolean","description":"True when this is the first order the account ever placed."}},"required":["orderId","marketId","outcomeId","sharesMicro","costMicro","priceBefore","priceAfter","balanceAfterMicro","positionAfterMicro","createdAt","replayed","firstTrade"]},"OrderRequest":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid"},"sharesMicro":{"anyOf":[{"type":"string","pattern":"^-?\\d{1,19}$"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"Shares to trade, in micro-shares. Negative to sell; you may only sell what you hold.","example":"10000000"},"maxCostMicro":{"anyOf":[{"type":"string","pattern":"^-?\\d{1,19}$"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"Slippage limit, same sign convention as `costMicro`. The order is re-priced under the market lock and refused with `slippage_exceeded` if the cost is above this. For a sell, pass minus the least proceeds you will accept.","example":"10000000"}},"required":["outcomeId","sharesMicro","maxCostMicro"]},"Me":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"handle":{"type":"string"},"displayName":{"type":"string"},"isBot":{"type":"boolean"},"institutions":{"type":"array","items":{"type":"string"},"description":"Every institution the trader has a confirmed email address at, the one they signed up with first. Empty for a bot or an unverified account."},"verifiedAt":{"type":["string","null"],"format":"date-time","description":"When the first of your current institutional email addresses was confirmed; null when none is."},"canTrade":{"type":"boolean","description":"True for a verified account or a bot. Unverified accounts may browse and quote but not place orders."},"balanceMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"createdAt":{"type":"string","format":"date-time"},"digestOptIn":{"type":"boolean","description":"Whether the daily email about followed papers whose price moved may be sent to you. On by default."},"mentionMailOptIn":{"type":"boolean","description":"Whether you are emailed when a comment `@`-mentions your alias. On by default."},"auth":{"type":"object","properties":{"method":{"type":"string","enum":["token","session"]},"scopes":{"type":"array","items":{"type":"string","enum":["read","trade","admin"]}}},"required":["method","scopes"]}},"required":["id","handle","displayName","isBot","institutions","verifiedAt","canTrade","balanceMicro","createdAt","digestOptIn","mentionMailOptIn","auth"]},"Portfolio":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"balanceMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"holdings":{"type":"array","items":{"$ref":"#/components/schemas/Holding"}},"unsettledValuation":{"type":"object","properties":{"midMarketNetWorthMicro":{"type":"string","pattern":"^-?\\d+$","description":"balance + Σ markMicro. Noise before settlement: see `caveat`.","example":"1500000"},"liquidationValueMicro":{"type":"string","pattern":"^-?\\d+$","description":"balance + Σ quotedExitMicro. What you would hold if you sold everything now.","example":"1500000"},"caveat":{"type":"string"}},"required":["midMarketNetWorthMicro","liquidationValueMicro","caveat"],"description":"Valuations of open positions. The mid-market one is not a score; the liquidation value is `summary.netWorthMicro`."},"summary":{"$ref":"#/components/schemas/PortfolioSummary"}},"required":["accountId","balanceMicro","holdings","unsettledValuation","summary"]},"Holding":{"type":"object","properties":{"marketId":{"type":"string","format":"uuid"},"marketSlug":{"type":"string"},"listingSlug":{"type":["string","null"],"description":"The slug of the market’s listing, if it has one."},"listingTitle":{"type":["string","null"],"description":"The title of the market’s listing, if it has one."},"question":{"type":"string"},"marketStatus":{"type":"string","enum":["draft","open","closed","settled","void"]},"outcomeId":{"type":"string","format":"uuid"},"outcomeLabel":{"type":"string"},"outcomeOrdinal":{"type":"integer","minimum":0,"description":"The outcome’s place in its market, 0 = first. Outcomes are ordered best first, worst last."},"outcomeCount":{"type":"integer","exclusiveMinimum":0,"description":"How many outcomes its market has."},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Integer micro-units (1 unit = 1,000,000), as a decimal string.","example":"1500000"},"price":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"markMicro":{"type":"string","pattern":"^-?\\d+$","description":"shares × current price. A MARK, NOT A SALE PRICE: closing the position pays `quotedExitMicro`, which is less.","example":"1500000"},"quotedExitMicro":{"type":"string","pattern":"^-?\\d+$","description":"What selling the whole holding now would pay: a real quote for the full size, slippage included. Always ≤ `markMicro`.","example":"1500000"},"costBasisMicro":{"type":"string","pattern":"^-?\\d+$","description":"What the shares held cost, by the average-cost method: buys add their cost, a sell removes its fraction of the basis. How the position was entered — not a value.","example":"1500000"},"publicPositionId":{"type":["string","null"],"format":"uuid","description":"The id of its public link (`GET /positions/{id}`) when you have made it public, else null."}},"required":["marketId","marketSlug","listingSlug","listingTitle","question","marketStatus","outcomeId","outcomeLabel","outcomeOrdinal","outcomeCount","sharesMicro","price","markMicro","quotedExitMicro","costBasisMicro","publicPositionId"]},"PortfolioSummary":{"type":"object","properties":{"cashMicro":{"type":"string","pattern":"^-?\\d+$","description":"Your balance.","example":"1500000"},"holdingsValueMicro":{"type":"string","pattern":"^-?\\d+$","description":"Σ quotedExitMicro over your holdings.","example":"1500000"},"netWorthMicro":{"type":"string","pattern":"^-?\\d+$","description":"cash + holdings value: liquidation value, what you would hold if you sold everything now. The leaderboard’s `net_worth` basis.","example":"1500000"},"unrealizedPnlMicro":{"type":"string","pattern":"^-?\\d+$","description":"holdings value + the net of your trades on markets not yet settled: what liquidating now would make or lose.","example":"1500000"},"realizedPnlMicro":{"type":"string","pattern":"^-?\\d+$","description":"Net of your trades and settlement payouts on settled markets.","example":"1500000"}},"required":["cashMicro","holdingsValueMicro","netWorthMicro","unrealizedPnlMicro","realizedPnlMicro"]},"MyOrders":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/MyOrder"},"description":"Newest first."},"nextCursor":{"type":["string","null"],"description":"Opaque. Pass as `cursor` to get the next page; `null` on the last page."}},"required":["orders","nextCursor"]},"MyOrder":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"outcomeId":{"type":"string","format":"uuid"},"sharesMicro":{"type":"string","pattern":"^-?\\d+$","description":"Signed: negative is a sell.","example":"1500000"},"costMicro":{"type":"string","pattern":"^-?\\d+$","description":"Signed: negative is proceeds paid to the seller.","example":"1500000"},"priceBefore":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"priceAfter":{"type":"number","minimum":0,"maximum":1,"description":"Implied probability."},"createdAt":{"type":"string","format":"date-time"},"marketId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":["string","null"]}},"required":["id","outcomeId","sharesMicro","costMicro","priceBefore","priceAfter","createdAt","marketId","idempotencyKey"]},"UpdateMeRequest":{"type":"object","properties":{"digestOptIn":{"type":"boolean","description":"Turn the daily followed-papers email on or off."},"mentionMailOptIn":{"type":"boolean","description":"Turn the email on or off that a comment mentioning you sends."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"The name shown for you on the leaderboard and your public page. Your handle does not change."}},"additionalProperties":false},"FollowList":{"type":"object","properties":{"follows":{"type":"array","items":{"$ref":"#/components/schemas/FollowedListing"},"description":"Most recently followed first."}},"required":["follows"]},"FollowedListing":{"type":"object","properties":{"listing":{"$ref":"#/components/schemas/Listing"},"followedAt":{"type":"string","format":"date-time"},"headline":{"type":["object","null"],"properties":{"marketId":{"type":"string","format":"uuid"},"outcomeId":{"type":"string","format":"uuid"},"outcomeLabel":{"type":"string"},"negated":{"type":"boolean","description":"True when the headline is `1 − P(outcome)` (a market with more than two outcomes), false when it is `P(outcome)`."},"price":{"type":"number","minimum":0,"maximum":1,"description":"The headline now."},"price24hAgo":{"type":"number","minimum":0,"maximum":1,"description":"The headline 24 hours ago, replayed exactly from the fills (the opening price for a newer market)."}},"required":["marketId","outcomeId","outcomeLabel","negated","price","price24hAgo"],"description":"`null` when the listing has no visible market."}},"required":["listing","followedAt","headline"]},"GroupList":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"},"description":"By name."}},"required":["groups"]},"GroupSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":1},"role":{"type":"string","enum":["admin","member"],"description":"The admin made the group and may rename it, rotate its invite code, remove members and delete it."},"inviteCode":{"type":"string","minLength":1,"maxLength":64}},"required":["id","name","description","memberCount","role","inviteCode"]},"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"memberCount":{"type":"integer","minimum":1},"members":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"},"description":"In the order they joined, the admin first."},"role":{"type":["string","null"],"enum":["admin","member",null],"description":"The caller’s role; null when not a member, or anonymous."},"inviteCode":{"type":["string","null"],"minLength":1,"maxLength":64,"description":"What `POST /groups/join` takes. Shown to members only; null to anyone else."}},"required":["id","name","description","createdAt","memberCount","members","role","inviteCode"]},"GroupMember":{"type":"object","properties":{"handle":{"type":"string"},"displayName":{"type":"string"},"isBot":{"type":"boolean"},"institutions":{"type":"array","items":{"type":"string"},"description":"Every institution the trader has a confirmed email address at, the one they signed up with first. Empty for a bot or an unverified account."},"role":{"type":"string","enum":["admin","member"],"description":"The admin made the group and may rename it, rotate its invite code, remove members and delete it."},"joinedAt":{"type":"string","format":"date-time"}},"required":["handle","displayName","isBot","institutions","role","joinedAt"]},"CreateGroupRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":["string","null"],"maxLength":500}},"required":["name"],"additionalProperties":false},"UpdateGroupRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":["string","null"],"maxLength":500,"description":"Null or blank clears it."}},"additionalProperties":false},"JoinGroupRequest":{"type":"object","properties":{"inviteCode":{"type":"string","minLength":1,"maxLength":64,"description":"From the group’s invite link."}},"required":["inviteCode"],"additionalProperties":false},"ReadingStatus":{"type":"object","properties":{"listingId":{"type":"string","format":"uuid"},"read":{"type":"boolean"},"readers":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"handle":{"type":"string"},"displayName":{"type":"string"}},"required":["accountId","handle","displayName"]},"description":"Reading-group members with a global read marker."},"memberCount":{"type":"integer","minimum":0,"description":"Number of members in the reading group or groups."}},"required":["listingId","read","readers","memberCount"]},"ReadingList":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"listingId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"headline":{"type":["number","null"],"minimum":0,"maximum":1,"description":"The main visible market’s headline probability; its result once settled, null without a visible market or when void."},"status":{"$ref":"#/components/schemas/ReadingStatus"}},"required":["listingId","slug","title","headline","status"]}}},"required":["entries"]},"ReadingListState":{"type":"object","properties":{"groupId":{"type":"string","format":"uuid"},"listingId":{"type":"string","format":"uuid"},"added":{"type":"boolean"}},"required":["groupId","listingId","added"]},"FollowState":{"type":"object","properties":{"listingId":{"type":"string","format":"uuid"},"following":{"type":"boolean","description":"Whether the caller now follows the listing."},"followers":{"type":"integer","minimum":0}},"required":["listingId","following","followers"]},"ViewState":{"type":"object","properties":{"listingId":{"type":"string","format":"uuid"},"views":{"type":"integer","minimum":0,"description":"Unique viewers per day, summed over every day so far."}},"required":["listingId","views"]},"PublicPositionState":{"type":"object","properties":{"outcomeId":{"type":"string","format":"uuid"},"publicPositionId":{"type":["string","null"],"format":"uuid","description":"The link id while public; null once private."}},"required":["outcomeId","publicPositionId"]},"CreatedToken":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"start":{"type":["string","null"],"description":"The first 16 characters, to recognise a token by. Not usable."},"scopes":{"type":"array","items":{"type":"string","enum":["read","trade","admin"]}},"createdAt":{"type":"string","format":"date-time"},"token":{"type":"string","description":"The secret. Shown once, never again."}},"required":["id","name","start","scopes","createdAt","token"]},"CreateTokenRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","items":{"type":"string","enum":["read","trade"]},"minItems":1,"description":"A signed-in user may mint `read` and `trade` tokens. `admin` is issued by an operator only."}},"required":["name","scopes"]},"TokenList":{"type":"object","properties":{"tokens":{"type":"array","items":{"$ref":"#/components/schemas/TokenInfo"}}},"required":["tokens"]},"TokenInfo":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"start":{"type":["string","null"],"description":"The first 16 characters, to recognise a token by. Not usable."},"scopes":{"type":"array","items":{"type":"string","enum":["read","trade","admin"]}},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"enabled":{"type":"boolean"}},"required":["id","name","start","scopes","createdAt","lastUsedAt","enabled"]},"AffiliationList":{"type":"object","properties":{"affiliations":{"type":"array","items":{"$ref":"#/components/schemas/Affiliation"}}},"required":["affiliations"]},"Affiliation":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"An affiliation id."},"email":{"type":"string"},"institutionName":{"type":"string","description":"The allowlist’s name for the address’s domain."},"primary":{"type":"boolean","description":"The address you signed up with. It cannot be removed."},"verifiedAt":{"type":["string","null"],"format":"date-time","description":"When the address was confirmed; null while a code is outstanding."},"codeExpiresAt":{"type":["string","null"],"format":"date-time","description":"When the outstanding code stops working, if there is one."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","institutionName","primary","verifiedAt","codeExpiresAt","createdAt"]},"AddAffiliationRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","description":"An address at an approved institution.","example":"ada@ethz.ch"}},"required":["email"],"additionalProperties":false},"VerifyAffiliationRequest":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$","description":"The 6-digit code mailed to the address.","example":"042317"}},"required":["code"],"additionalProperties":false},"PasswordSet":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"SetPasswordRequest":{"type":"object","properties":{"password":{"type":"string","minLength":12,"maxLength":128}},"required":["password"],"additionalProperties":false},"SignUpStarted":{"type":"object","properties":{"email":{"type":"string","description":"Where the confirmation mail went."}},"required":["email"]},"OnboardingRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","description":"An address at an approved institution.","example":"ada@ethz.ch"},"marketId":{"type":"string","format":"uuid"},"outcomeId":{"type":"string","format":"uuid"},"stakeMicro":{"anyOf":[{"type":"string","pattern":"^-?\\d{1,19}$"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"What to spend, at most the starting balance. Not a share count.","example":"10000000"},"seenOrderCount":{"type":"integer","minimum":0,"description":"The market's `orderCount` on the board the bet was chosen from. Unchanged at confirmation, the bet is placed without asking again."}},"required":["email","marketId","outcomeId","stakeMicro","seenOrderCount"],"additionalProperties":false},"CreatedMarket":{"type":"object","properties":{"market":{"$ref":"#/components/schemas/Market"},"subsidyMicro":{"type":"string","pattern":"^-?\\d+$","description":"b·ln(n), debited from the house treasury.","example":"1500000"}},"required":["market","subsidyMicro"]},"CreateMarketRequest":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$"},"question":{"type":"string","minLength":1,"maxLength":500},"description":{"type":["string","null"],"maxLength":10000},"contract":{"type":["string","null"],"maxLength":50000,"description":"The resolution contract: how the market settles, edge cases included. Markdown, shown to traders."},"kind":{"type":"string","minLength":1,"maxLength":100,"description":"Opaque. Defaults to \"binary\"."},"outcomes":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":2,"maxItems":20},"closesAt":{"type":"string","format":"date-time"},"resolutionSource":{"type":["string","null"],"maxLength":1000,"description":"Opaque to the venue."},"expectedTraders":{"type":"integer","minimum":1,"maximum":1000000,"description":"The expected field size. With STARTING_BALANCE_MICRO it sizes `b`, once; `b` is then frozen for the life of the market."},"openingPrices":{"type":"array","items":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1},"minItems":2,"maxItems":20,"description":"The prices the market opens at, one per outcome in order, summing to 1; left out, every outcome opens at 1/n. The house pays for a prior: the subsidy is `b·ln(1/min price)` instead of `b·ln(n)`."},"listingSlug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$","description":"Attach the market to this listing, which must already exist (`POST /listings`)."},"listingRank":{"type":"integer","minimum":0,"maximum":1000,"description":"Order within the listing; defaults to 0, the main market."}},"required":["slug","question","outcomes","closesAt","expectedTraders"]},"UpsertedListing":{"type":"object","properties":{"listing":{"$ref":"#/components/schemas/Listing"},"created":{"type":"boolean"}},"required":["listing","created"]},"UpsertListingRequest":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$"},"title":{"type":"string","minLength":1,"maxLength":500},"summary":{"type":["string","null"],"maxLength":20000},"tldr":{"type":["string","null"],"maxLength":2000,"description":"A one-line summary."},"authors":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":200},"authorIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":200,"description":"One opaque id per name in `authors`, in the same order. Left out or empty when there are none."},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100},"primaryArea":{"type":["string","null"],"minLength":1,"maxLength":200,"description":"Opaque."},"links":{"type":"array","items":{"$ref":"#/components/schemas/ListingLink"},"maxItems":20},"kind":{"type":["string","null"],"minLength":1,"maxLength":100,"description":"Opaque."},"references":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceRequest"},"maxItems":1000,"description":"The bibliography, in order. Replaced whole; left out, it is cleared."}},"required":["slug","title"],"description":"Creates the listing, or replaces every field of the one with this slug. A field left out is cleared."},"ReferenceRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":1000},"authors":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100},"year":{"type":["integer","null"],"minimum":1000,"maximum":3000},"venue":{"type":["string","null"],"minLength":1,"maxLength":500,"description":"Where it appeared, as a bibliography sets it, e.g. \"International Conference on Learning Representations\". Opaque."},"url":{"type":["string","null"],"maxLength":2000,"format":"uri"},"slug":{"type":["string","null"],"pattern":"^[a-z0-9][a-z0-9-]{0,99}$","description":"The cited work’s listing slug, if it has one here or may get one. Matched when read, so it need not exist yet."}},"required":["title"]},"SettleRequest":{"type":"object","properties":{"winningOutcomeId":{"type":"string","format":"uuid"},"evidenceUrl":{"type":"string","maxLength":2000,"format":"uri"}},"required":["winningOutcomeId","evidenceUrl"]}},"parameters":{}},"paths":{"/markets":{"get":{"tags":["markets"],"summary":"List markets","description":"Newest first. Drafts are hidden unless `status=draft`. With `q`, only markets whose question or description — or whose listing’s title, authors or summary — match, best match first.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","maxLength":512,"description":"From a previous page’s `nextCursor`."},"required":false,"description":"From a previous page’s `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["draft","open","closed","settled","void"],"description":"Filter by status. Without it, every market except drafts."},"required":false,"description":"Filter by status. Without it, every market except drafts.","name":"status","in":"query"},{"schema":{"type":"string","maxLength":100,"description":"Filter by the opaque `kind` string."},"required":false,"description":"Filter by the opaque `kind` string.","name":"kind","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Free-text search (Postgres full text, English stemming). Web-search syntax: `\"a phrase\"`, `a OR b`, `-word`; without those, the last word also matches as a prefix. With `q`, results are ordered by relevance, best first, and `nextCursor` pages in that order (a cursor from an unsearched page is refused). Blank is ignored.","example":"transformer attention"},"required":false,"description":"Free-text search (Postgres full text, English stemming). Web-search syntax: `\"a phrase\"`, `a OR b`, `-word`; without those, the last word also matches as a prefix. With `q`, results are ordered by relevance, best first, and `nextCursor` pages in that order (a cursor from an unsearched page is refused). Blank is ignored.","name":"q","in":"query"}],"responses":{"200":{"description":"A page of markets.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["admin"],"summary":"Create a market","description":"`b` is computed here from `expectedTraders` and the starting balance, and frozen for the life of the market. The house treasury is debited b·ln(n).","security":[{"bearer":["admin"]},{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMarketRequest"}}}},"responses":{"201":{"description":"The new market.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedMarket"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"admin\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no listing with `listingSlug`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"slug_taken | house_underfunded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/markets/{id}":{"get":{"tags":["markets"],"summary":"Market board","description":"Outcomes, prices, volume and the frozen liquidity parameter `b`.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"The board.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/markets/{id}/history":{"get":{"tags":["markets"],"summary":"Price history","description":"Every outcome’s price after every fill, oldest first, reconstructed from the fills.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"},{"schema":{"type":"string","maxLength":512,"description":"From a previous page’s `nextCursor`."},"required":false,"description":"From a previous page’s `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of price points.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceHistory"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/markets/{id}/orders":{"get":{"tags":["markets"],"summary":"Public tape","description":"Fills on this market, newest first. Carries no account identities.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"},{"schema":{"type":"string","maxLength":512,"description":"From a previous page’s `nextCursor`."},"required":false,"description":"From a previous page’s `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of fills.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tape"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["trading"],"summary":"Place an order (buy, or sell with negative shares)","description":"Selling is an order with negative `sharesMicro`; you may only sell shares you hold. Send an `Idempotency-Key` header and retry freely: a retry with the same key returns the original fill with `replayed: true`.","security":[{"bearer":["trade"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7e]+$","description":"Up to 255 printable ASCII characters, unique per account."},"required":false,"description":"Up to 255 printable ASCII characters, unique per account.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}}},"responses":{"201":{"description":"The fill (or, for a replayed key, the original fill).","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fill"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the credential lacks the \"trade\" scope | not_verified: the account has no confirmed institutional email address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no such market or outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"slippage_exceeded | insufficient_balance | insufficient_shares | market_not_open | market_closed | idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/markets/{id}/quote":{"post":{"tags":["trading"],"summary":"Quote a hypothetical trade","description":"Prices the whole size, slippage included. Writes nothing. Advisory: an order is re-priced under the market lock, so pass the quoted cost as `maxCostMicro`.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}}},"responses":{"200":{"description":"The quote.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no such market or outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings":{"get":{"tags":["listings"],"summary":"List listings","description":"Newest first. A listing is an opaque subject that markets are grouped under; each comes with its markets, main market first. With `q`, only listings whose title, authors or summary — or any of whose visible markets’ question or description — match, best match first.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","maxLength":512,"description":"From a previous page’s `nextCursor`."},"required":false,"description":"From a previous page’s `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":100,"description":"Filter by the opaque `kind` string."},"required":false,"description":"Filter by the opaque `kind` string.","name":"kind","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Free-text search (Postgres full text, English stemming). Web-search syntax: `\"a phrase\"`, `a OR b`, `-word`; without those, the last word also matches as a prefix. With `q`, results are ordered by relevance, best first, and `nextCursor` pages in that order (a cursor from an unsearched page is refused). Blank is ignored.","example":"transformer attention"},"required":false,"description":"Free-text search (Postgres full text, English stemming). Web-search syntax: `\"a phrase\"`, `a OR b`, `-word`; without those, the last word also matches as a prefix. With `q`, results are ordered by relevance, best first, and `nextCursor` pages in that order (a cursor from an unsearched page is refused). Blank is ignored.","name":"q","in":"query"}],"responses":{"200":{"description":"A page of listings.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["admin"],"summary":"Create or replace a listing","description":"By slug: creates the listing, or replaces every field of the existing one (a field left out is cleared). The venue stores these fields for display and never fetches or interprets them. Link URLs must be http(s).","security":[{"bearer":["admin"]},{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertListingRequest"}}}},"responses":{"200":{"description":"Replaced an existing listing.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertedListing"}}}},"201":{"description":"Created.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertedListing"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"admin\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}":{"get":{"tags":["listings"],"summary":"A listing and its markets","description":"Markets are ordered by `listingRank`; the first is the main market. Drafts are left out.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"The listing.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Listing"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/citations":{"get":{"tags":["listings"],"summary":"What a listing cites, and what cites it","description":"The bibliography the creating client supplied, each entry with the listing its slug names (and that listing’s main market) when one exists here; and the listings whose bibliography names this one.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"The citations.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingCitations"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/related":{"get":{"tags":["listings"],"summary":"Listings related to this one","description":"Named by a separate similarity service, best first, each with its main market. The venue computes no similarity itself.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"The related listings.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingRelated"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["listings"],"summary":"Set a listing’s related listings","description":"Replaces the whole list; empty clears it. Slugs are matched when read, so one need not be listed yet. A listing relating to itself and repeated slugs are dropped.","security":[{"bearer":["admin"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetRelatedRequest"}}}},"responses":{"200":{"description":"How many were kept.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetRelatedResult"}}}},"400":{"description":"validation_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"admin\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/minimap":{"get":{"tags":["listings"],"summary":"A listing’s piece of the paper map","description":"The listing, the papers nearest it on the map (by the supplied vectors when it has one) and its related papers wherever they lie, with their vectors and the related pairs between them. Public, cached for five minutes.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"The piece of the map.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Minimap"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/map":{"get":{"tags":["listings"],"summary":"The paper map","description":"Every listing on the supplied 2D layout, by column: its slug, groupings, primary area and main market’s headline price. Titles are `GET /map/titles`. Laid out by a separate service; the venue computes no layout. Public, cached for five minutes.","security":[{},{"bearer":[]},{"session":[]}],"responses":{"200":{"description":"The whole map.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaperMap"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["listings"],"summary":"Set the paper map","description":"Replaces the whole map and its grouping names in one transaction; empty clears it. Slugs are matched when read, so one need not be listed yet.","security":[{"bearer":["admin"]},{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMapRequest"}}}},"responses":{"200":{"description":"How many points were kept.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMapResult"}}}},"400":{"description":"validation_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"admin\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/map/titles":{"get":{"tags":["listings"],"summary":"Titles of the papers on the map","description":"The title of every listing on the map, by slug: what `GET /map` leaves out, so a client can draw the map before they arrive. Public, cached for five minutes.","security":[{},{"bearer":[]},{"session":[]}],"responses":{"200":{"description":"The titles.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapTitles"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/map/search":{"get":{"tags":["listings"],"summary":"Search the paper map","description":"The home page’s search syntax over every listing: words (titles, authors, abstracts), `key:value` filters (`title author keyword area venue status accept volume trades`), `OR`, parentheses and `-`. Returns every match’s slug, most relevant first.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"The home page’s search syntax (see `/map/search`). Blank finds nothing.","example":"transformer attention"},"required":false,"description":"The home page’s search syntax (see `/map/search`). Blank finds nothing.","name":"q","in":"query"}],"responses":{"200":{"description":"The matching slugs.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapSearch"}}}},"400":{"description":"validation_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/map/related":{"get":{"tags":["listings"],"summary":"Related lists between papers on the map","description":"Every listing on the map with its best related entries that are also on the map, as index pairs into a slug list. For a client that re-lays out a subset of the map. Public, cached for five minutes.","security":[{},{"bearer":[]},{"session":[]}],"responses":{"200":{"description":"The edges.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapRelated"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/transitions":{"get":{"tags":["listings"],"summary":"Which listings visitors read after which","description":"Per ordered pair of listings, how many visitors read the second after the first (once per visitor per day, summed), most first. Only totals are kept. For a similarity service; the venue computes nothing from it.","security":[{"bearer":["admin"]},{"session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Leave out pairs counted fewer times."},"required":false,"description":"Leave out pairs counted fewer times.","name":"min","in":"query"}],"responses":{"200":{"description":"The pairs.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transitions"}}}},"400":{"description":"validation_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"admin\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leaderboard":{"get":{"tags":["accounts"],"summary":"Leaderboard","description":"Every entry carries settled (realized) P&L, liquidation net worth and unrealized P&L; `basis` picks the ranking. `settled_pnl` (the default): P&L over settled markets only; accounts with no settled market are not listed. `net_worth`: every trader, by liquidation value — cash plus what selling every open holding now would actually pay. That cannot be inflated by the trader’s own price impact, because the exit quote walks back down the curve the buy walked up. Mark-based (mid-market) net worth can be, and is never a ranking basis. `institution` ranks one institution among itself, `group` one group; `q` finds traders by name and keeps their rank.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","maxLength":512,"description":"From a previous page’s `nextCursor`."},"required":false,"description":"From a previous page’s `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["settled_pnl","net_worth"],"default":"settled_pnl","description":"`settled_pnl` (the default): P&L over settled markets only; accounts with no settled market are not listed. `net_worth`: every trader, by liquidation value — cash plus what selling every open holding now would actually pay. That cannot be inflated by the trader’s own price impact, because the exit quote walks back down the curve the buy walked up. Mark-based (mid-market) net worth can be, and is never a ranking basis."},"required":false,"description":"`settled_pnl` (the default): P&L over settled markets only; accounts with no settled market are not listed. `net_worth`: every trader, by liquidation value — cash plus what selling every open holding now would actually pay. That cannot be inflated by the trader’s own price impact, because the exit quote walks back down the curve the buy walked up. Mark-based (mid-market) net worth can be, and is never a ranking basis.","name":"basis","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Only traders with a confirmed affiliation at this institution (exactly one of their `institutions`), ranked among themselves.","example":"ETH Zurich"},"required":false,"description":"Only traders with a confirmed affiliation at this institution (exactly one of their `institutions`), ranked among themselves.","name":"institution","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only the members of this group (`GET /groups/{id}`), ranked among themselves. Combines with `institution`."},"required":false,"description":"Only the members of this group (`GET /groups/{id}`), ranked among themselves. Combines with `institution`.","name":"group","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Only traders whose handle or display name matches, fuzzily: a case-insensitive substring, or a word close to one (trigram similarity). Each keeps their rank on the board. Blank is ignored.","example":"hinton"},"required":false,"description":"Only traders whose handle or display name matches, fuzzily: a case-insensitive substring, or a word close to one (trigram similarity). Each keeps their rank on the board. Blank is ignored.","name":"q","in":"query"}],"responses":{"200":{"description":"A page of the leaderboard.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Leaderboard"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/{handle}":{"get":{"tags":["accounts"],"summary":"Public profile","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"An account handle.","example":"alice"},"required":true,"description":"An account handle.","name":"handle","in":"path"}],"responses":{"200":{"description":"Institution and settled record.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAccount"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/{handle}/positions":{"get":{"tags":["accounts"],"summary":"Public positions","description":"Only the positions this trader chose to make public, newest first, each read live. Nothing else about anyone’s positions is public.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"An account handle.","example":"alice"},"required":true,"description":"An account handle.","name":"handle","in":"path"}],"responses":{"200":{"description":"Their public positions.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPositionList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/positions/{id}":{"get":{"tags":["accounts"],"summary":"A public position","description":"A position its holder made public, by its link id: held, sold or settled now, with the exit quote while trading (never a mark). 404 once made private.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The position, now.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPosition"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/markets/{id}/comments":{"get":{"tags":["markets"],"summary":"Comments","description":"Top-level comments, newest first, or by backing with `sort=relevance`, with a preview of the replies under them in `replies` (the rest from `GET /comments/{id}/replies`). Anonymous: each comment shows only whether its author is a bot, their current stake in this market, and how much stake others have put behind it (never by whom). Bodies are raw Markdown with TeX math.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"},{"schema":{"type":"string","maxLength":512,"description":"From a previous page’s `nextCursor`."},"required":false,"description":"From a previous page’s `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["newest","relevance"],"default":"newest","description":"`newest` (default): newest first, paginated. `relevance`: by backing value, highest first, ties newest first — over the 200 most recent comments only, one page (`nextCursor` is always null, and `cursor` is refused)."},"required":false,"description":"`newest` (default): newest first, paginated. `relevance`: by backing value, highest first, ties newest first — over the 200 most recent comments only, one page (`nextCursor` is always null, and `cursor` is refused).","name":"sort","in":"query"}],"responses":{"200":{"description":"A page of comments.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["markets"],"summary":"Post a comment","description":"With `parentId`, a reply. Needs the `trade` scope and a trading-eligible (verified or bot) account.","security":[{"bearer":["trade"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentRequest"}}}},"responses":{"201":{"description":"The comment, as others will see it.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden | not_verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no such market, or `parentId` is not a comment on it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/comments/{id}/replies":{"get":{"tags":["markets"],"summary":"Replies to a comment","description":"Direct replies, oldest first, after `after` (the last one loaded), each with a preview of the replies under it. Replies nest to any depth.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A comment id."},"required":true,"description":"A comment id.","name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"A direct reply to this comment: start after it. Usually the last one loaded."},"required":false,"description":"A direct reply to this comment: start after it. Usually the last one loaded.","name":"after","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of replies.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentReplies"}}}},"400":{"description":"validation_error: `after` is not a reply to this comment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/comments/{id}/backing":{"post":{"tags":["trading"],"summary":"Back a comment with shares","description":"Puts `sharesMicro` of an outcome you hold behind someone else's comment on an open market. No reputation moves; the shares stay in your position. Across all comments, what you back on an outcome never exceeds what you hold of it: selling trims your backings newest first, and buying back does not restore them. Needs the `trade` scope and a trading-eligible account.","security":[{"bearer":["trade"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A comment id."},"required":true,"description":"A comment id.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentBackingRequest"}}}},"responses":{"201":{"description":"The comment, with its updated backing.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden | not_verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no such comment, or the outcome is not on the comment's market.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"insufficient_stake | own_comment | market_not_open | market_closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["trading"],"summary":"Withdraw your backing from a comment","description":"Removes all of your backing from this comment. Idempotent.","security":[{"bearer":["trade"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A comment id."},"required":true,"description":"A comment id.","name":"id","in":"path"}],"responses":{"204":{"description":"Withdrawn (or there was nothing to withdraw)."},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden | not_verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me":{"get":{"tags":["me"],"summary":"The authenticated account","security":[{"bearer":["read"]},{"session":[]}],"responses":{"200":{"description":"Account and balance.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["me"],"summary":"Update your settings","description":"`digestOptIn` (the daily email about followed papers whose price moved), `mentionMailOptIn` (the email a comment mentioning you sends) and `displayName`.","security":[{"bearer":["read"]},{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMeRequest"}}}},"responses":{"200":{"description":"The account, updated.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/portfolio":{"get":{"tags":["me"],"summary":"Holdings","description":"Each holding carries its **mark** (shares × price) and its **quoted exit value** (what selling it all now would pay) as separate fields. They differ, and only the second is a sale price. `summary` gives cash, liquidation net worth, and unrealized and realized P&L. Optional `marketId` filters the holdings only; summary and unsettled valuation remain account-wide.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"marketId","in":"query"}],"responses":{"200":{"description":"The portfolio.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portfolio"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/orders":{"get":{"tags":["me"],"summary":"Own fills","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","maxLength":512,"description":"From a previous page’s `nextCursor`."},"required":false,"description":"From a previous page’s `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of your fills, newest first.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyOrders"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/follows":{"get":{"tags":["me"],"summary":"Listings you follow","description":"Each with its main market’s headline price now and 24 hours ago (replayed from the fills). Prices, not values.","security":[{"bearer":["read"]},{"session":[]}],"responses":{"200":{"description":"Your follows, most recent first.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/groups":{"get":{"tags":["groups"],"summary":"Your groups","security":[{"bearer":["read"]},{"session":[]}],"responses":{"200":{"description":"Every group you are in, with its invite code.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/groups":{"post":{"tags":["groups"],"summary":"Make a group","description":"You become its admin and first member. Share its invite code for others to join. At most 20 groups per admin.","security":[{"bearer":["read"]},{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupRequest"}}}},"responses":{"201":{"description":"The new group.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"validation_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"too_many_groups","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/groups/{id}":{"get":{"tags":["groups"],"summary":"A group","description":"Its members, each with their institutions. Public by id; the invite code only to members. Rank the group with `GET /leaderboard?group={id}`.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The group.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["groups"],"summary":"Rename a group","description":"Its name or description. Admin only.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroupRequest"}}}},"responses":{"200":{"description":"The group.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"validation_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope, or you are not the group’s admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["groups"],"summary":"Delete a group","description":"Admin only. Every membership goes with it.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope, or you are not the group’s admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/groups/{id}/invite":{"post":{"tags":["groups"],"summary":"Rotate the invite code","description":"Admin only. The old invite link stops working; members stay.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The group, with its new code.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope, or you are not the group’s admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/groups/join":{"post":{"tags":["groups"],"summary":"Join a group","description":"By its current invite code. Idempotent.","security":[{"bearer":["read"]},{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinGroupRequest"}}}},"responses":{"200":{"description":"The group you are now in.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"validation_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no group has this code (it may have been rotated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/groups/{id}/members/{handle}":{"delete":{"tags":["groups"],"summary":"Leave a group, or remove a member","description":"Your own handle leaves the group; the admin may remove anyone else. The admin cannot leave: they delete the group instead. Idempotent for someone not in it.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"An account handle.","example":"alice"},"required":true,"description":"An account handle.","name":"handle","in":"path"}],"responses":{"204":{"description":"Removed."},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope, or you are not the group’s admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"group_admin: the admin cannot be removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/read":{"get":{"tags":["listings"],"summary":"Read status of a listing","description":"Read markers are global per account. Includes only readers who are fellow reading-group members. Writes are idempotent.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"Read status.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingStatus"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["listings"],"summary":"Mark a listing read","description":"Read markers are global per account. Includes only readers who are fellow reading-group members. Writes are idempotent.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"Read status.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingStatus"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["listings"],"summary":"Mark a listing unread","description":"Read markers are global per account. Includes only readers who are fellow reading-group members. Writes are idempotent.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"Read status.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingStatus"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/groups/{id}/reading-list":{"get":{"tags":["groups"],"summary":"A reading group’s shared reading list","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Listings, newest additions first, with global read markers.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/groups/{id}/reading-list/{listingId}":{"put":{"tags":["groups"],"summary":"Add a listing to a reading list","description":"Any current member can add or remove. Idempotent. Institutions have no reading list.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"listingId","in":"path"}],"responses":{"200":{"description":"Reading-list membership.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingListState"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: not a group member or missing read scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["groups"],"summary":"Remove a listing from a reading list","description":"Any current member can add or remove. Idempotent. Institutions have no reading list.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"listingId","in":"path"}],"responses":{"200":{"description":"Reading-list membership.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingListState"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: not a group member or missing read scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/follow":{"put":{"tags":["listings"],"summary":"Follow a listing","description":"Idempotent. A follow moves no money and needs only the `read` scope; followers may get a daily email when the listing’s main market moves (opt out with `PATCH /me`). Only listings can be followed.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"Whether you now follow it, and its follower count.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowState"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["listings"],"summary":"Unfollow a listing","description":"Idempotent. A follow moves no money and needs only the `read` scope; followers may get a daily email when the listing’s main market moves (opt out with `PATCH /me`). Only listings can be followed.","security":[{"bearer":["read"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"Whether you now follow it, and its follower count.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowState"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"read\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/view":{"post":{"tags":["listings"],"summary":"Count a view of a listing","description":"Public. Counts the caller once per day: the visitor is a daily hash of IP and user agent, never stored in the clear. Sent by the paper page from the browser; a bot has no reason to call it. `?from=` names the listing read just before, counted the same way per ordered pair.","security":[{},{"bearer":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The listing’s id (uuid) or its slug.","example":"example-listing"},"required":true,"description":"The listing’s id (uuid) or its slug.","name":"id","in":"path"},{"schema":{"type":"string","maxLength":100,"description":"The id of the listing the visitor read just before, if any. Counted as a transition (`GET /transitions`); ignored when it is not a listing id."},"required":false,"description":"The id of the listing the visitor read just before, if any. Counted as a transition (`GET /transitions`); ignored when it is not a listing id.","name":"from","in":"query"}],"responses":{"200":{"description":"The listing’s views after this one.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewState"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/positions/{outcomeId}/public":{"put":{"tags":["me"],"summary":"Make a position public","description":"Gives your position in this outcome a public link and lists it on your public profile, under your handle. Your comments on that market show your stake, so this links them to you. Only a position you hold. Idempotent: the link stays the same.","security":[{"bearer":["trade"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"outcomeId","in":"path"}],"responses":{"200":{"description":"Its link id while public, else null.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPositionState"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"trade\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"insufficient_shares: you hold no shares of this outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["me"],"summary":"Make a position private","description":"Removes it from your profile; its link stops working. Idempotent.","security":[{"bearer":["trade"]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"outcomeId","in":"path"}],"responses":{"200":{"description":"Its link id while public, else null.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPositionState"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"trade\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/tokens":{"post":{"tags":["me"],"summary":"Mint an API token","description":"Scopes `read` and/or `trade`. The token is returned once and never again. `admin` tokens are issued by an operator only.","security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenRequest"}}}},"responses":{"201":{"description":"The token, shown once.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedToken"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["me"],"summary":"List your API tokens","security":[{"session":[]}],"responses":{"200":{"description":"Your tokens, newest first, without their secrets.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/tokens/{id}":{"delete":{"tags":["me"],"summary":"Revoke an API token","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Revoked. The token stops working immediately."},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/affiliations":{"get":{"tags":["me"],"summary":"List your affiliations","description":"Your institutional email addresses, confirmed and pending: the one you signed up with first. The institutions of the confirmed ones are your `institutions`.","security":[{"session":[]}],"responses":{"200":{"description":"Your affiliations.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliationList"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["me"],"summary":"Add an affiliation","description":"Mails a 6-digit code to an address at an approved institution; confirm it with `POST /me/affiliations/{id}/verify` within an hour. Adding a pending address again sends a fresh code, and only the newest works. Each call costs one of 10 affiliation emails a day. An address another account has confirmed answers the same, but its owner is told instead and no code is sent.","security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddAffiliationRequest"}}}},"responses":{"201":{"description":"The pending affiliation.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Affiliation"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"already_affiliated: the address is already one of yours | too_many_pending: at most 5 unconfirmed at once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"email_domain_not_allowed: the domain is not on the institution allowlist, or the address has a +tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: your bucket is empty, or you have used your 10 affiliation emails (one back every 2.4 hours). See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/affiliations/{id}/verify":{"post":{"tags":["me"],"summary":"Confirm an affiliation","description":"With the code mailed to the address. Confirming one already confirmed returns it. After five wrong codes only a fresh code works.","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"An affiliation id."},"required":true,"description":"An affiliation id.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAffiliationRequest"}}}},"responses":{"200":{"description":"The confirmed affiliation.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Affiliation"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"affiliation_taken: another account confirmed this address first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"invalid_code: wrong, expired, or too many attempts (`details.reason`) | email_domain_not_allowed: the domain has left the allowlist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/affiliations/{id}":{"delete":{"tags":["me"],"summary":"Remove an affiliation","description":"Pending or confirmed; never the address you signed up with. Removing your last confirmed one stops you trading.","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"An affiliation id."},"required":true,"description":"An affiliation id.","name":"id","in":"path"}],"responses":{"204":{"description":"Removed."},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"primary_affiliation: the address you signed up with.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/password":{"post":{"tags":["me"],"summary":"Set your first password","description":"For an account made by onboarding (`POST /onboarding`), which has none. To change a password, reset it from the sign-in page.","security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordRequest"}}}},"responses":{"200":{"description":"Set. Sign in with it from now on.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordSet"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"password_already_set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/pending-bet":{"delete":{"tags":["me"],"summary":"Drop your onboarding bet","description":"The bet chosen during onboarding, once placed through `POST /markets/{id}/orders` or declined. Idempotent.","security":[{"session":[]}],"responses":{"204":{"description":"Dropped (or there was none)."},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"session_required: called with an API token. These endpoints never accept one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/onboarding":{"post":{"tags":["onboarding"],"summary":"Sign up by choosing a bet","description":"The one way to sign up. Makes a name-less, password-less user for an address at an approved institution and mails it a confirmation link and code. The bet is stored, not placed: no account exists until the address is confirmed. After confirming, the person gives a name (`PATCH /me`) and a password (`POST /me/password`) and the bet is placed like any order, at the price then. Answers the same whether or not the address already has an account; a confirmed one is mailed a sign-in link instead, and the bet is placed when it signs in. Five mails a day per address.","security":[{},{"bearer":[]},{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingRequest"}}}},"responses":{"200":{"description":"The mail is on its way.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpStarted"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: a token was sent and it is invalid. (No token at all is fine.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no such market or outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"market_not_open | market_closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"email_domain_not_allowed: the domain is not on the institution allowlist, or the address has a +tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many sign-up mails to this address. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/markets/{id}/close":{"post":{"tags":["admin"],"summary":"Close a market to trading","description":"Idempotent.","security":[{"bearer":["admin"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"}],"responses":{"200":{"description":"The market.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"admin\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/markets/{id}/settle":{"post":{"tags":["admin"],"summary":"Settle a market","description":"Pays 1 unit per winning share and 0 otherwise. Idempotent: repeating the same settlement is a no-op returning 200; naming a different winner after settlement is `409 market_already_settled`.","security":[{"bearer":["admin"]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The market’s id (uuid) or its slug.","example":"example-binary"},"required":true,"description":"The market’s id (uuid) or its slug.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettleRequest"}}}},"responses":{"200":{"description":"The settled market.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"400":{"description":"validation_error: the request did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, malformed or revoked token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden: the token lacks the \"admin\" scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: no such market or outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"market_already_settled | invalid_market","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: this token’s bucket is empty. See Retry-After.","headers":{"X-RateLimit-Limit":{"description":"Bucket size, in requests.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the bucket is full.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}