{"openapi":"3.1.0","info":{"title":"clubsandwich lists","description":"Curated and algorithmic lists for clubsandwich, a private-server reimplementation of the\nRec Room backend. A discovery page is built from these: the `discovery` worker says\nwhich carousels a page has, and this worker says what is in them.\n\nTwo kinds of list. A CURATED list is named — either a static capture of a page’s row\nset, or a player’s own playlist in D1 (`__SavedForLater_Rooms`, the Play menu’s\n“Saved for Later”). An ALGORITHMIC list is a ranking asked for by row slug: the hot,\nrecently-updated and new feeds, the room categories, and the caller’s own recently\nvisited rooms.\n\nOnly IDS travel. Every list answers ids the client resolves against the `rooms` and\n`commerce` workers itself, which is why a list carries a `Type` saying what its ids\nARE — answering with a type the caller didn’t ask for would have it look the ids up\nagainst the wrong service.\n\nA row with nothing behind it answers an empty 200 rather than a 404: the client\nrenders a failed row for an error and hides an empty one, and an empty carousel is\nthe honest answer for a ranking this server has nothing for.\n\nReads are unauthenticated — the client names the owner rather than proving it, and a\nlist is only ever ids. Writing needs a token, since the list written into is the\ncaller’s own.","version":"1.0.0"},"servers":[{"url":"https://lists.clubsandwich.dev","description":"Production"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"An `access_token` from the auth worker’s `POST /connect/token`."}}},"paths":{"/":{"get":{"operationId":"getIndex","tags":["Service"],"summary":"Health check","description":"Liveness probe for the lists worker. No auth; the body is plain text.","responses":{"200":{"description":"Service is up","content":{"text/plain":{"schema":{"type":"string","example":"hello, world!"}}}}}}},"/curatedlists/bulk":{"get":{"operationId":"getCuratedlistsBulk","tags":["Lists","2025"],"summary":"Curated lists by id","description":"A set of curated lists, asked for by repeating `?id=`. Nothing curates lists here yet,\nso this serves ONE canned list whatever is asked for — an unknown id included, because\na 404 shows as a row that failed to load rather than one the client hides.\n\nThe canned list is shaped the way the client parses one: `ItemIds` are strings rather\nthan numbers, `Description` may be null, and `ImageName` has to be a string — the\nclient reads it straight into a string field.","parameters":[{"name":"id","in":"query","required":false,"description":"A list id to look up, repeated once per list wanted. Ignored today — the canned list is served whatever is asked for, an unknown id included, because a 404 renders as a row that failed to load rather than one the client hides.","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}},"example":["17859340"]}],"responses":{"200":{"description":"The canned list, as a one-element array","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"ListId":{"type":"number","description":"64-bit; 0 on an unowned reserved list, since nothing was stored to have an id"},"CreatorAccountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The owner; echoed from the query on a reserved list","example":12345},"Name":{"type":"string"},"Description":{"anyOf":[{"type":"string"},{"type":"null"}]},"ImageName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A STRING on any list the client draws a tile for — it reads this straight into a string field, and empty or null renders that tile blank. `DefaultRoomImage.jpg` where nothing set one. Null only on a list with no tile to draw, like the `RoomGenreTags` capture, whose items are genre names rather than rooms."},"Type":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The `ListEntityType` — what the `ItemIds` are","example":12345},"ItemIds":{"type":"array","items":{"type":"string"},"description":"Strings even where they stand for numeric ids, in the order they were added — which is the order the row displays them."},"CreatedAt":{"type":"string","description":"ISO-8601 UTC"},"Accessibility":{"description":"The `Accessibility` enum — 0 Private · 1 Public (its Unlisted/Dev members exist but nothing sets one on a list). Carried by every list the read serves, stored or captured; absent from the canned bulk list and from the save’s response.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"example":12345}},"required":["ListId","CreatorAccountId","Name","Description","ImageName","Type","ItemIds","CreatedAt"]}}}}}}}},"/curatedlists":{"get":{"operationId":"getCuratedlists","tags":["Lists","2025"],"summary":"One curated list","description":"ONE list object — not a collection — asked for with the same three parameters whether\nthe client wants a discovery PAGE’s row set or a PLAYER’s own playlist:\n\n- A page’s rows are a static capture in `static/curated-lists.json`, whose `ItemIds`\n  are the discovery section keys the page is built from (not room ids).\n- A player’s playlist lives in D1, in the `list` / `list_item` tables this worker owns.\n  `__SavedForLater_Rooms` is the one the client creates for itself — the Play menu’s\n  “Saved for Later” row, asked for with the player’s own id and `type=1` (Rooms), so its\n  `ItemIds` are room ids.\n\nD1 is asked FIRST, so a player’s own list wins over a capture that happens to share its\nname: the captures are this server’s fixtures and a player’s list is their data.\n\nNot auth-gated — the client names the owner rather than proving it, `Accessibility` is a\nproperty of the list rather than of the reader, and the answer is only ever ids the\nclient then resolves itself.\n\nA name matching NEITHER answers an EMPTY PLACEHOLDER: a whole list object echoing the\nname and `type` asked for, with no `ItemIds`. The client breaks on anything that is\nnot a list, so a miss cannot be `{}` or a 404; and answering it with an unrelated\ncapture would put one page’s rows under another page’s heading, which reads as real\ncontent. The two exceptions resolve to real lists rather than placeholders — a\nreserved `__` playlist nobody owns yet, and a request naming no list at all, which\ngets the page default for its `type`.","parameters":[{"name":"creatorAccountId","in":"query","required":false,"description":"Who owns the list. Matched exactly against a stored list, and used as the most specific key against the static captures — a creator nothing owns falls back to matching on type and name. Echoed back on an unowned reserved list, so the client still sees the list it asked for.","schema":{"type":"integer","example":42}},{"name":"type","in":"query","required":false,"description":"The `ListEntityType` — what the list’s `ItemIds` are: 0 Accounts · 1 Rooms · 2 Inventions · 3 CustomAvatarItems · 4 PurchasableItems · 5 Generic · 6 ChipAndPort · 7 DiscoverySection · 8 DiscoverySectionSubType. Part of a list’s identity, not a filter: `__SavedForLater_Rooms` is asked for with `type=1` (its items are room ids) while every static capture is `type=7` (its items are discovery section keys).","schema":{"type":"integer","example":1}},{"name":"name","in":"query","required":false,"description":"The list’s name, matched case-insensitively (the casing that arrives is the client’s). Naming NO list asks for the page default for `type`; naming one that matches nothing is a 404, unless it is one of the client’s own reserved `__` playlists, which answers empty.","schema":{"type":"string","example":"__SavedForLater_Rooms"}}],"responses":{"200":{"description":"The list, or an empty placeholder when there is no such list","content":{"application/json":{"schema":{"type":"object","properties":{"ListId":{"type":"number","description":"64-bit; 0 on an unowned reserved list, since nothing was stored to have an id"},"CreatorAccountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The owner; echoed from the query on a reserved list","example":12345},"Name":{"type":"string"},"Description":{"anyOf":[{"type":"string"},{"type":"null"}]},"ImageName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A STRING on any list the client draws a tile for — it reads this straight into a string field, and empty or null renders that tile blank. `DefaultRoomImage.jpg` where nothing set one. Null only on a list with no tile to draw, like the `RoomGenreTags` capture, whose items are genre names rather than rooms."},"Type":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The `ListEntityType` — what the `ItemIds` are","example":12345},"ItemIds":{"type":"array","items":{"type":"string"},"description":"Strings even where they stand for numeric ids, in the order they were added — which is the order the row displays them."},"CreatedAt":{"type":"string","description":"ISO-8601 UTC"},"Accessibility":{"description":"The `Accessibility` enum — 0 Private · 1 Public (its Unlisted/Dev members exist but nothing sets one on a list). Carried by every list the read serves, stored or captured; absent from the canned bulk list and from the save’s response.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"example":12345}},"required":["ListId","CreatorAccountId","Name","Description","ImageName","Type","ItemIds","CreatedAt"]}}}}}}},"/curatedlists/{name}/items/{itemId}/createlistifneeded":{"put":{"operationId":"putCuratedlistsByNameItemsByItemIdCreatelistifneeded","tags":["Lists","2025"],"summary":"Save an item into the caller’s list","description":"Saves an item into one of the caller’s own lists, creating the list when they have none\nby that name — what the client calls when someone saves a room for later. The path names\nthe list and the item; the form body carries `accessibility` and `type`, both of which\napply only on creation.\n\nAUTH-GATED, and the owner is the TOKEN’s account: unlike the read, this call names no\n`creatorAccountId`, so the only account it could mean is the caller’s — and taking an\nowner from the client would let anyone write into anyone’s list.\n\nAnswers the list as it now stands rather than an acknowledgement, so the row the client\nre-renders is the one this call just changed. Saving the same item twice leaves it in\nthe list once.\n\nThe response drops `Accessibility`, which the read keeps. That is a real difference in\nwhat the client is sent, not an oversight — every other key, and their order, is the\nread’s.","security":[{"bearerAuth":[]}],"parameters":[{"name":"name","in":"path","required":true,"description":"The caller’s list to save into, created if they have none by that name. `__SavedForLater_Rooms` is the one the client creates for itself — the Play menu’s “Saved for Later” row.","schema":{"type":"string","example":"__SavedForLater_Rooms"}},{"name":"itemId","in":"path","required":true,"description":"The item to save, as a string — a room id for the room lists the client builds this way. Saving the same item twice leaves it in the list once.","schema":{"type":"string","example":"953"}}],"requestBody":{"description":"Applied only when the list is created","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"type":{"description":"The `ListEntityType` the list is created with (integer, as text). Rooms (1) when absent — every list the client creates this way is a room list, and the type is part of the list’s identity, so another value would strand it where the client’s own `?type=1` read can’t find it.","type":"string"},"accessibility":{"description":"The `Accessibility` enum — 0 Private · 1 Public (integer, as text). PRIVATE when absent: a list a player builds for themselves is theirs to see, and the client sends `accessibility=0`. Applied only on creation — a later save leaves an existing list’s accessibility alone.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"type":{"description":"The `ListEntityType` the list is created with (integer, as text). Rooms (1) when absent — every list the client creates this way is a room list, and the type is part of the list’s identity, so another value would strand it where the client’s own `?type=1` read can’t find it.","type":"string"},"accessibility":{"description":"The `Accessibility` enum — 0 Private · 1 Public (integer, as text). PRIVATE when absent: a list a player builds for themselves is theirs to see, and the client sends `accessibility=0`. Applied only on creation — a later save leaves an existing list’s accessibility alone.","type":"string"}}}}}},"responses":{"200":{"description":"The list as it now stands, without `Accessibility`","content":{"application/json":{"schema":{"type":"object","properties":{"ListId":{"type":"number","description":"64-bit; 0 on an unowned reserved list, since nothing was stored to have an id"},"CreatorAccountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The owner; echoed from the query on a reserved list","example":12345},"Name":{"type":"string"},"Description":{"anyOf":[{"type":"string"},{"type":"null"}]},"ImageName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A STRING on any list the client draws a tile for — it reads this straight into a string field, and empty or null renders that tile blank. `DefaultRoomImage.jpg` where nothing set one. Null only on a list with no tile to draw, like the `RoomGenreTags` capture, whose items are genre names rather than rooms."},"Type":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The `ListEntityType` — what the `ItemIds` are","example":12345},"ItemIds":{"type":"array","items":{"type":"string"},"description":"Strings even where they stand for numeric ids, in the order they were added — which is the order the row displays them."},"CreatedAt":{"type":"string","description":"ISO-8601 UTC"}},"required":["ListId","CreatorAccountId","Name","Description","ImageName","Type","ItemIds","CreatedAt"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/algorithmiclists/{list}":{"get":{"operationId":"getAlgorithmiclistsByList","tags":["Lists","2025"],"summary":"One discovery row’s contents","description":"The entities that fill one discovery row. `{list}` is the row key a curated page lists\nin its `ItemIds` (e.g. `Rooms_Battle_AlgoEndpoint_PlayHighlight_TabsTest_Explore`), and\nonly the IDS travel — the client resolves each room or item itself.\n\n`HotList`, `recentlyupdated` and `new` are ranked live off the same room tables the\n`rooms` worker’s browse feeds read, so a row and its feed can’t disagree. The\n`*_algoendpoint` category rows serve the public rooms carrying one tag, busiest first.\n`recentlyvisited` is per-caller and is the one row that reads the token; without one it\nanswers EMPTY rather than 401ing, since canned rooms would claim the caller visited\nrooms they never did — and an empty carousel is what a brand-new account legitimately\nhas. A couple of store rows are hand-picked id lists.\n\nEvery other row — an unknown key included — answers an EMPTY 200 rather than a 404,\nwhich the client renders as a row that failed to load instead of one it hides.\n\n`?type=5` (Generic) is answered by the TYPE rather than by the slug, because a Generic\nrow’s ids are `<prefix>.<id>` composites — exactly one dot, `0.<int>` a purchasable\nitem and `1.<guid>` a custom avatar item — that the client resolves one at a time.\nIt serves every sellable `1.<guid>` first-party custom avatar item from the\n`custom_avatar_item` table (the Coach’s, published, priced — 0 included), since\na random handful left most of the archive catalog unreachable. The store’s\n`UnifiedAlgorithmicList` sections ask for these, and the SLUG picks the slot by\n`OutfitType`: `headwearitems` hats,\n`topsitems` shirts and team jerseys, `handsitems` wrists, `hairitems` hair,\n`facialhairitems` beards, `waistitems` waist, `accessoriesitems` ears/eyes/neck,\n`footwearitems` feet, `bottomsitems` legs, `shoulderitems` shoulders, `roomieitems`\nthe Roomie’s slots (500 and up). Any other slug draws every slot but the Roomie’s.\nThe `creationfactorynew` / `creationfactoryshirts` / `creationfactory3d` slugs instead\nserve the newest 200 published archived player-made items filed under the\nCreationFactory account (3): every wearable slot, custom shirts only, and everything\nbut custom shirts respectively; `creationfactoryheadwear` / `creationfactoryhair` /\n`creationfactorytops` / … (each slot slug above minus its `items` suffix) take that\nslot’s outfit types.\n`?type=4` (PurchasableItems) serves the `catalog` table instead, with BARE\n`catalog_id`s: a typed row’s `Type` already says what its ids are, so only a Generic\nrow needs the prefix. There the SLUG picks what is drawn: `skinsitems` returns\nequipment skins, and `headwearitems` / `topsitems` / `handsitems` / `hairitems` /\n`facialhairitems` / `waistitems` / `accessoriesitems` / `footwearitems` /\n`bottomsitems` / `shoulderitems` return avatar items whose names contain one of that row’s words —\n“hat”, “shirt”/“jacket”/“dress”, “glove”/“hand”/“wrist”, “hair”,\n“beard”/“mustache”, “belt”,\n“earrings”/“hearing aids”, “shoes”/“sneakers”/“sandals”/“boots”, “pants”/“shorts”,\n“quiver”/“backpack”/“sword”. Every other row returns the whole avatar-item catalog.\nThe name match is a stand-in — the catalog records no\ncategory — so it takes anything the word appears in.","parameters":[{"name":"list","in":"path","required":true,"description":"The row key, matched case-insensitively. `HotList`, `recentlyupdated` and `new` are ranked for real; `recentlyvisited` is per-caller; the seven `*_algoendpoint` category rows serve the public rooms carrying one tag; `summerpartycarousel` and `newitems` are hand-picked store ids. Every other key — an unknown one included — answers an empty row with a 200.","schema":{"type":"string","example":"HotList"}},{"name":"type","in":"query","required":false,"description":"The `ListEntityType` the caller wants the row’s ids read as, ECHOED back on the response — it tells the client which service to resolve the ids against. A BYTE on the client, so a value outside 0–255 (or none at all) is answered with 1, Rooms, which is what the client always asks for. 4 (PurchasableItems) and 5 (Generic) are answered by the type rather than by the row — see the endpoint’s description.","schema":{"type":"integer","minimum":0,"maximum":255,"example":1}}],"responses":{"200":{"description":"The row’s entities, possibly none","content":{"application/json":{"schema":{"type":"object","properties":{"Type":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The `ListEntityType`, echoed from `?type=` — see the parameter","example":12345},"Entities":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"string","description":"The room/item id the client resolves itself. On a GENERIC row (`type=5`) it is instead a `<prefix>.<id>` composite with EXACTLY ONE dot — `0.<int>` a purchasable item, `1.<guid>` a custom avatar item — since such a row can name things of more than one sort. The store rows serve `1.<guid>`, the `CustomAvatarItemId` of a first-party item. The integer after `0.` is a `catalog_id`, which for a listed item is its store `PurchasableItemId` — the number `sf3-2025.json` sells it under."},"Context":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ranking attribution; always null here"}},"required":["Id","Context"]},"description":"Empty for a row with nothing behind it"}},"required":["Type","Entities"]}}}}}}},"/contextualfeatures":{"post":{"operationId":"postContextualfeatures","tags":["Lists","2025"],"summary":"Acknowledge a contextual-features post","description":"The client posts the context it is in and reads back whether the call was accepted.\nAuth-gated, and the answer is a bare `{ success, error_id, error }` with no payload:\nthe reference server acknowledges the post and carries nothing back, so there is\nnothing here to serve beyond the acknowledgement itself. The body is read for the log\nonly.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"error_id":{"type":"null"},"error":{"type":"null"}},"required":["success","error_id","error"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}}}}