{"openapi":"3.1.0","info":{"title":"Gizmo Data API","version":"1.0.0","description":"HTTP operations. WebSocket channels use an upgrade handshake and are documented separately."},"externalDocs":{"description":"Realtime WebSocket APIs","url":"/data/docs/realtime"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{},"parameters":{}},"paths":{"/data/activity/v1/me/totals":{"get":{"operationId":"getActivityTotals","tags":["Activity"],"summary":"Get viewer activity totals","description":"Sums cards answered and tutor messages sent by the authenticated viewer across the inclusive calendar-date range.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"date"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"endDate","in":"query"}],"responses":{"200":{"description":"The viewer activity total for the inclusive date range","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","minimum":0}},"required":["total"]}}}},"400":{"description":"Invalid activity date range","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Activity Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The activity data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["ACTIVITY_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/ai-chats/v1":{"get":{"operationId":"listAiChats","tags":["AI Chats"],"summary":"List AI chat summaries","deprecated":true,"description":"Deprecated compatibility endpoint for legacy pre-Durable-Object AI chat records used by Jump Back In. New clients should use the AI Tutor activity APIs. Returns accessible AI chats in first-requested-ID order. Duplicate IDs are collapsed to their first occurrence and missing or inaccessible IDs are omitted. Accepts between 1 and 100 repeated chatId parameters.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"array","items":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"minItems":1,"maxItems":100},"required":true,"name":"chatId","in":"query"}],"responses":{"200":{"description":"The accessible requested AI chat summaries","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"chatId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"completed":{"type":["boolean","null"]},"completedPercentage":{"type":["number","null"]}},"required":["chatId","name","completed","completedPercentage"]}}},"required":["items"]}}}},"400":{"description":"Invalid AI chat ids","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many AI Chat Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The AI chat data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AI_CHATS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/defaults":{"get":{"operationId":"getDeckDefaults","tags":["Decks"],"summary":"Get deck creation defaults","description":"Loads the authenticated viewer's country and current education settings used to prefill deck creation. Returns the viewer's school course and institution type when available.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Viewer defaults used while creating a deck","content":{"application/json":{"schema":{"type":"object","properties":{"viewer":{"type":["object","null"],"properties":{"userId":{"type":"integer","exclusiveMinimum":0},"country":{"type":["string","null"]},"education":{"type":["object","null"],"properties":{"schoolCourse":{"type":["string","null"]},"institutionType":{"type":["string","null"]}},"required":["schoolCourse","institutionType"]}},"required":["userId","country","education"]}},"required":["viewer"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_METADATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/{deckId}/tags":{"get":{"operationId":"getDeckTags","tags":["Decks"],"summary":"Get tags for a deck","description":"Loads the tags attached to the requested deck. Returns their display names for use in deck editing.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"deckId","in":"path"}],"responses":{"200":{"description":"Tags attached to the requested deck","content":{"application/json":{"schema":{"type":["object","null"],"properties":{"tags":{"type":"array","items":{"type":"string"}}},"required":["tags"]}}}},"400":{"description":"Invalid deck id","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_METADATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/{deckId}/descendants":{"get":{"operationId":"getDeckDescendants","tags":["Decks"],"summary":"Get a deck hierarchy","description":"Loads the requested deck and every descendant the authenticated viewer can access. Returns a flattened list of deck IDs, names, and colours.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"deckId","in":"path"},{"schema":{"type":"string","enum":["visible","edit"],"default":"visible"},"required":false,"name":"access","in":"query"}],"responses":{"200":{"description":"The requested deck and its viewer-accessible descendants","content":{"application/json":{"schema":{"type":"object","properties":{"deck":{"type":["object","null"],"properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["deckId","name","colour"]},"descendants":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["deckId","name","colour"]}}},"required":["deck","descendants"]}}}},"400":{"description":"Invalid deck id or access mode","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_DESCENDANTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1":{"get":{"operationId":"listDecks","tags":["Decks"],"summary":"List the viewer's decks","description":"Lists decks available to the authenticated viewer using search, child-deck, archive, and permission filters. Results use offset pagination ordered by newest permission first, then deck ID descending. A full page returns a next offset even when that next page is empty.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"boolean","default":false},"required":false,"name":"includeChildDecks","in":"query"},{"schema":{"type":"boolean","default":false},"required":false,"name":"includeStudyPathProgress","in":"query"},{"schema":{"type":"boolean","default":false},"required":false,"name":"archived","in":"query"},{"schema":{"type":"array","items":{"type":"string","enum":["viewer","editor","owner"]},"default":["viewer","editor","owner"]},"required":false,"name":"permissions","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"The viewer's decks matching the requested filters","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"archived":{"type":"boolean"},"studyPathProgress":{"type":["number","null"],"minimum":0,"maximum":1},"permission":{"type":"string","enum":["viewer","editor","owner"]},"deck":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"active":{"type":"boolean"},"name":{"type":["string","null"]},"colour":{"type":["string","null"]},"sourceDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"createdAt":{"type":["string","null"],"format":"date-time"},"ownerId":{"type":"integer","exclusiveMinimum":0},"cardCount":{"type":["integer","null"],"minimum":0},"cardAttributeCount":{"type":["integer","null"],"minimum":0},"descendantCardCount":{"type":["integer","null"],"minimum":0},"owner":{"type":["object","null"],"properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]}},"required":["userId","firstName","lastName","profilePicture"]}},"required":["deckId","active","name","colour","sourceDeckId","createdAt","ownerId","cardCount","cardAttributeCount","descendantCardCount","owner"]}},"required":["archived","studyPathProgress","permission","deck"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid deck list filters","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_LIST_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/onboarding-friends":{"get":{"operationId":"getOnboardingFriendsDecks","tags":["Decks"],"summary":"Decks followed people recently earned XP on","description":"Returns up to three public decks per requested user that they earned more than 100 XP on in the last 14 days. The caller passes the user ids they just followed. The query is limited to those ids.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"userIds","in":"query"}],"responses":{"200":{"description":"Recent high-XP decks for the requested users","content":{"application/json":{"schema":{"type":"object","properties":{"friends":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"decks":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"title":{"type":"string"},"colour":{"type":["string","null"]},"cardCount":{"type":"integer","minimum":0},"tags":{"type":"array","items":{"type":"string"}}},"required":["deckId","title","colour","cardCount","tags"]},"maxItems":3}},"required":["userId","decks"]}}},"required":["friends"]}}}},"400":{"description":"Invalid user id list","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The friends deck source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["ONBOARDING_FRIENDS_DECKS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/quizzable":{"get":{"operationId":"listQuizzableDecks","tags":["Decks"],"summary":"List decks available for quizzing","description":"Lists non-archived decks with quiz-ready cards, ordered by the viewer’s recent quiz activity. Results use offset pagination and can be restricted to top-level decks or to the decks nested under one deck.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":300},"required":false,"name":"query","in":"query"},{"schema":{"type":"boolean","default":false},"required":false,"name":"topLevelOnly","in":"query"},{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":false,"name":"parentDeckId","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":35},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Decks available to the viewer for starting a quiz","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"depth":{"type":"integer","minimum":0},"colour":{"type":["string","null"]},"parentDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"permission":{"type":"string","enum":["viewer","editor","owner"]},"logoUrl":{"type":["string","null"]},"active":{"type":"boolean"},"public":{"type":"boolean"},"isDraft":{"type":"boolean"},"hasDraftCards":{"type":"boolean"},"importStatus":{"type":["object","null"],"properties":{"taskId":{"type":["string","null"]},"status":{"type":"string","enum":["Success","Failed","Processing","Standby"]},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["taskId","status","createdAt"]},"parentDeckPath":{"type":["array","null"],"items":{"type":"string"}},"parentDeckIdPath":{"type":["array","null"],"items":{"type":"integer","exclusiveMinimum":0}},"cardCount":{"type":"integer","minimum":0},"dueCardCount":{"type":"integer","minimum":0},"childCardCount":{"type":"integer","minimum":0},"publicChildCardCount":{"type":"integer","minimum":0},"studyPathProgress":{"type":["number","null"],"minimum":0,"maximum":1},"sourceDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"createdAt":{"type":["string","null"],"format":"date-time"},"lastQuizzedAt":{"type":["string","null"],"format":"date-time"},"course":{"type":["object","null"],"properties":{"classId":{"type":"integer","exclusiveMinimum":0},"qualificationUnitId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"authority":{"type":["string","null"]},"emoji":{"type":"string","minLength":1},"emojiColour":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":0},"educationalInstitutionId":{"type":["integer","null"],"exclusiveMinimum":0},"displayTags":{"type":"array","items":{"type":"string"}},"lifecycleStatus":{"type":"string","enum":["pending","needs_user_input","unverified","accepted","rejected"]}},"required":["classId","qualificationUnitId","name","code","authority","emoji","emojiColour","memberCount","educationalInstitutionId","displayTags","lifecycleStatus"]},"qualificationUnit":{"type":["object","null"],"properties":{"classId":{"type":"integer","exclusiveMinimum":0},"qualificationUnitId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"authority":{"type":["string","null"]},"emoji":{"type":"string","minLength":1},"emojiColour":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":0},"educationalInstitutionId":{"type":["integer","null"],"exclusiveMinimum":0},"displayTags":{"type":"array","items":{"type":"string"}},"lifecycleStatus":{"type":"string","enum":["pending","needs_user_input","unverified","accepted","rejected"]}},"required":["classId","qualificationUnitId","name","code","authority","emoji","emojiColour","memberCount","educationalInstitutionId","displayTags","lifecycleStatus"]}},"required":["deckId","name","depth","colour","parentDeckId","permission","logoUrl","active","public","isDraft","hasDraftCards","importStatus","parentDeckPath","parentDeckIdPath","cardCount","dueCardCount","childCardCount","publicChildCardCount","studyPathProgress","sourceDeckId","createdAt","lastQuizzedAt","course","qualificationUnit"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid quizzable deck filters","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The quizzable deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_QUIZZABLE_LIST_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/shortcuts":{"get":{"operationId":"listDeckShortcuts","tags":["Decks"],"summary":"List decks for shortcut pickers","description":"Loads top-level decks and their descendants for native shortcut and destination pickers. Top-level decks use offset pagination ordered by newest permission first, then deck ID for deterministic ties; descendants retain hierarchy order. A full page returns a next offset even when that next page is empty.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"array","items":{"type":"string","enum":["viewer","editor","owner"]},"default":["viewer","editor","owner"]},"required":false,"name":"permissions","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Top-level decks and descendants used by deck shortcuts","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"colour":{"type":["string","null"]},"active":{"type":"boolean"},"parentDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"permission":{"type":"string","enum":["viewer","editor","owner"]},"descendants":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"colour":{"type":["string","null"]},"parentDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"ownerId":{"type":"integer","exclusiveMinimum":0}},"required":["deckId","name","colour","parentDeckId","ownerId"]}}},"required":["deckId","name","colour","active","parentDeckId","permission","descendants"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid deck shortcut filters","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_SHORTCUTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/duplicate-status":{"get":{"operationId":"getDeckDuplicateStatus","tags":["Decks"],"summary":"Check deck duplication progress","description":"Checks whether any of the requested deck IDs is currently being duplicated for the authenticated viewer. Returns one boolean status.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"array","items":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"minItems":1,"maxItems":500},"required":true,"name":"deckIds","in":"query"}],"responses":{"200":{"description":"Whether any requested deck is currently being duplicated","content":{"application/json":{"schema":{"type":"object","properties":{"hasActiveDuplication":{"type":"boolean"}},"required":["hasActiveDuplication"]}}}},"400":{"description":"Invalid deck ids","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_DUPLICATE_STATUS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/premade-courses":{"get":{"operationId":"listPremadeDeckCourses","tags":["Decks"],"summary":"List premade-deck courses","description":"Finds premade-deck courses matching the requested course names for the authenticated viewer. Results use offset pagination ordered by course name ascending, choosing the newest ID for duplicate names. A full page returns a next offset even when that next page is empty.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"required":true,"name":"courseNames","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Premade deck courses matching the requested names","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"courseId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"premadeDeckId":{"type":["integer","null"],"exclusiveMinimum":0}},"required":["courseId","name","premadeDeckId"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid course names","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_COURSES_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/courses/{courseId}/units":{"get":{"operationId":"listDeckCourseUnits","tags":["Decks"],"summary":"List units in a deck course","description":"Loads units belonging to the requested premade-deck course. Results use offset pagination ordered by unit name ascending, choosing the newest ID for duplicate names. A full page returns a next offset even when that next page is empty.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"courseId","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Units belonging to the requested course","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"courseId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"premadeDeckId":{"type":["integer","null"],"exclusiveMinimum":0}},"required":["courseId","name","premadeDeckId"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid course id","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_COURSES_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/decks/v1/{deckId}/notes":{"get":{"operationId":"getDeckNotes","tags":["Decks"],"summary":"List study notes for a deck","description":"Loads active study-note summaries attached to the requested deck for the authenticated viewer. Results use offset pagination ordered by study-note ID descending. A full page returns a next offset even when that next page is empty.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"deckId","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Active study-note summaries attached to the deck","content":{"application/json":{"schema":{"type":"object","properties":{"permission":{"anyOf":[{"type":"string","enum":["view","edit"]},{"type":"null"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"noteId":{"type":"string","minLength":1},"deckId":{"type":["integer","null"]},"title":{"type":["string","null"]},"preview":{"type":["string","null"]}},"required":["noteId","deckId","title","preview"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["permission","items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid deck notes request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Deck Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The deck data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_NOTES_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/deck-previews/v1/{deckId}/study-state":{"get":{"operationId":"getDeckPreviewStudyState","tags":["Deck previews"],"summary":"Load authenticated study state for deck preview continuation","description":"Returns next-due, last-tested, progression, previously-correct, and card-quality inputs for exactly three preview cards the verified user can access after share acceptance.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"deckId","in":"path"},{"schema":{"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},"required":true,"name":"cardIds","in":"query"}],"responses":{"200":{"description":"Study state keyed by card ID","content":{"application/json":{"schema":{"type":"object","properties":{"cards":{"type":"object","additionalProperties":{"type":"object","properties":{"nextDue":{"type":"object","properties":{"value":{"type":"object","additionalProperties":{"type":"object","properties":{"newSpacing":{"type":"number"},"nextDueDate":{"type":"string","format":"date"},"nextDueTimestamp":{"type":"string","format":"date-time"},"easeFactor":{"type":"number"},"probabilityCorrect":{"type":["number","null"]},"previouslyCorrect":{"type":["boolean","null"]},"previouslyNeededHelp":{"type":["boolean","null"]}},"required":["newSpacing","nextDueDate","nextDueTimestamp","easeFactor","probabilityCorrect","previouslyCorrect","previouslyNeededHelp"]}}},"required":["value"]},"lastTestedAt":{"type":["string","null"],"format":"date-time"},"previouslyCorrect":{"type":["boolean","null"]},"progression":{"type":"string","enum":["NEW","FORGOTTEN","LEARNING","LEARNING_RETRY","READY_TO_MASTER","READY_TO_MASTER_RETRY","MASTERED"]},"quality":{"type":["integer","null"]}},"required":["nextDue","lastTestedAt","previouslyCorrect","progression","quality"]}}},"required":["cards"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study state not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"Upstream unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_PREVIEW_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/deck-previews/v1/{deckId}":{"get":{"operationId":"getDeckPreview","tags":["Deck previews"],"summary":"Load a three-question anonymous deck preview","description":"Returns three locally gradeable questions and member-visible standings for a shareable or public deck. The share password is sent as X-Gizmo-Deck-Share-Password, never in the query string.","security":[],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"deckId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":false,"name":"permissionId","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":false,"name":"ownerId","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":false,"name":"senderUserId","in":"query"},{"schema":{"type":"string","maxLength":256},"required":false,"name":"x-gizmo-deck-share-password","in":"header"}],"responses":{"200":{"description":"Deck preview material","content":{"application/json":{"schema":{"type":"object","properties":{"deck":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"colour":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["deckId","name","colour","logoUrl"]},"questions":{"type":"array","items":{"type":"object","properties":{"cardId":{"type":"integer","exclusiveMinimum":0},"questionFormat":{"type":"string","minLength":1},"segmentIndex":{"type":["integer","null"],"minimum":0},"prompt":{"type":"string","minLength":1},"media":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":0},"markdown":{"type":"string","minLength":1}},"required":["id","markdown"]},"minItems":2},"correctOptionId":{"type":"integer","minimum":0}},"required":["cardId","questionFormat","segmentIndex","prompt","media","options","correctOptionId"]},"maxItems":3},"leaderboard":{"type":"array","items":{"type":"object","properties":{"displayName":{"type":"string","minLength":1},"avatarUrl":{"type":["string","null"]},"xp":{"type":"integer"},"rank":{"type":"integer","exclusiveMinimum":0},"isSender":{"type":"boolean"}},"required":["displayName","avatarUrl","xp","rank"]},"maxItems":10},"schoolName":{"type":["string","null"]},"schoolDeckStudentCount":{"type":["integer","null"],"minimum":0},"classmatesOnGizmo":{"type":["integer","null"],"minimum":0}},"required":["deck","questions","leaderboard"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Deck preview inaccessible. Distinct codes (NOT_FOUND, DECK_PREVIEW_PASSWORD_REQUIRED, DECK_PREVIEW_BAD_PASSWORD, DECK_PREVIEW_DELETED) feed warehouse-only Clip analytics; treat any 404 as inaccessible.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["DECK_PREVIEW_PASSWORD_REQUIRED"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["DECK_PREVIEW_BAD_PASSWORD"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["DECK_PREVIEW_DELETED"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"422":{"description":"Authorized deck cannot produce three preview questions","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_PREVIEW_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"Upstream unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["DECK_PREVIEW_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/qualifications":{"get":{"operationId":"listEducationQualifications","tags":["Education"],"summary":"List qualifications for anonymous catalogue browsing","description":"Lists qualifications without requiring authentication. A GB institution is searched first; an empty institution page falls back to the non-deprecated US degree catalogue at the same offset. A full page indicates possible continuation, so the next page may be empty.","security":[],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":2},"required":false,"name":"countryCode","in":"query"},{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":false,"name":"institutionId","in":"query"},{"schema":{"type":["string","null"],"maxLength":100,"default":""},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":40},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A name-ordered page of qualifications","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]}},"required":["id","name","code"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/academic-years":{"get":{"operationId":"listEducationAcademicYears","tags":["Education"],"summary":"List academic years","description":"Lists academic years for an institution type and optional supported country. Omitting the country selects the global catalogue.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"institutionType","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":2},"required":false,"name":"countryCode","in":"query"}],"responses":{"200":{"description":"Academic years matching the requested catalogue","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"countryCode":{"type":["string","null"]},"displayName":{"type":["string","null"]},"institutionType":{"type":["string","null"]}},"required":["id","countryCode","displayName","institutionType"]}}},"required":["items"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/majors":{"get":{"operationId":"listEducationMajors","tags":["Education"],"summary":"List institution majors","description":"Lists or searches majors via the Python backend. institutionId is optional: with an institution, empty search uses popularity counts (falling back to the shared catalogue when the institution has none); without one, results come from the country/level catalogue then global US degrees. Non-empty search always uses that catalogue probe and applies the same US nursing expand + classes attachment as popular-majors.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":false,"name":"institutionId","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":2},"required":false,"name":"countryCode","in":"query"},{"schema":{"type":["string","null"],"maxLength":100,"default":""},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":40},"required":false,"name":"limit","in":"query"},{"schema":{"type":["string","null"],"minLength":2,"maxLength":2},"required":false,"name":"region","in":"query"}],"responses":{"200":{"description":"A page of majors","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"classes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"code":{"type":["string","null"]},"officialDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"subjects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"subjects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"subjects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"}},"required":["id","name"]},"default":[]}},"required":["id","name"]},"default":[]}},"required":["id","name"]},"default":[]}},"required":["id","name"]},"default":[]}},"required":["id","name","code"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/institutions/{institutionId}/popular-majors":{"get":{"operationId":"listEducationPopularMajors","tags":["Education"],"summary":"List popular majors at an institution","description":"Lists majors selected by users at the requested institution, ordered by popularity. Sourced from educational_institution_qualification_counts via the Python backend. Optional query searches the degree catalogue with the same nursing expand as listEducationMajors.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"institutionId","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":30},"required":false,"name":"limit","in":"query"},{"schema":{"type":["string","null"],"minLength":2,"maxLength":2},"required":false,"name":"region","in":"query"},{"schema":{"type":["string","null"],"maxLength":100},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Majors ordered by institution popularity","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"classes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"code":{"type":["string","null"]},"officialDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"subjects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"subjects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"subjects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"}},"required":["id","name"]},"default":[]}},"required":["id","name"]},"default":[]}},"required":["id","name"]},"default":[]}},"required":["id","name"]},"default":[]}},"required":["id","name","code"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/institutions/{institutionId}/medicine-major":{"get":{"operationId":"getEducationMedicineMajor","tags":["Education"],"summary":"Resolve an institution medicine major","description":"Returns the exact Medicine major when present, otherwise the shortest major name containing medic.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"institutionId","in":"path"}],"responses":{"200":{"description":"The selected medicine major, or null when none exists","content":{"application/json":{"schema":{"type":["object","null"],"properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]}},"required":["id","name","code"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/institutions/{institutionId}":{"get":{"operationId":"getEducationInstitution","tags":["Education"],"summary":"Get an educational institution","description":"Loads the requested educational institution when it is visible to the authenticated viewer, including display fields, materialised Gizmo member and enrolment counts, derived institution penetration, current/previous calendar-month active member counts, the full qualification×academic-year penetration matrix for the school, and viewer-relevant academic-year / qualification penetration when the caller is counted at the school. Count and enrolment pairs are cached by grain (institution / year / qualification / year×qual list) for six hours.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"institutionId","in":"path"}],"responses":{"200":{"description":"The institution, or null when it is not visible","content":{"application/json":{"schema":{"type":["object","null"],"properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"userCount":{"type":["integer","null"],"minimum":0},"enrolledStudents":{"type":["integer","null"],"minimum":0},"penetration":{"type":["number","null"],"minimum":0,"maximum":1},"activityCounts":{"type":["object","null"],"properties":{"weeklyActivity":{"type":["object","null"],"properties":{"userCount":{"type":"integer","minimum":0},"periodStartDate":{"type":"string","format":"date"}},"required":["userCount","periodStartDate"]},"monthlyActivity":{"type":["object","null"],"properties":{"userCount":{"type":"integer","minimum":0},"periodStartDate":{"type":"string","format":"date"}},"required":["userCount","periodStartDate"]},"previousMonthlyActivity":{"type":["object","null"],"properties":{"userCount":{"type":"integer","minimum":0},"periodStartDate":{"type":"string","format":"date"}},"required":["userCount","periodStartDate"]}}},"academicYearPenetration":{"type":["object","null"],"properties":{"userCount":{"type":["integer","null"],"minimum":0},"enrolledStudents":{"type":["integer","null"],"minimum":0},"penetration":{"type":["number","null"],"minimum":0,"maximum":1},"academicYearId":{"type":"integer","exclusiveMinimum":0}},"required":["academicYearId"]},"qualificationPenetrations":{"type":"array","items":{"type":"object","properties":{"userCount":{"type":["integer","null"],"minimum":0},"enrolledStudents":{"type":["integer","null"],"minimum":0},"penetration":{"type":["number","null"],"minimum":0,"maximum":1},"qualificationId":{"type":"integer","exclusiveMinimum":0}},"required":["qualificationId"]}},"qualificationAcademicYearPenetrations":{"type":"array","items":{"type":"object","properties":{"userCount":{"type":["integer","null"],"minimum":0},"enrolledStudents":{"type":["integer","null"],"minimum":0},"penetration":{"type":["number","null"],"minimum":0,"maximum":1},"qualificationId":{"type":"integer","exclusiveMinimum":0},"qualificationName":{"type":["string","null"]},"academicYearId":{"type":"integer","exclusiveMinimum":0}},"required":["qualificationId","academicYearId"]}}},"required":["id","name","logoUrl","institutionType"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/classmates":{"get":{"operationId":"listEducationClassmates","tags":["Education"],"summary":"List the viewer's classmates","description":"Lists users in the requested institution and academic year, excluding the authenticated viewer. Returns an empty page unless the institution and academic year are the viewer's own. qualificationId narrows university classmates when supplied.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"institutionId","in":"query"},{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"academicYearId","in":"query"},{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":false,"name":"qualificationId","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Classmates ordered by user ID descending","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"displayName":{"type":"string"},"profilePicture":{"type":["string","null"]},"institutionName":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"academicYearName":{"type":["string","null"]},"qualificationName":{"type":["string","null"]},"qualificationLevelName":{"type":["string","null"]}},"required":["userId","firstName","lastName","userName","displayName","profilePicture","institutionName","institutionType","academicYearName","qualificationName","qualificationLevelName"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/users/{userId}":{"get":{"operationId":"getEducationUser","tags":["Education"],"summary":"Get a user's education summary","description":"Loads the requested user's visible education record, including their institution, qualification, and academic year identifiers.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The user's visible education summary","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"education":{"type":["object","null"],"properties":{"id":{"type":"integer","exclusiveMinimum":0},"academicYearId":{"type":["integer","null"],"minimum":0},"institutionId":{"type":["integer","null"],"minimum":0},"qualificationId":{"type":["integer","null"],"minimum":0},"institution":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"shortDisplayName":{"type":["string","null"]},"institutionType":{"type":["string","null"]}},"required":["name","institutionType"]}},"required":["id","academicYearId","institutionId","qualificationId","institution"]}},"required":["userId","education"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Education user not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_USER_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/suggested-classes":{"get":{"operationId":"listSuggestedEducationClasses","tags":["Education"],"summary":"Suggest classes the viewer may want to join","description":"Bounded top-N class suggestions for the authenticated viewer, ordered by weighted evidence: classes the viewer's own decks are tagged into weigh most, then mutual friends taking them, then classmates at the viewer's school. nextCursor is always null in v1.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":20,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Suggested classes in display order","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"class":{"type":"object","properties":{"classId":{"type":"integer","exclusiveMinimum":0},"qualificationUnitId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"authority":{"type":["string","null"]},"emoji":{"type":"string","minLength":1},"emojiColour":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":0},"educationalInstitutionId":{"type":["integer","null"],"exclusiveMinimum":0},"displayTags":{"type":"array","items":{"type":"string"}},"lifecycleStatus":{"type":"string","enum":["pending","needs_user_input","unverified","accepted","rejected"]}},"required":["classId","qualificationUnitId","name","code","authority","emoji","emojiColour","memberCount","educationalInstitutionId","displayTags","lifecycleStatus"]},"reasons":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["decks"]},"count":{"type":"integer","minimum":0},"deckNames":{"type":"array","items":{"type":"string"}}},"required":["kind","count","deckNames"]},{"type":"object","properties":{"kind":{"type":"string","enum":["friends"]},"count":{"type":"integer","minimum":0}},"required":["kind","count"]},{"type":"object","properties":{"kind":{"type":"string","enum":["classmates"]},"count":{"type":"integer","minimum":0}},"required":["kind","count"]}]}}},"required":["class","reasons"]}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/education/v1/suggest-deck-class":{"post":{"operationId":"suggestEducationDeckClass","tags":["Education"],"summary":"Suggest a class for a new deck title","description":"Legacy (control / omitted classRequiredVariant): enrolled + search + AI classifier, and pending-class propose for unmatched predicted codes. add-deck-class-required-v1 test: only an exact catalogue-code match in the deck name or grounded classCode prefills; soft-null otherwise.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deckName":{"type":"string","minLength":1,"maxLength":300},"classCode":{"type":"string","minLength":1,"maxLength":50},"classRequiredVariant":{"type":"string","enum":["control","test"]}},"required":["deckName"],"additionalProperties":false}}}},"responses":{"200":{"description":"A soft-null suggestion: the picked class, or null when nothing fits","content":{"application/json":{"schema":{"type":"object","properties":{"suggestion":{"type":["object","null"],"properties":{"classId":{"type":"integer","exclusiveMinimum":0},"qualificationUnitId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"authority":{"type":["string","null"]},"emoji":{"type":"string","minLength":1},"emojiColour":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":0},"educationalInstitutionId":{"type":["integer","null"],"exclusiveMinimum":0},"displayTags":{"type":"array","items":{"type":"string"}},"lifecycleStatus":{"type":"string","enum":["pending","needs_user_input","unverified","accepted","rejected"]}},"required":["classId","qualificationUnitId","name","code","authority","emoji","emojiColour","memberCount","educationalInstitutionId","displayTags","lifecycleStatus"]},"confidence":{"type":["number","null"],"minimum":0,"maximum":1},"source":{"type":["string","null"],"enum":["user","search","proposed"]},"predictedCodeMatch":{"type":["string","null"],"enum":["exact","created","none"]}},"required":["suggestion","confidence","source","predictedCodeMatch"]}}}},"400":{"description":"Invalid Education Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The authenticated session cannot call write education APIs","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Education Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The education data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EDUCATION_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/live/v1/opponent-invites":{"get":{"operationId":"getLiveOpponentInvites","tags":["Live"],"summary":"Get lobby opponents to invite to a Live game","description":"Returns up to six ready lobby opponents the authenticated viewer has never played, for a Live game invite, as one unpaginated `items` list. The selection is random within audience tiers, so repeated calls can return different opponents; an empty list means none are available.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Lobby opponents the viewer has never played","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"opponentId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"avatarUrl":{"type":"string","minLength":1}},"required":["opponentId","displayName","avatarUrl"]}}},"required":["items"]}}}},"400":{"description":"Unknown query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Live Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The lobby opponent service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["LIVE_OPPONENT_INVITES_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/imports/v1":{"get":{"operationId":"listImports","tags":["Imports"],"summary":"List the viewer's imports","description":"Lists the imports the authenticated viewer started, newest first (createdAt descending, then importId descending). Only finished imports of a file, link, video, photo or pasted notes whose deck the viewer can still open are listed; \"generate more\" continuations are not. Results use offset pagination and nextOffset advances by the rows the owner returned. hasMore reflects the owner checking for one more row beyond the page. An empty result is a 200 with no items.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":30},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"The viewer's imports","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"importId":{"type":"integer","exclusiveMinimum":0},"deckId":{"type":"integer","exclusiveMinimum":0},"source":{"anyOf":[{"type":"string","enum":["PDF","YOUTUBE","POWERPOINT","PHOTO","NOTES","ANKI","QUIZLET","CSV","URL","AUDIO"]},{"type":"null"},{"type":"null"}]},"title":{"type":["string","null"]},"originalFilename":{"type":["string","null"]},"cardCount":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"}},"required":["importId","deckId","source","title","originalFilename","cardCount","createdAt"],"additionalProperties":false}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"],"additionalProperties":false}}}},"400":{"description":"Invalid import list request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Imports Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The import data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["IMPORT_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/imports/v1/decks/{deckId}/status":{"get":{"operationId":"getImportDeckStatus","tags":["Imports"],"summary":"Get import status for a deck","description":"Returns the five newest imports filed directly against the requested deck, newest import ID first for tied creation times.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"deckId","in":"path"}],"responses":{"200":{"description":"The requested import resource","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"importId":{"type":"integer","exclusiveMinimum":0},"status":{"type":["string","null"]},"deckId":{"type":["integer","null"],"exclusiveMinimum":0},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["importId","status","deckId","createdAt"],"additionalProperties":false},"maxItems":5}},"required":["events"],"additionalProperties":false}}}},"400":{"description":"Invalid import request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The import does not exist or is not visible","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["IMPORT_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Imports Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The import data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["IMPORT_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/imports/v1/{importId}/card-count":{"get":{"operationId":"getImportCardCount","tags":["Imports"],"summary":"Get import card count","description":"Resolves the import deck server-side, verifies the authenticated viewer can access it, and counts cards created by the import.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"importId","in":"path"}],"responses":{"200":{"description":"The requested import resource","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","minimum":0}},"required":["count"],"additionalProperties":false}}}},"400":{"description":"Invalid import request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The import does not exist or is not visible","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["IMPORT_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Imports Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The import data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["IMPORT_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/imports/v1/{importId}":{"get":{"operationId":"getImportStatus","tags":["Imports"],"summary":"Get import status","description":"Loads the current status and resolved deck for an authenticated caller, preserving the legacy operation authorization boundary.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"importId","in":"path"}],"responses":{"200":{"description":"The requested import resource","content":{"application/json":{"schema":{"type":"object","properties":{"importId":{"type":"integer","exclusiveMinimum":0},"status":{"type":["string","null"]},"deckId":{"type":["integer","null"],"exclusiveMinimum":0}},"required":["importId","status","deckId"],"additionalProperties":false}}}},"400":{"description":"Invalid import request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The import does not exist or is not visible","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["IMPORT_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Imports Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The import data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["IMPORT_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/podcasts/v1/{podcastId}":{"get":{"operationId":"getPodcast","tags":["Podcasts"],"summary":"Get a podcast","description":"Returns the current podcast state for a deck or study note: the latest script summary and the current episode, if one has been requested.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"}],"responses":{"200":{"description":"Podcast state","content":{"application/json":{"schema":{"type":"object","properties":{"podcastId":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["deck"]},"deckId":{"type":"integer","exclusiveMinimum":0}},"required":["type","deckId"]},{"type":"object","properties":{"type":{"type":"string","enum":["decks"]},"deckIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"minItems":2,"maxItems":5}},"required":["type","deckIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["note"]},"noteId":{"type":"string","format":"uuid"}},"required":["type","noteId"]}]},"sourceTitle":{"type":["string","null"],"default":null,"description":"The name of a podcast made from several decks, built from the deck names (\"Deck A, Deck B + 1 more\"). Null for a podcast of one deck or one note, whose name the client already has."},"script":{"type":["object","null"],"properties":{"title":{"type":"string"},"language":{"type":"string"},"wordCount":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"}},"required":["title","language","wordCount","createdAt"]},"episode":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"podcastId":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["deck"]},"deckId":{"type":"integer","exclusiveMinimum":0}},"required":["type","deckId"]},{"type":"object","properties":{"type":{"type":"string","enum":["decks"]},"deckIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"minItems":2,"maxItems":5}},"required":["type","deckIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["note"]},"noteId":{"type":"string","format":"uuid"}},"required":["type","noteId"]}]},"sourceTitle":{"type":["string","null"],"default":null,"description":"The name of a podcast made from several decks, built from the deck names (\"Deck A, Deck B + 1 more\"). Null for a podcast of one deck or one note, whose name the client already has."},"status":{"type":"string","enum":["queued","scripting","synthesizing","ready","failed"]},"failureCode":{"type":["string","null"]},"voiceSet":{"type":"string"},"options":{"type":"object","properties":{"format":{"type":"string","enum":["classic","lecture","quiz_show","gossip"]},"length":{"type":"string","enum":["short","medium","long"]},"language":{"anyOf":[{"type":"string","enum":["af","cs","de","el","en","es","fil","fr","hi","hr","hu","id","it","ms","nb","nl","pl","pt","ro","sk","tr","vi"]},{"type":"null"},{"type":"null"}]},"customInstructions":{"type":"boolean"}},"default":{"format":"classic","length":"medium","language":null,"customInstructions":false},"required":["format","length","language","customInstructions"]},"title":{"type":["string","null"]},"language":{"type":["string","null"]},"durationMs":{"type":["integer","null"],"minimum":0},"byteLength":{"type":["integer","null"],"minimum":0},"chunkCount":{"type":["integer","null"],"minimum":0},"chunksReady":{"type":"integer","minimum":0},"estimatedSecondsRemaining":{"type":["integer","null"],"minimum":0,"default":null,"description":"Estimated seconds until the episode is ready. An estimate, not a promise. Null unless the episode is synthesizing, and null when no estimate can be made."},"stale":{"type":"boolean"},"turns":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"speaker":{"type":"string","enum":["host","cohost"]},"text":{"type":"string"},"cardIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0}},"startMs":{"type":["integer","null"],"minimum":0},"endMs":{"type":["integer","null"],"minimum":0}},"required":["index","speaker","text","cardIds","startMs","endMs"]}},"chapters":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"title":{"type":"string"},"turn":{"type":"integer","minimum":0},"startMs":{"type":["integer","null"],"minimum":0}},"required":["index","title","turn","startMs"]},"default":[]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","podcastId","source","status","failureCode","voiceSet","title","language","durationMs","byteLength","chunkCount","chunksReady","stale","turns","createdAt","updatedAt","completedAt"]},"severalDeckPodcasts":{"type":"boolean","default":false,"description":"Whether the caller may use podcasts made from several decks. When false, a several-deck podcast id is refused, so a client offers one deck only."},"newEpisodeAllowance":{"type":["object","null"],"properties":{"limit":{"type":"integer","minimum":0,"description":"Generation runs the caller may start in any 24 hours. A run is a new episode or a re-run of a failed one."},"remaining":{"type":"integer","minimum":0,"description":"Runs the caller may start now."},"nextSlotAt":{"type":["string","null"],"format":"date-time","description":"When a run slot opens, in UTC. Null when one is open now, and when none will open (the limit is 0)."}},"default":null,"required":["limit","remaining","nextSlotAt"],"description":"How many more generation runs the caller may start. Null when unknown."}},"required":["podcastId","source","script","episode"]}}}},"400":{"description":"Invalid podcast request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Podcast source not found or not readable by the caller","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}}},"/data/podcasts/v1/{podcastId}/episodes":{"post":{"operationId":"startPodcastEpisode","tags":["Podcasts"],"summary":"Start a podcast episode","description":"Starts generating an episode for the current content of the source, or returns the existing episode for that content. Repeating the request is safe. An empty body is the same as an empty object.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"voiceSet":{"type":"string","minLength":1,"maxLength":64},"format":{"type":"string","enum":["classic","lecture","quiz_show","gossip"]},"length":{"type":"string","enum":["short","medium","long"]},"language":{"type":"string","enum":["af","cs","de","el","en","es","fil","fr","hi","hr","hu","id","it","ms","nb","nl","pl","pt","ro","sk","tr","vi"]},"instructions":{"type":"string","minLength":1,"maxLength":300}},"additionalProperties":false}}}},"responses":{"200":{"description":"The episode for the current content","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"podcastId":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["deck"]},"deckId":{"type":"integer","exclusiveMinimum":0}},"required":["type","deckId"]},{"type":"object","properties":{"type":{"type":"string","enum":["decks"]},"deckIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"minItems":2,"maxItems":5}},"required":["type","deckIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["note"]},"noteId":{"type":"string","format":"uuid"}},"required":["type","noteId"]}]},"sourceTitle":{"type":["string","null"],"default":null,"description":"The name of a podcast made from several decks, built from the deck names (\"Deck A, Deck B + 1 more\"). Null for a podcast of one deck or one note, whose name the client already has."},"status":{"type":"string","enum":["queued","scripting","synthesizing","ready","failed"]},"failureCode":{"type":["string","null"]},"voiceSet":{"type":"string"},"options":{"type":"object","properties":{"format":{"type":"string","enum":["classic","lecture","quiz_show","gossip"]},"length":{"type":"string","enum":["short","medium","long"]},"language":{"anyOf":[{"type":"string","enum":["af","cs","de","el","en","es","fil","fr","hi","hr","hu","id","it","ms","nb","nl","pl","pt","ro","sk","tr","vi"]},{"type":"null"},{"type":"null"}]},"customInstructions":{"type":"boolean"}},"default":{"format":"classic","length":"medium","language":null,"customInstructions":false},"required":["format","length","language","customInstructions"]},"title":{"type":["string","null"]},"language":{"type":["string","null"]},"durationMs":{"type":["integer","null"],"minimum":0},"byteLength":{"type":["integer","null"],"minimum":0},"chunkCount":{"type":["integer","null"],"minimum":0},"chunksReady":{"type":"integer","minimum":0},"estimatedSecondsRemaining":{"type":["integer","null"],"minimum":0,"default":null,"description":"Estimated seconds until the episode is ready. An estimate, not a promise. Null unless the episode is synthesizing, and null when no estimate can be made."},"stale":{"type":"boolean"},"turns":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"speaker":{"type":"string","enum":["host","cohost"]},"text":{"type":"string"},"cardIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0}},"startMs":{"type":["integer","null"],"minimum":0},"endMs":{"type":["integer","null"],"minimum":0}},"required":["index","speaker","text","cardIds","startMs","endMs"]}},"chapters":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"title":{"type":"string"},"turn":{"type":"integer","minimum":0},"startMs":{"type":["integer","null"],"minimum":0}},"required":["index","title","turn","startMs"]},"default":[]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","podcastId","source","status","failureCode","voiceSet","title","language","durationMs","byteLength","chunkCount","chunksReady","stale","turns","createdAt","updatedAt","completedAt"]}}}},"400":{"description":"Invalid request or unknown voice set","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_VOICE_SET"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_OPTION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_INSTRUCTIONS_NOT_ALLOWED"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts, the source is not allowed, or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_SOURCE_NOT_ALLOWED"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"Podcast source not found or not readable by the caller","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many requests, or the per-user limit of new episodes per 24 hours was reached; Retry-After carries the seconds to wait when known","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_LIMIT_REACHED"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}}},"/data/podcasts/v1/{podcastId}/episodes/{episodeId}":{"get":{"operationId":"getPodcastEpisode","tags":["Podcasts"],"summary":"Get a podcast episode","description":"Returns an episode’s status, generation progress and transcript turns. Turn timings are null until that turn’s audio exists.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"episodeId","in":"path"}],"responses":{"200":{"description":"Episode state","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"podcastId":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["deck"]},"deckId":{"type":"integer","exclusiveMinimum":0}},"required":["type","deckId"]},{"type":"object","properties":{"type":{"type":"string","enum":["decks"]},"deckIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"minItems":2,"maxItems":5}},"required":["type","deckIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["note"]},"noteId":{"type":"string","format":"uuid"}},"required":["type","noteId"]}]},"sourceTitle":{"type":["string","null"],"default":null,"description":"The name of a podcast made from several decks, built from the deck names (\"Deck A, Deck B + 1 more\"). Null for a podcast of one deck or one note, whose name the client already has."},"status":{"type":"string","enum":["queued","scripting","synthesizing","ready","failed"]},"failureCode":{"type":["string","null"]},"voiceSet":{"type":"string"},"options":{"type":"object","properties":{"format":{"type":"string","enum":["classic","lecture","quiz_show","gossip"]},"length":{"type":"string","enum":["short","medium","long"]},"language":{"anyOf":[{"type":"string","enum":["af","cs","de","el","en","es","fil","fr","hi","hr","hu","id","it","ms","nb","nl","pl","pt","ro","sk","tr","vi"]},{"type":"null"},{"type":"null"}]},"customInstructions":{"type":"boolean"}},"default":{"format":"classic","length":"medium","language":null,"customInstructions":false},"required":["format","length","language","customInstructions"]},"title":{"type":["string","null"]},"language":{"type":["string","null"]},"durationMs":{"type":["integer","null"],"minimum":0},"byteLength":{"type":["integer","null"],"minimum":0},"chunkCount":{"type":["integer","null"],"minimum":0},"chunksReady":{"type":"integer","minimum":0},"estimatedSecondsRemaining":{"type":["integer","null"],"minimum":0,"default":null,"description":"Estimated seconds until the episode is ready. An estimate, not a promise. Null unless the episode is synthesizing, and null when no estimate can be made."},"stale":{"type":"boolean"},"turns":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"speaker":{"type":"string","enum":["host","cohost"]},"text":{"type":"string"},"cardIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0}},"startMs":{"type":["integer","null"],"minimum":0},"endMs":{"type":["integer","null"],"minimum":0}},"required":["index","speaker","text","cardIds","startMs","endMs"]}},"chapters":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"title":{"type":"string"},"turn":{"type":"integer","minimum":0},"startMs":{"type":["integer","null"],"minimum":0}},"required":["index","title","turn","startMs"]},"default":[]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","podcastId","source","status","failureCode","voiceSet","title","language","durationMs","byteLength","chunkCount","chunksReady","stale","turns","createdAt","updatedAt","completedAt"]}}}},"400":{"description":"Invalid podcast request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Podcast source or episode not found, or not readable by the caller","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}}},"/data/podcasts/v1/{podcastId}/episodes/{episodeId}/position":{"get":{"operationId":"getPodcastEpisodePosition","tags":["Podcasts"],"summary":"Get the caller’s place in a podcast episode","description":"Returns where the caller stopped listening to the episode, so playback can resume on any device, or null when they have no stored place. Read it once when the player opens.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"episodeId","in":"path"}],"responses":{"200":{"description":"The caller’s stored place, or null","content":{"application/json":{"schema":{"type":"object","properties":{"position":{"type":["object","null"],"properties":{"positionMs":{"type":"integer","minimum":0,"maximum":86400000,"description":"Where the listener stopped, in milliseconds from the start."},"finished":{"type":"boolean","description":"Whether the listener has finished the episode. Once true it stays true."},"updatedAt":{"type":"string","format":"date-time","description":"When the stored place was last written, in UTC."}},"required":["positionMs","finished","updatedAt"],"description":"The caller’s stored place in the episode, or null when they have none."}},"required":["position"]}}}},"400":{"description":"Invalid podcast request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Podcast source or episode not found, or not readable by the caller","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}},"put":{"operationId":"putPodcastEpisodePosition","tags":["Podcasts"],"summary":"Store the caller’s place in a podcast episode","description":"Stores where the caller is in the episode and returns what is stored afterwards, which can differ from what was sent: a position past the end is stored as the end, within the last five seconds counts as finished, and a write that changes nothing worth storing leaves the stored place as it was. Finished stays set once it is. Write on pause, at the end of a seek, when the app goes to the background or the player closes, on finish, and at most every 30 seconds while playing. Any episode of the podcast accepts a position, including one still being made.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"episodeId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"positionMs":{"type":"integer","minimum":0,"maximum":86400000,"description":"Where the listener is, in milliseconds. Past the episode’s length it is stored as the end."},"finished":{"type":"boolean","default":false,"description":"True when the listener reached the end. A position within the last five seconds counts as finished too."}},"required":["positionMs"],"additionalProperties":false}}}},"responses":{"200":{"description":"The caller’s stored place after the write","content":{"application/json":{"schema":{"type":"object","properties":{"position":{"type":["object","null"],"properties":{"positionMs":{"type":"integer","minimum":0,"maximum":86400000,"description":"Where the listener stopped, in milliseconds from the start."},"finished":{"type":"boolean","description":"Whether the listener has finished the episode. Once true it stays true."},"updatedAt":{"type":"string","format":"date-time","description":"When the stored place was last written, in UTC."}},"required":["positionMs","finished","updatedAt"],"description":"The caller’s stored place in the episode, or null when they have none."}},"required":["position"]}}}},"400":{"description":"Invalid podcast request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts, or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"Podcast source or episode not found, or not readable by the caller","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}}},"/data/podcasts/v1/{podcastId}/episodes/{episodeId}/audio":{"get":{"operationId":"getPodcastEpisodeAudio","tags":["Podcasts"],"summary":"Get podcast episode audio","description":"Streams the finished episode as audio/mpeg. Supports HTTP Range requests (Range and If-Range) for partial content and seeking. Responses are private and never cached.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"episodeId","in":"path"}],"responses":{"200":{"description":"The complete episode audio","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"The requested byte range of the episode audio","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid podcast request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Podcast source or episode not found, or not readable by the caller","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"409":{"description":"The episode is not ready yet","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_READY"]},"message":{"type":"string"}},"required":["code","message"]}}}},"416":{"description":"The requested range cannot be satisfied; Content-Range carries the audio length"},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}}},"/data/podcasts/v1/{podcastId}/episodes/{episodeId}/playlist.m3u8":{"get":{"operationId":"getPodcastEpisodePlaylist","tags":["Podcasts"],"summary":"Get the podcast episode HLS playlist","description":"Returns an HLS media playlist of the episode chunks stored so far, so playback can start while the episode is still being generated. Chunks are referenced by the relative URL chunks/<attempt>/<index>.mp3. Responses are private and never cached.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"episodeId","in":"path"}],"responses":{"200":{"description":"The HLS media playlist","content":{"application/vnd.apple.mpegurl":{"schema":{"type":"string"}}}},"400":{"description":"Invalid podcast request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Podcast source or episode not found, or not readable by the caller","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"409":{"description":"No chunk of the episode is stored yet","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_READY"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}}},"/data/podcasts/v1/{podcastId}/episodes/{episodeId}/chunks/{attempt}/{chunkFile}":{"get":{"operationId":"getPodcastEpisodeChunk","tags":["Podcasts"],"summary":"Get a podcast episode audio chunk","description":"Streams one audio/mpeg chunk named by the episode HLS playlist. The address includes the episode attempt number (chunks/<attempt>/<index>.mp3), so a retry never serves audio of a different attempt under the same address; an attempt other than the current one is not found. Supports HTTP Range requests (Range and If-Range). Responses are private and never cached.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"podcastId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"episodeId","in":"path"},{"schema":{"type":"string","pattern":"^[1-9]\\d{0,5}$"},"required":true,"name":"attempt","in":"path"},{"schema":{"type":"string","pattern":"^(0|[1-9]\\d{0,3})\\.mp3$"},"required":true,"name":"chunkFile","in":"path"}],"responses":{"200":{"description":"The complete chunk","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"The requested byte range of the chunk","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid podcast request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The caller is not allowed to use podcasts","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PODCASTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Podcast source or episode not found, or not readable by the caller","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"409":{"description":"The chunk is not stored yet","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["EPISODE_NOT_READY"]},"message":{"type":"string"}},"required":["code","message"]}}}},"416":{"description":"The requested range cannot be satisfied; Content-Range carries the chunk length"},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Podcast or authentication service unavailable","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["PODCAST_UPSTREAM_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}]}}}}}}},"/data/practice-exams/v1":{"post":{"operationId":"createPracticeExam","tags":["Practice exams"],"summary":"Create a practice exam","description":"Creates a deck, message-based, or seeded practice exam using the owning Practice Exam service.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"source":{"type":"object","properties":{"type":{"type":"string","enum":["deck"]},"deckId":{"type":"number"}},"required":["type","deckId"],"additionalProperties":false},"steering":{"type":"object","properties":{"questionCount":{"type":"number","minimum":1,"maximum":100},"instructions":{"type":"string","maxLength":500}},"additionalProperties":false},"questionCount":{"type":"number","minimum":1,"maximum":100},"skipAiCache":{"type":"boolean"}},"required":["source"],"additionalProperties":false},{"type":"object","properties":{"messages":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object","properties":{"purpose":{"type":"string","enum":["content","instruction","context"]}},"additionalProperties":false},"role":{"type":"string","enum":["user"]},"parts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"state":{"type":"string","enum":["streaming","done"]}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-deck-card-context"]},"id":{"type":"string"},"data":{"type":"object","properties":{"query":{"type":"object","properties":{"deckId":{"type":"number"}},"required":["deckId"],"additionalProperties":false},"options":{"type":"object","properties":{"includeSubdecks":{"type":"boolean"},"maxCards":{"type":"number"},"randomOrder":{"type":"boolean"},"cardIds":{"type":"array","items":{"type":"number"}}},"additionalProperties":false}},"required":["query"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-deck-import-context"]},"id":{"type":"string"},"data":{"type":"object","properties":{"query":{"type":"object","properties":{"deckId":{"type":"number"}},"required":["deckId"],"additionalProperties":false}},"required":["query"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-study-note"]},"id":{"type":"string"},"data":{"type":"object","properties":{"note":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"}},"required":["id"],"additionalProperties":false},"options":{"type":"object","properties":{"enrich":{"type":"boolean"}},"additionalProperties":false}},"required":["note"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-deck"]},"id":{"type":"string"},"data":{"type":"object","properties":{"deckId":{"type":"number"},"name":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["deckId"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-card"]},"id":{"type":"string"},"data":{"type":"object","properties":{"cardId":{"type":"number"},"questionSource":{"type":["object","null"],"properties":{"question":{"anyOf":[{"type":"object","properties":{"prompt":{"type":"object","properties":{"front":{"type":"string"},"back":{"type":["string","null"]}},"required":["front"],"additionalProperties":false},"questionFormat":{"type":"string","enum":["Q_AND_A"]}},"required":["prompt","questionFormat"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"object","properties":{"front":{"type":"string"},"back":{"type":["string","null"]}},"required":["front"],"additionalProperties":false},"questionFormat":{"type":"string","enum":["CLOZE"]}},"required":["prompt","questionFormat"],"additionalProperties":false},{"type":"object","properties":{"answers":{"type":"array","prefixItems":[{},{}]},"prompt":{"type":"object","properties":{"front":{"type":"string"},"back":{"type":"string"}},"required":["front","back"],"additionalProperties":false},"questionFormat":{"type":"string","enum":["TRUE_OR_FALSE"]}},"required":["answers","prompt","questionFormat"],"additionalProperties":false}]}},"required":["question"],"additionalProperties":false},"options":{"type":"object","properties":{"enrich":{"type":"boolean"}},"additionalProperties":false}},"required":["cardId"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-tutor-chat"]},"id":{"type":"string"},"data":{"type":"object","properties":{"query":{"type":"object","properties":{"id":{"type":"string"},"nodeIds":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false},"options":{"type":"object","properties":{"maxNodes":{"type":"integer","minimum":1,"maximum":50}},"additionalProperties":false}},"required":["query"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["file"]},"mediaType":{"type":"string"},"filename":{"type":"string"},"url":{"type":"string"}},"required":["type","mediaType","url"],"additionalProperties":false}]}}},"required":["id","role","parts"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object","properties":{"purpose":{"type":"string","enum":["content","instruction","context"]}},"additionalProperties":false},"role":{"type":"string","enum":["assistant","system"]},"parts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"state":{"type":"string","enum":["streaming","done"]}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-deck-card-context"]},"id":{"type":"string"},"data":{"type":"object","properties":{"query":{"type":"object","properties":{"deckId":{"type":"number"}},"required":["deckId"],"additionalProperties":false},"options":{"type":"object","properties":{"includeSubdecks":{"type":"boolean"},"maxCards":{"type":"number"},"randomOrder":{"type":"boolean"},"cardIds":{"type":"array","items":{"type":"number"}}},"additionalProperties":false}},"required":["query"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-deck-import-context"]},"id":{"type":"string"},"data":{"type":"object","properties":{"query":{"type":"object","properties":{"deckId":{"type":"number"}},"required":["deckId"],"additionalProperties":false}},"required":["query"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-study-note"]},"id":{"type":"string"},"data":{"type":"object","properties":{"note":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"}},"required":["id"],"additionalProperties":false},"options":{"type":"object","properties":{"enrich":{"type":"boolean"}},"additionalProperties":false}},"required":["note"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-deck"]},"id":{"type":"string"},"data":{"type":"object","properties":{"deckId":{"type":"number"},"name":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["deckId"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-card"]},"id":{"type":"string"},"data":{"type":"object","properties":{"cardId":{"type":"number"},"questionSource":{"type":["object","null"],"properties":{"question":{"anyOf":[{"type":"object","properties":{"prompt":{"type":"object","properties":{"front":{"type":"string"},"back":{"type":["string","null"]}},"required":["front"],"additionalProperties":false},"questionFormat":{"type":"string","enum":["Q_AND_A"]}},"required":["prompt","questionFormat"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"object","properties":{"front":{"type":"string"},"back":{"type":["string","null"]}},"required":["front"],"additionalProperties":false},"questionFormat":{"type":"string","enum":["CLOZE"]}},"required":["prompt","questionFormat"],"additionalProperties":false},{"type":"object","properties":{"answers":{"type":"array","prefixItems":[{},{}]},"prompt":{"type":"object","properties":{"front":{"type":"string"},"back":{"type":"string"}},"required":["front","back"],"additionalProperties":false},"questionFormat":{"type":"string","enum":["TRUE_OR_FALSE"]}},"required":["answers","prompt","questionFormat"],"additionalProperties":false}]}},"required":["question"],"additionalProperties":false},"options":{"type":"object","properties":{"enrich":{"type":"boolean"}},"additionalProperties":false}},"required":["cardId"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["data-tutor-chat"]},"id":{"type":"string"},"data":{"type":"object","properties":{"query":{"type":"object","properties":{"id":{"type":"string"},"nodeIds":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false},"options":{"type":"object","properties":{"maxNodes":{"type":"integer","minimum":1,"maximum":50}},"additionalProperties":false}},"required":["query"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false}]}}},"required":["id","role","parts"],"additionalProperties":false}]},"minItems":1},"options":{"type":"object","properties":{"numQuestions":{"type":"number","minimum":1,"maximum":100},"allowedBloomTypes":{"type":"array","items":{"type":"string","enum":["APPLY","UNDERSTAND","RECALL"]}},"allowedQuestionTypes":{"type":"array","items":{"type":"string","enum":["QA","Cloze","Ordering","TrueFalse","SelectAll","Matching"]}},"examType":{"type":"string","minLength":1,"maxLength":200},"paperId":{"type":"integer","exclusiveMinimum":0},"paperName":{"type":"string","minLength":1,"maxLength":200},"skipAiCache":{"type":"boolean"},"skipExamCache":{"type":"boolean"},"client":{"type":"object","properties":{"platform":{"type":"string","enum":["web","ios","android"]},"appVersion":{"type":"string","minLength":1,"maxLength":50}},"required":["platform"],"additionalProperties":false}},"default":{},"additionalProperties":false}},"required":["messages"],"additionalProperties":false},{"type":"object","properties":{"seedExamId":{"type":"string","minLength":1},"skipAiCache":{"type":"boolean"},"skipExamCache":{"type":"boolean"}},"required":["seedExamId"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Practice exam accepted for generation","content":{"application/json":{"schema":{"type":"object","properties":{"examId":{"type":"string"},"status":{"type":"string"}},"required":["examId","status"]}}}},"400":{"description":"Invalid practice exam request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Read-only impersonation cannot create an exam","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"Seed practice exam not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PRACTICE_EXAM_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"Practice exam service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PRACTICE_EXAM_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/practice-exams/v1/{examId}":{"get":{"operationId":"getPracticeExam","tags":["Practice exams"],"summary":"Get a practice exam","description":"Returns the current state of a practice exam.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"examId","in":"path"}],"responses":{"200":{"description":"Practice exam state","content":{"application/json":{"schema":{"type":"object","properties":{"examId":{"type":"string"},"status":{"type":"string"},"userId":{"type":"string"},"questionCount":{"type":"number"},"title":{"type":["string","null"]},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["deck"]},"deckId":{"type":"number"}},"required":["type","deckId"]},{"type":"object","properties":{"type":{"type":"string","enum":["chat"]},"chatId":{"type":"string"}},"required":["type","chatId"]}]}},"required":["examId","status","userId","questionCount"]}}}},"400":{"description":"Invalid practice exam request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Practice exam not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PRACTICE_EXAM_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"Practice exam service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PRACTICE_EXAM_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/practice-exams/v1/{examId}/results":{"get":{"operationId":"getPracticeExamResults","tags":["Practice exams"],"summary":"Get the viewer's practice exam results","description":"Returns attempt results for the authenticated viewer without accepting a client-supplied user id.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"examId","in":"path"}],"responses":{"200":{"description":"Practice exam attempt results","content":{"application/json":{"schema":{"type":"object","properties":{"examId":{"type":"string"},"userId":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"attemptId":{"type":"string"},"score":{"type":"number"},"correctCount":{"type":"number"},"totalCount":{"type":"number"},"marksAwarded":{"type":"number"},"maxMarks":{"type":"number"},"elapsedMs":{"type":"number"},"perQuestion":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"questionId":{"type":"string"},"selectedAnswerId":{"type":["string","null"]},"correct":{"type":"boolean"},"revealed":{"type":"boolean"}},"required":["questionId","selectedAnswerId","correct"]},{"type":"object","properties":{"questionId":{"type":"string"},"selectedAnswerIds":{"type":"array","items":{"type":"string"}},"correct":{"type":"boolean"}},"required":["questionId","selectedAnswerIds","correct"]},{"type":"object","properties":{"questionId":{"type":"string"},"answerText":{"type":"string"},"answerImages":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"mediaType":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif"]}},"required":["url","mediaType"]}},"marksAwarded":{"type":"number"},"maxMarks":{"type":"number"},"pointsAwarded":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"awarded":{"type":"boolean"}},"required":["index","awarded"]}},"additionalCredit":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"marks":{"type":"number"}},"required":["point","marks"]}},"feedback":{"type":"string"},"correct":{"type":"boolean"},"markingError":{"type":"boolean"}},"required":["questionId","answerText","marksAwarded","maxMarks","correct"]}]}}},"required":["attemptId","score","correctCount","totalCount","elapsedMs","perQuestion"]}}},"required":["examId","userId","results"]}}}},"400":{"description":"Invalid practice exam request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Practice exam not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PRACTICE_EXAM_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"Practice exam service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PRACTICE_EXAM_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/rankings/v1/users/{userId}/school-membership":{"get":{"operationId":"getRankingSchoolMembership","tags":["Rankings"],"summary":"Get a user's school leaderboard membership","description":"Returns the school identity and academic-year context used to show the requested user's school leaderboard entry. A missing or private membership returns the same stable 404 response.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The user's visible school leaderboard membership","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"academicYearId":{"type":["integer","null"],"minimum":0},"institutionId":{"type":"integer","exclusiveMinimum":0},"institution":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"institutionType":{"type":["string","null"]}},"required":["id","name","logoUrl","institutionType"],"additionalProperties":false}},"required":["userId","academicYearId","institutionId","institution"],"additionalProperties":false}}}},"400":{"description":"Invalid Rankings Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The ranking resource does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKING_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Rankings Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The rankings data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKINGS_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/rankings/v1/users/{userId}/school":{"get":{"operationId":"getRankingSchool","tags":["Rankings"],"summary":"Get a user's school leaderboard context","description":"Returns the institution context needed by the requested user's school leaderboard page. A missing or private school returns the stable ranking-resource 404 response.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The user's visible school leaderboard context","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"academicYearId":{"type":["integer","null"],"minimum":0},"institutionId":{"type":"integer","exclusiveMinimum":0},"institution":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"institutionType":{"type":["string","null"]}},"required":["id","name","logoUrl","institutionType"],"additionalProperties":false}},"required":["userId","academicYearId","institutionId","institution"],"additionalProperties":false}}}},"400":{"description":"Invalid Rankings Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The ranking resource does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKING_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Rankings Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The rankings data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKINGS_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/rankings/v1/users/{userId}/country-rank":{"get":{"operationId":"getCountryRank","tags":["Rankings"],"summary":"Get a user's country rank for an inclusive date range","description":"Returns the latest country-rank snapshot ending on endDate and the cards answered from startDate through endDate, with both UTC calendar-date boundaries included.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"},{"schema":{"type":"string","format":"date"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"endDate","in":"query"}],"responses":{"200":{"description":"The user's visible country-rank snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userHandle":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"rankId":{"type":"string"},"rankNumber":{"type":"integer","minimum":0},"rankPercentile":{"type":"number","minimum":0},"country":{"type":"string"},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"xp":{"type":"number","minimum":0},"cardsAnswered":{"type":"integer","minimum":0}},"required":["userId","firstName","lastName","userHandle","profilePicture","rankId","rankNumber","rankPercentile","country","startDate","endDate","xp","cardsAnswered"],"additionalProperties":false}}}},"400":{"description":"Invalid Rankings Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The ranking resource does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKING_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Rankings Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The rankings data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKINGS_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/rankings/v1/users/{userId}/overtake-summary":{"get":{"operationId":"getOvertakeSummary","tags":["Rankings"],"summary":"Get the viewer and another user for an overtake presentation","description":"Returns the authenticated viewer and the requested visible user. The viewer identity is derived from the verified bearer token and cannot be supplied by the client.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The visible overtake participants","content":{"application/json":{"schema":{"type":"object","properties":{"viewer":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]}},"required":["userId","firstName","lastName","profilePicture"],"additionalProperties":false},"otherUser":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]}},"required":["userId","firstName","lastName","profilePicture"],"additionalProperties":false}},"required":["viewer","otherUser"],"additionalProperties":false}}}},"400":{"description":"Invalid Rankings Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The ranking resource does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKING_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Rankings Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The rankings data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKINGS_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/rankings/v1/users/{userId}/leaderboard-ranks":{"get":{"operationId":"getUserLeaderboardRanks","tags":["Rankings"],"summary":"List the authenticated user's reverse-ETLed leaderboard rank rows","description":"Returns every remember.user_leaderboard_rank row for the authenticated viewer, newest date_range_start first. Sparse board IDs are enriched with institution (including logoUrl), class (emoji + emojiColour), topic (emoji), and year display fields when those rows exist. The path userId must match the verified JWT user; other users' ranks are not readable and return the stable ranking-resource 404. An empty list means no published rows yet.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The authenticated user's leaderboard rank rows","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"dateRangeStart":{"type":"string","format":"date"},"dateRangeType":{"type":"string","enum":["weekly","monthly"]},"leaderboardType":{"type":"string","enum":["country","school","school_year","country_year","topic","country_topic","school_topic","school_qualification_unit","country_qualification_unit","country_qualification_unit_offering","country_topic_year","country_region_topic","country_region_topic_year","country_region_qualification_unit","country_region_qualification_unit_offering"]},"leaderboardMetadata":{"type":"object","properties":{"country":{"type":"string"},"educationalInstitutionId":{"type":"integer","exclusiveMinimum":0},"academicYearId":{"type":"integer","exclusiveMinimum":0},"topicId":{"type":"integer","exclusiveMinimum":0},"qualificationUnitId":{"type":"integer","exclusiveMinimum":0},"offeringId":{"type":"integer","exclusiveMinimum":0},"region":{"type":"string"},"educationalInstitution":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"country":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"shortDisplayName":{"type":["string","null"]}},"required":["id","name","logoUrl","country","institutionType","shortDisplayName"],"additionalProperties":false},"academicYear":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"displayName":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"institutionType":{"type":["string","null"]}},"required":["id","displayName","countryCode","institutionType"],"additionalProperties":false},"topic":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"shortName":{"type":["string","null"]},"emoji":{"type":"string","minLength":1}},"required":["id","name","shortName","emoji"],"additionalProperties":false},"qualificationUnit":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"emoji":{"type":"string","minLength":1},"emojiColour":{"type":["string","null"]}},"required":["id","name","code","emoji","emojiColour"],"additionalProperties":false},"offering":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"displayText":{"type":["string","null"]},"qualificationUnitId":{"type":"integer","exclusiveMinimum":0}},"required":["id","displayText","qualificationUnitId"],"additionalProperties":false}},"additionalProperties":false},"position":{"type":"integer","exclusiveMinimum":0},"rank":{"type":"integer","exclusiveMinimum":0},"xp":{"type":"integer"},"cohortSize":{"type":"integer","exclusiveMinimum":0}},"required":["userId","dateRangeStart","dateRangeType","leaderboardType","leaderboardMetadata","position","rank","xp","cohortSize"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Invalid Rankings Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The ranking resource does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKING_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Rankings Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The rankings data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RANKINGS_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/me":{"get":{"operationId":"getMyProfile","tags":["Profiles"],"summary":"Get the editable viewer profile","description":"Loads the authenticated viewer profile fields used by profile editing. The viewer identity is derived from the verified bearer token.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The editable viewer profile","content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"birthYear":{"type":["integer","null"]},"country":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"isPrivate":{"type":["boolean","null"]},"education":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"schoolCourse":{"type":["string","null"]},"academicYearId":{"type":["integer","null"]},"institutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"institution":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","institutionType","logoUrl"],"additionalProperties":false},"academicYear":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualification":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualificationLevel":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"required":["id","schoolCourse","academicYearId","institutionId","qualificationId","institution","academicYear","qualification","qualificationLevel"],"additionalProperties":false}},"required":["firstName","lastName","birthYear","country","profilePicture","isPrivate","education"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/me/summary":{"get":{"operationId":"getMyProfileSummary","tags":["Profiles"],"summary":"Get the viewer profile summary","description":"Loads the authenticated viewer header identity, education, employee tag, roster employee stamp, and separately named following, follower, and friend counts.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The viewer profile summary","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"birthYear":{"type":["integer","null"]},"country":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"experimentTag":{"type":["string","null"]},"isEmployee":{"type":"boolean"},"education":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"schoolCourse":{"type":["string","null"]},"academicYearId":{"type":["integer","null"]},"institutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"institution":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","institutionType","logoUrl"],"additionalProperties":false},"academicYear":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualification":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualificationLevel":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"required":["id","schoolCourse","academicYearId","institutionId","qualificationId","institution","academicYear","qualification","qualificationLevel"],"additionalProperties":false},"connections":{"type":"object","properties":{"followingCount":{"type":"integer","minimum":0},"followersCount":{"type":"integer","minimum":0},"friendsCount":{"type":"integer","minimum":0}},"required":["followingCount","followersCount","friendsCount"],"additionalProperties":false}},"required":["userId","firstName","lastName","userName","birthYear","country","profilePicture","experimentTag","isEmployee","education","connections"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/me/overview":{"get":{"operationId":"getMyProfileOverview","tags":["Profiles"],"summary":"Get the viewer profile overview","description":"Loads the authenticated viewer education identifiers and separately named following, follower, and friend counts for the profile feed.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The viewer profile overview","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"education":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"schoolCourse":{"type":["string","null"]},"academicYearId":{"type":["integer","null"]},"institutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"institution":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","institutionType","logoUrl"],"additionalProperties":false},"academicYear":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualification":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualificationLevel":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"required":["id","schoolCourse","academicYearId","institutionId","qualificationId","institution","academicYear","qualification","qualificationLevel"],"additionalProperties":false},"connections":{"type":"object","properties":{"followingCount":{"type":"integer","minimum":0},"followersCount":{"type":"integer","minimum":0},"friendsCount":{"type":"integer","minimum":0}},"required":["followingCount","followersCount","friendsCount"],"additionalProperties":false}},"required":["userId","education","connections"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/{userId}/summary":{"get":{"operationId":"getProfileSummary","tags":["Profiles"],"summary":"Get a visible profile summary","description":"Loads a visible profile header, including a roster employee stamp, and derives viewer-relative follow relationships from the verified caller identity, never from client-supplied actor data.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The visible profile summary","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"birthYear":{"type":["integer","null"]},"country":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"experimentTag":{"type":["string","null"]},"isEmployee":{"type":"boolean"},"education":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"schoolCourse":{"type":["string","null"]},"academicYearId":{"type":["integer","null"]},"institutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"institution":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","institutionType","logoUrl"],"additionalProperties":false},"academicYear":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualification":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualificationLevel":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"required":["id","schoolCourse","academicYearId","institutionId","qualificationId","institution","academicYear","qualification","qualificationLevel"],"additionalProperties":false},"connections":{"type":"object","properties":{"followingCount":{"type":"integer","minimum":0},"followersCount":{"type":"integer","minimum":0},"friendsCount":{"type":"integer","minimum":0}},"required":["followingCount","followersCount","friendsCount"],"additionalProperties":false},"isFollowedByViewer":{"type":"boolean"},"isFollowingViewer":{"type":"boolean"}},"required":["userId","firstName","lastName","userName","birthYear","country","profilePicture","experimentTag","isEmployee","education","connections","isFollowedByViewer","isFollowingViewer"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/{userId}/education":{"get":{"operationId":"getProfileEducation","tags":["Profiles"],"summary":"Get visible profile education","description":"Loads the requested profile's visible school-tab education record without adding ordering or fallback records.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The visible profile education resource","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"schoolCourse":{"type":["string","null"]},"academicYearId":{"type":["integer","null"]},"institutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"institution":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","institutionType","logoUrl"],"additionalProperties":false},"academicYear":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualification":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualificationLevel":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"required":["id","schoolCourse","academicYearId","institutionId","qualificationId","institution","academicYear","qualification","qualificationLevel"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/{userId}/achievements":{"get":{"operationId":"getProfileAchievements","tags":["Profiles"],"summary":"Get visible profile achievements","description":"Loads the requested profile's badge statistics. Missing statistic values remain null rather than being synthesized.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The visible profile achievement statistics","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"hasStats":{"type":"boolean"},"bestDayStreak":{"type":["integer","null"]},"totalCards":{"type":["integer","null"]},"crowns":{"type":["integer","null"]}},"required":["userId","hasStats","bestDayStreak","totalCards","crowns"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/{userId}/emojis":{"get":{"operationId":"getProfileEmojis","tags":["Profiles"],"summary":"Get visible profile emojis","description":"Loads the requested profile's distinct obtained emojis in the data source's current unspecified order.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The visible profile emojis","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"emojis":{"type":"array","items":{"type":"string"}}},"required":["userId","firstName","lastName","userName","emojis"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/{userId}/overview":{"get":{"operationId":"getProfileOverview","tags":["Profiles"],"summary":"Get a visible profile overview","description":"Loads the requested profile's feed education context and study groups in the data source's current unspecified order.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The visible profile overview","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"education":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"schoolCourse":{"type":["string","null"]},"academicYearId":{"type":["integer","null"]},"institutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"institution":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","institutionType","logoUrl"],"additionalProperties":false},"academicYear":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualification":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualificationLevel":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"required":["id","schoolCourse","academicYearId","institutionId","qualificationId","institution","academicYear","qualification","qualificationLevel"],"additionalProperties":false},"studyGroups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"colour":{"type":"string"},"emoji":{"type":"string"},"userCount":{"type":"integer","minimum":0}},"required":["id","name","colour","emoji","userCount"],"additionalProperties":false}}},"required":["userId","firstName","education","studyGroups"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/profiles/v1/{userId}":{"get":{"operationId":"getProfile","tags":["Profiles"],"summary":"Get a visible profile","description":"Loads the complete visible profile page resource, including privacy state, the roster employee stamp, education, connection counts, and viewer-relative follow relationships.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The visible profile resource","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"birthYear":{"type":["integer","null"]},"country":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"experimentTag":{"type":["string","null"]},"isEmployee":{"type":"boolean"},"education":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"schoolCourse":{"type":["string","null"]},"academicYearId":{"type":["integer","null"]},"institutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"institution":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]},"institutionType":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","institutionType","logoUrl"],"additionalProperties":false},"academicYear":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualification":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"qualificationLevel":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"exclusiveMinimum":0},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"required":["id","schoolCourse","academicYearId","institutionId","qualificationId","institution","academicYear","qualification","qualificationLevel"],"additionalProperties":false},"connections":{"type":"object","properties":{"followingCount":{"type":"integer","minimum":0},"followersCount":{"type":"integer","minimum":0},"friendsCount":{"type":"integer","minimum":0}},"required":["followingCount","followersCount","friendsCount"],"additionalProperties":false},"isFollowedByViewer":{"type":"boolean"},"isFollowingViewer":{"type":"boolean"},"isPrivate":{"type":["boolean","null"]}},"required":["userId","firstName","lastName","userName","birthYear","country","profilePicture","experimentTag","isEmployee","education","connections","isFollowedByViewer","isFollowingViewer","isPrivate"],"additionalProperties":false}}}},"400":{"description":"Invalid profile request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The profile does not exist or is not visible to the authenticated viewer","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Profiles Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The profiles data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILES_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/schedule/v1":{"get":{"operationId":"listScheduleEvents","tags":["Schedule"],"summary":"List the viewer's schedule events in a time window","description":"Events from the authenticated viewer's classes that overlap the window between endsAfter and startsBefore, plus every undated event. Ordered by start; undated events last. The window must be forward and at most 370 days long.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"endsAfter","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"startsBefore","in":"query"}],"responses":{"200":{"description":"Schedule events in display order","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","enum":["syllabus"]},"kind":{"type":"string","enum":["class_meeting","exam","quiz","assignment","no_class","admin_deadline"]},"classId":{"type":["integer","null"],"exclusiveMinimum":0},"title":{"type":"string"},"description":{"type":["string","null"]},"location":{"type":["string","null"]},"weight":{"type":["string","null"]},"timeZone":{"type":["string","null"]},"dateTbd":{"type":"boolean"},"allDay":{"type":"boolean"},"startDate":{"type":["string","null"],"format":"date"},"startTime":{"type":["string","null"],"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endDate":{"type":["string","null"],"format":"date"},"endTime":{"type":["string","null"],"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"opensDate":{"type":["string","null"],"format":"date"},"opensTime":{"type":["string","null"],"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"startsAt":{"type":["string","null"],"format":"date-time"},"endsAt":{"type":["string","null"],"format":"date-time"},"opensAt":{"type":["string","null"],"format":"date-time"}},"required":["id","source","kind","classId","title","description","location","weight","timeZone","dateTbd","allDay","startDate","startTime","endDate","endTime","opensDate","opensTime","startsAt","endsAt","opensAt"]}}},"required":["items"]}}}},"400":{"description":"Invalid Schedule Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Schedule Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The schedule data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SCHEDULE_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/search/v1":{"get":{"operationId":"searchGlobal","tags":["Search"],"summary":"Search every source in one request","description":"Searches every enabled source (or the repeated `source` params) in parallel and answers once, within 2000 ms. Sources that are still running when the source phase ends are reported as `timeout` with no items. Groups with hits are ordered by Jev for this query; when Jev is not needed, fails or misses the budget, they keep a fixed source order and `ordering.reason` says why.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"query","in":"query"},{"schema":{"type":"array","items":{"type":"string","enum":["library","friends","chats","tutor","classes","public_decks","users"]},"minItems":1},"required":false,"name":"source","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":20,"default":8},"required":false,"name":"limitPerSource","in":"query"}],"responses":{"200":{"description":"Result groups in display order","content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"requestId":{"type":"string"},"budgetMs":{"type":"integer","exclusiveMinimum":0},"elapsedMs":{"type":"number","minimum":0},"partial":{"type":"boolean"},"ordering":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","enum":["jev"]},"modelName":{"type":"string","minLength":1}},"required":["method","modelName"]},{"type":"object","properties":{"method":{"type":"string","enum":["default"]},"reason":{"type":"string","enum":["not_needed","timeout","unavailable"]}},"required":["method","reason"]}]},"groups":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["library","friends","chats","tutor","classes","public_decks","users"]},"status":{"type":"string","enum":["ok","empty","error","timeout"]},"elapsedMs":{"type":"number","minimum":0},"score":{"type":["number","null"],"minimum":0,"maximum":1},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","enum":["library","friends","chats","tutor","classes","public_decks","users"]},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"deepLink":{"type":"string"},"rankHint":{"type":"number","minimum":0,"maximum":1}},"required":["id","source","title","subtitle","imageUrl","deepLink","rankHint"]}},"errorCode":{"type":["string","null"]}},"required":["source","status","elapsedMs","score","items","errorCode"]}}},"required":["query","requestId","budgetMs","elapsedMs","partial","ordering","groups"]}}}},"400":{"description":"Invalid global search request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Global search is employee/staging only","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SEARCH_DEV_ONLY"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many global search requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"No search sources are enabled","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SEARCH_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/search/v1/plan":{"post":{"operationId":"planGlobalSearch","tags":["Search"],"summary":"Plan which universal-search indexes to query","description":"Asks Jev which search indexes fit the query (or re-orders sources that already returned hits). Used by universal search before fan-out so only relevant indexes run. Pass searchAll to skip Jev and open every available source.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":100},"availableSources":{"type":"array","items":{"type":"string","enum":["library","friends","chats","tutor","classes","public_decks","users"]},"minItems":1},"searchAll":{"type":"boolean"},"hitSummaries":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["library","friends","chats","tutor","classes","public_decks","users"]},"hitCount":{"type":"integer","minimum":0},"sampleTitles":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":5}},"required":["source","hitCount"]},"maxItems":16}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Ordered search sources for this query","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"string","enum":["library","friends","chats","tutor","classes","public_decks","users"]},"minItems":1},"scores":{"type":"object","additionalProperties":{"type":"number","minimum":0,"maximum":1}},"modelName":{"type":"string","minLength":1},"routingMode":{"type":"string","enum":["routed","all","ranked","explicit"]}},"required":["sources","scores","modelName","routingMode"]}}}},"400":{"description":"Invalid search plan request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Search planning is employee/staging only, or read-only impersonation cannot plan","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["SEARCH_DEV_ONLY"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"Too many search plan requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"No search sources are enabled","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SEARCH_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/share-links/v1/profile-invites":{"post":{"operationId":"mintProfileInviteShareLink","tags":["Share links"],"summary":"Mint a profile invite short link","description":"Mints a permanent profile invite short link for the authenticated sender. A recipient phone, when the invite is an in-app SMS, is stored with the link and is not returned.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"profileUserId":{"type":"integer","exclusiveMinimum":0},"featureId":{"type":"integer","exclusiveMinimum":0},"origin":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"recipientPhone":{"type":"string","minLength":8,"maxLength":32},"smsInvitePhoneShortlink":{"type":"boolean"}},"required":["profileUserId","featureId","origin"]}}}},"responses":{"201":{"description":"The short link","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"code":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{13}$"}},"required":["url","code"]}}}},"400":{"description":"Invalid profile invite","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The authenticated session cannot mint links","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many short links","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"Short links are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["PROFILE_INVITE_SHARE_LINK_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/social/v1/follow-graph-ids":{"get":{"operationId":"getSocialFollowGraphIds","tags":["Social"],"summary":"Get the viewer's follow graph identifiers","description":"Loads the authenticated viewer's following and follower user IDs, ordered from newest follow relationship to oldest. Each relationship includes pairwise friendship weight and per-type interaction counts.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The viewer follow graph as recency-ordered ids plus relationship metrics","content":{"application/json":{"schema":{"type":"object","properties":{"followingIdsByRecency":{"type":"array","items":{"type":"integer","exclusiveMinimum":0}},"followerIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0}},"following":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"totalWeight":{"type":"integer","minimum":0},"interactionCounts":{"type":"array","items":{"type":"object","properties":{"eventType":{"type":"string"},"eventCount":{"type":"integer","minimum":0},"totalWeight":{"type":"integer","minimum":0}},"required":["eventType","eventCount","totalWeight"]}}},"required":["userId","totalWeight","interactionCounts"]}},"followers":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"totalWeight":{"type":"integer","minimum":0},"interactionCounts":{"type":"array","items":{"type":"object","properties":{"eventType":{"type":"string"},"eventCount":{"type":"integer","minimum":0},"totalWeight":{"type":"integer","minimum":0}},"required":["eventType","eventCount","totalWeight"]}}},"required":["userId","totalWeight","interactionCounts"]}}},"required":["followingIdsByRecency","followerIds","following","followers"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The social data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SOCIAL_FOLLOW_GRAPH_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/social/v1/users/{userId}/connections":{"get":{"operationId":"getSocialConnections","tags":["Social"],"summary":"Get a user's social connections","description":"Loads the requested user's visible follow graph, grouped into mutual friends, people they follow, and followers they do not follow back.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The subject user social connections","content":{"application/json":{"schema":{"type":"object","properties":{"subjectUserId":{"type":"integer"},"friends":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"educationalInstitutionId":{"type":["integer","null"]},"followedAt":{"type":["string","null"]}},"required":["userId","firstName","lastName","profilePicture","educationalInstitutionId","followedAt"]}},"followingOnly":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"educationalInstitutionId":{"type":["integer","null"]},"followedAt":{"type":["string","null"]}},"required":["userId","firstName","lastName","profilePicture","educationalInstitutionId","followedAt"]}},"followersOnly":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"educationalInstitutionId":{"type":["integer","null"]}},"required":["userId","firstName","lastName","profilePicture","educationalInstitutionId"]}}},"required":["subjectUserId","friends","followingOnly","followersOnly"]}}}},"400":{"description":"Invalid subject user id","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The social data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SOCIAL_CONNECTIONS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/social/v1/users/{userId}/following":{"get":{"operationId":"getSocialFollowing","tags":["Social"],"summary":"List a user's following","description":"Lists people followed by the requested user, newest relationship first. Optional query filters the list by first name, last name, or handle. Results use offset pagination and include whether the authenticated viewer also follows each person.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"userId","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":["string","null"],"maxLength":100},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"A paginated list of people followed by the subject user","content":{"application/json":{"schema":{"type":"object","properties":{"subjectUserId":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"userId":{"type":"integer"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"displayName":{"type":"string"},"profilePicture":{"type":["string","null"]},"topStreak":{"type":["integer","null"]},"education":{"type":["object","null"],"properties":{"schoolCourse":{"type":["string","null"]},"educationalInstitutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"academicYearId":{"type":["integer","null"]},"academicYearName":{"type":["string","null"]},"educationalInstitutionName":{"type":["string","null"]}},"required":["schoolCourse","educationalInstitutionId","qualificationId","academicYearId","academicYearName","educationalInstitutionName"]}},"required":["userId","firstName","lastName","userName","displayName","profilePicture","topStreak","education"]},"followedAt":{"type":["string","null"]},"viewerIsFollowing":{"type":"boolean"}},"required":["person","followedAt","viewerIsFollowing"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["subjectUserId","items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid pagination or subject user id","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The social data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SOCIAL_FOLLOW_LIST_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/social/v1/users/{userId}/followers":{"get":{"operationId":"getSocialFollowers","tags":["Social"],"summary":"List a user's followers","description":"Lists people following the requested user, newest relationship first. Results use offset pagination and include whether the authenticated viewer follows each person.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"userId","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A paginated list of people following the subject user","content":{"application/json":{"schema":{"type":"object","properties":{"subjectUserId":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"userId":{"type":"integer"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"displayName":{"type":"string"},"profilePicture":{"type":["string","null"]},"topStreak":{"type":["integer","null"]},"education":{"type":["object","null"],"properties":{"schoolCourse":{"type":["string","null"]},"educationalInstitutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"academicYearId":{"type":["integer","null"]},"academicYearName":{"type":["string","null"]},"educationalInstitutionName":{"type":["string","null"]}},"required":["schoolCourse","educationalInstitutionId","qualificationId","academicYearId","academicYearName","educationalInstitutionName"]}},"required":["userId","firstName","lastName","userName","displayName","profilePicture","topStreak","education"]},"followedAt":{"type":["string","null"]},"viewerIsFollowing":{"type":"boolean"}},"required":["person","followedAt","viewerIsFollowing"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["subjectUserId","items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid pagination or subject user id","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The social data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SOCIAL_FOLLOW_LIST_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/social/v1/connections/search":{"get":{"operationId":"searchSocialConnections","tags":["Social"],"summary":"Search the viewer's social connections","description":"Searches the authenticated viewer's followers and following by name or username. Results use offset pagination over follow relationships ordered from newest to oldest.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":["string","null"],"maxLength":100,"default":""},"required":false,"name":"query","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A paginated search over the viewer social connections","content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"userId":{"type":"integer"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"displayName":{"type":"string"},"profilePicture":{"type":["string","null"]},"topStreak":{"type":["integer","null"]},"education":{"type":["object","null"],"properties":{"schoolCourse":{"type":["string","null"]},"educationalInstitutionId":{"type":["integer","null"]},"qualificationId":{"type":["integer","null"]},"academicYearId":{"type":["integer","null"]},"academicYearName":{"type":["string","null"]},"educationalInstitutionName":{"type":["string","null"]}},"required":["schoolCourse","educationalInstitutionId","qualificationId","academicYearId","academicYearName","educationalInstitutionName"]}},"required":["userId","firstName","lastName","userName","displayName","profilePicture","topStreak","education"]},"direction":{"type":"string","enum":["following","follower"]},"followedAt":{"type":["string","null"]}},"required":["person","direction","followedAt"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["query","items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid search or pagination input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The social data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SOCIAL_CONNECTION_SEARCH_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/social/v1/follows":{"post":{"operationId":"createSocialFollows","tags":["Social"],"summary":"Follow users","description":"Creates follow relationships from the authenticated viewer to the requested user IDs. An optional source records where the follow action originated.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"minItems":1,"maxItems":500},"source":{"type":"string","enum":["onboarding","onboarding_follow_all","game_results","game_results_follow_all","live_game_results","live_game_results_follow_all","profile","suggested_friends","search","friends_list","invite_link","share_sheet","messaging","notification","study_group","friend_streak","referral","deck_share","leaderboard"]}},"required":["userIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"The requested follow relationships were processed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Invalid follow request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The authenticated session cannot mutate follows","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the social follow write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The social write service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SOCIAL_FOLLOWS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"delete":{"operationId":"deleteSocialFollows","tags":["Social"],"summary":"Unfollow users","description":"Removes follow relationships from the authenticated viewer to the requested user IDs.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"minItems":1,"maxItems":500}},"required":["userIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"The requested follow relationships were removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Invalid follow request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"The authenticated session cannot mutate follows","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the social follow write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The social write service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["SOCIAL_FOLLOWS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1":{"get":{"operationId":"listStudyGroups","tags":["Study groups"],"summary":"List active study groups for a user","description":"Returns the complete visible list of active study groups for the requested subject user.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"query"}],"responses":{"200":{"description":"Active study groups","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"colour":{"type":["string","null"]},"emoji":{"type":["string","null"]},"userCount":{"type":"integer","minimum":0}},"required":["id","name","colour","emoji","userCount"]}}},"required":["items"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/summary":{"get":{"operationId":"getStudyGroupSummary","tags":["Study groups"],"summary":"Get a study-group summary","description":"Returns only the group identity fields used by the group leaderboard header.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"}],"responses":{"200":{"description":"Study-group summary","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"emoji":{"type":["string","null"]}},"required":["id","name","emoji"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/settings":{"get":{"operationId":"getStudyGroupSettings","tags":["Study groups"],"summary":"Get editable study-group settings","description":"Returns the visible editable settings. Hasura applies the same caller role permissions as the existing edit flow.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"}],"responses":{"200":{"description":"Study-group settings","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"emoji":{"type":["string","null"]},"colour":{"type":["string","null"]},"description":{"type":["string","null"]},"private":{"type":"boolean"}},"required":["id","name","emoji","colour","description","private"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/membership":{"get":{"operationId":"getStudyGroupMembership","tags":["Study groups"],"summary":"Get the viewer's group membership","description":"Returns group identity and the authenticated viewer membership, inferring viewer identity from the verified token.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"}],"responses":{"200":{"description":"Group navigation membership","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"emoji":{"type":["string","null"]},"membership":{"type":["object","null"],"properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"userId":{"type":"integer","exclusiveMinimum":0},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["groupId","userId","role"]}},"required":["id","name","emoji","membership"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/invites/latest":{"get":{"operationId":"getLatestStudyGroupInvite","tags":["Study groups"],"summary":"Get the latest study-group invite","description":"Returns the latest invite ordered by creation time descending, group identity, and the authenticated viewer membership.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"}],"responses":{"200":{"description":"Latest study-group invite","content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"emoji":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["id","name","emoji","colour"]},"membership":{"type":["object","null"],"properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"userId":{"type":"integer","exclusiveMinimum":0},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["groupId","userId","role"]},"invite":{"type":"object","properties":{"inviteId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}},"required":["inviteId","createdAt"]}},"required":["group","membership","invite"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group or latest invite not found","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_INVITE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/members":{"get":{"operationId":"listStudyGroupMembers","tags":["Study groups"],"summary":"List study-group members","description":"Returns visible members by ascending user ID. A full page advertises a next offset even if that next page is empty.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Study-group members","content":{"application/json":{"schema":{"type":"object","properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"items":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"user":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"displayName":{"type":"string"}},"required":["userId","firstName","lastName","userName","profilePicture","displayName"]},"followedByViewer":{"type":"boolean"}},"required":["role","user","followedByViewer"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["groupId","items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/memberships":{"get":{"operationId":"listStudyGroupMemberships","tags":["Study groups"],"summary":"List requested study-group memberships","description":"Returns membership state for the repeated requested user IDs as one complete list.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"},{"schema":{"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"minItems":1},"required":true,"name":"userId","in":"query"}],"responses":{"200":{"description":"Requested memberships","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"userId":{"type":"integer","exclusiveMinimum":0},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["groupId","userId","role"]}}},"required":["items"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/decks":{"get":{"operationId":"listStudyGroupDecks","tags":["Study groups"],"summary":"List attached study-group decks","description":"Returns attached deck cards by ascending deck ID with offset pagination and full-page continuation semantics.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Attached study-group decks","content":{"application/json":{"schema":{"type":"object","properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"items":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"active":{"type":"boolean"},"name":{"type":["string","null"]},"colour":{"type":["string","null"]},"sourceDeckId":{"type":["integer","null"],"exclusiveMinimum":0},"createdAt":{"type":["string","null"],"format":"date-time"},"ownerId":{"type":"integer","exclusiveMinimum":0},"permissionIds":{"type":"array","items":{"type":"integer"}},"cardCount":{"type":["integer","null"],"minimum":0},"cardAttributeCount":{"type":["integer","null"],"minimum":0},"descendantCardCount":{"type":["integer","null"],"minimum":0},"owner":{"type":["object","null"],"properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]}},"required":["userId","firstName","lastName","profilePicture"]}},"required":["deckId","active","name","colour","sourceDeckId","createdAt","ownerId","permissionIds","cardCount","cardAttributeCount","descendantCardCount","owner"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["groupId","items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/eligible-decks":{"get":{"operationId":"listStudyGroupEligibleDecks","tags":["Study groups"],"summary":"List decks eligible for a study group","description":"Lists the authenticated viewer’s active top-level decks ordered by deck ID descending, optionally filtered by name, and marks decks already attached to this group.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Eligible decks","content":{"application/json":{"schema":{"type":"object","properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"items":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer","exclusiveMinimum":0},"colour":{"type":["string","null"]},"name":{"type":["string","null"]},"attached":{"type":"boolean"}},"required":["deckId","colour","name","attached"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["groupId","items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/daily-quiz":{"get":{"operationId":"getStudyGroupDailyQuiz","tags":["Study groups"],"summary":"Get current study-group daily quiz state","description":"Returns the current group quiz and group streak state, preserving refresh timestamps and the configured refresh timezone.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"}],"responses":{"200":{"description":"Daily quiz state","content":{"application/json":{"schema":{"type":"object","properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"deckCount":{"type":"integer","minimum":0},"streak":{"type":["object","null"],"properties":{"createdAt":{"type":["string","null"],"format":"date-time"},"currentStreakHierarchyId":{"type":["integer","null"]},"currentStreakLength":{"type":"integer","minimum":0},"currentStreakType":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"hierarchyId":{"type":"integer"}},"required":["name","hierarchyId"]},"updatedAt":{"type":["string","null"],"format":"date-time"},"maxStreakLength":{"type":"integer","minimum":0}},"required":["createdAt","currentStreakHierarchyId","currentStreakLength","currentStreakType","updatedAt","maxStreakLength"]},"quiz":{"type":["object","null"],"properties":{"id":{"type":"integer","exclusiveMinimum":0},"deckId":{"type":["integer","null"],"exclusiveMinimum":0},"deck":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["name","colour"]},"multiplayerQuiz":{"type":["object","null"],"properties":{"deckId":{"type":["integer","null"],"exclusiveMinimum":0},"id":{"type":"string"},"questions":{"type":"array","items":{"type":"object","properties":{"answers":{"type":"array","items":{"type":"object","properties":{"cardId":{"type":["integer","null"],"exclusiveMinimum":0},"id":{"type":"string"},"questionId":{"type":"string"},"text":{"type":"string"},"type":{"type":"string","enum":["correct","incorrect"]}},"required":["cardId","id","questionId","text","type"]}},"canTypeAnswer":{"type":["boolean","null"]},"cardId":{"type":["integer","null"],"exclusiveMinimum":0},"id":{"type":"string"},"text":{"type":"string"}},"required":["answers","cardId","id","text"]}}},"required":["deckId","id","questions"]},"createdAt":{"type":["string","null"],"format":"date-time"},"nextRefreshAt":{"type":"string","format":"date-time"},"previousRefreshAt":{"type":["string","null"],"format":"date-time"},"refreshError":{"anyOf":[{"type":"string","enum":["MISSING_DATA","MISSING_DECKS","MISSING_CARDS","SERVER_ERROR"]},{"type":"null"},{"type":"null"}]},"refreshStatus":{"type":"string","enum":["PENDING","CREATING","REFRESHING","COMPLETED","ERROR"]},"refreshTime":{"type":"string"},"refreshTimeZone":{"type":"string"},"updatedAt":{"type":["string","null"],"format":"date-time"},"userAnswers":{"type":"array","items":{"type":"object","properties":{"answerId":{"type":["string","null"]},"answerType":{"type":"string","enum":["correct","incorrect","out_of_time"]},"cardId":{"type":["integer","null"],"exclusiveMinimum":0},"id":{"type":"string"},"questionId":{"type":"string"},"timeAllowed":{"type":"number"},"timeTaken":{"type":"number"},"userDisplayName":{"type":"string"},"userId":{"type":"integer","exclusiveMinimum":0},"userProfilePicture":{"type":"string"},"xpEarned":{"type":"number"}},"required":["answerType","cardId","id","questionId","timeAllowed","timeTaken","userDisplayName","userId","userProfilePicture","xpEarned"]}}},"required":["id","deckId","deck","multiplayerQuiz","createdAt","nextRefreshAt","previousRefreshAt","refreshError","refreshStatus","refreshTime","refreshTimeZone","updatedAt","userAnswers"]}},"required":["groupId","deckCount","streak","quiz"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}/streak-history":{"get":{"operationId":"getStudyGroupStreakHistory","tags":["Study groups"],"summary":"Get study-group streak history","description":"Returns the group streak display and history for the inclusive local-date range supplied by the caller.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"},{"schema":{"type":"string","format":"date"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"endDate","in":"query"}],"responses":{"200":{"description":"Study-group streak history","content":{"application/json":{"schema":{"type":"object","properties":{"groupId":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"userCount":{"type":"integer","minimum":0},"currentStreak":{"type":["object","null"],"properties":{"length":{"type":"integer","minimum":0},"typeName":{"type":["string","null"]}},"required":["length","typeName"]},"items":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"streakType":{"type":"object","properties":{"name":{"type":["string","null"]},"hierarchyId":{"type":"integer"}},"required":["name","hierarchyId"]}},"required":["day","streakType"]}}},"required":["groupId","name","userCount","currentStreak","items"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-groups/v1/{studyGroupId}":{"get":{"operationId":"getStudyGroup","tags":["Study groups"],"summary":"Get a study group","description":"Returns the visible group identity, counts, privacy setting, and the first four visible members by ascending user ID.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"studyGroupId","in":"path"}],"responses":{"200":{"description":"Study group","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"description":{"type":["string","null"]},"colour":{"type":["string","null"]},"emoji":{"type":["string","null"]},"userCount":{"type":"integer","minimum":0},"deckCount":{"type":"integer","minimum":0},"private":{"type":"boolean"},"memberSummary":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"integer","exclusiveMinimum":0},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"userName":{"type":["string","null"]},"profilePicture":{"type":["string","null"]},"userHandle":{"type":["string","null"]}},"required":["userId","firstName","lastName","userName","profilePicture","userHandle"]}}},"required":["id","name","description","colour","emoji","userCount","deckCount","private","memberSummary"]}}}},"400":{"description":"Invalid study-group request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Study group not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Study Groups Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study-group data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_GROUP_DATA_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}":{"get":{"operationId":"getStudyNote","tags":["Study notes"],"summary":"Get a study note","description":"Loads the requested study note from its containing deck when it is visible to the authenticated viewer.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"deckId","in":"query"}],"responses":{"200":{"description":"The visible study note","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"body":{"type":"string"},"deckId":{"type":"integer"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","title","body","deckId","createdAt","updatedAt"]}}}},"400":{"description":"Invalid study note request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The study note does not exist or is not visible","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note read limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"patch":{"operationId":"updateStudyNote","tags":["Study notes"],"summary":"Update a study note","description":"Updates the requested study note's title, body, or deck assignment and returns the canonical updated note.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"},"deckId":{"type":"integer"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated study note","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"body":{"type":"string"},"deckId":{"type":"integer"},"ownerId":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","body","deckId","ownerId","createdAt","updatedAt"]}}}},"400":{"description":"Invalid study note request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Permission denied or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_FORBIDDEN"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"Study note not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"423":{"description":"Study note is locked by another user","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_LOCKED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"put":{"operationId":"createStudyNote","tags":["Study notes"],"summary":"Create a study note","description":"Creates a study note with the requested identifier, title, body, and deck assignment and returns the canonical created note.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"},"deckId":{"type":"integer"}},"required":["deckId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Created study note","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"body":{"type":"string"},"deckId":{"type":"integer"},"ownerId":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","body","deckId","ownerId","createdAt","updatedAt"]}}}},"400":{"description":"Invalid study note request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Permission denied or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_FORBIDDEN"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"Study note not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}/permissions":{"get":{"operationId":"getStudyNotePermissions","tags":["Study notes"],"summary":"Get study note permissions","description":"Loads the authenticated viewer permission from the requested study note. A deck hint preserves compatibility for draft notes that do not exist yet.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":false,"name":"deckId","in":"query"}],"responses":{"200":{"description":"The viewer permission for the containing deck","content":{"application/json":{"schema":{"type":"object","properties":{"deckId":{"type":"integer"},"ownerId":{"type":"integer"},"public":{"type":"boolean"},"permission":{"anyOf":[{"type":"string","enum":["view","edit"]},{"type":"null"},{"type":"null"}]}},"required":["deckId","ownerId","public","permission"]}}}},"400":{"description":"Invalid study note request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The study note does not exist or is not visible","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note read limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}/breadcrumbs":{"get":{"operationId":"getStudyNoteBreadcrumbs","tags":["Study notes"],"summary":"Get study note breadcrumbs","description":"Loads the containing deck and its ancestors for a study note visible to the authenticated viewer.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"deckId","in":"query"}],"responses":{"200":{"description":"The containing deck breadcrumb path","content":{"application/json":{"schema":{"type":"object","properties":{"deck":{"type":"object","properties":{"deckId":{"type":"integer"},"name":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["deckId","name","colour"]},"ancestors":{"type":"array","items":{"type":"object","properties":{"deckId":{"type":"integer"},"name":{"type":["string","null"]},"colour":{"type":["string","null"]}},"required":["deckId","name","colour"]}}},"required":["deck","ancestors"]}}}},"400":{"description":"Invalid study note request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The study note does not exist or is not visible","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note read limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}/imports/latest":{"get":{"operationId":"getLatestStudyNoteImport","tags":["Study notes"],"summary":"Get the latest successful study note import","description":"Loads the newest successful card import for a study note in the requested deck.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"required":true,"name":"deckId","in":"query"}],"responses":{"200":{"description":"The latest successful import","content":{"application/json":{"schema":{"type":"object","properties":{"importId":{"type":"integer"},"deckId":{"type":["integer","null"]},"status":{"type":["string","null"]},"createdAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["importId","deckId","status","createdAt","completedAt"]}}}},"400":{"description":"Invalid study note request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The study note is missing or concealed, or no successful import exists for the visible study note","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_IMPORT_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"The caller exceeded the study note read limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note data source is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication dependencies are unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}/archive":{"post":{"operationId":"archiveStudyNote","tags":["Study notes"],"summary":"Archive a study note","description":"Archives the requested study note and returns the canonical archived note.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"}],"responses":{"200":{"description":"Archived study note","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"body":{"type":"string"},"deckId":{"type":"integer"},"ownerId":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","body","deckId","ownerId","createdAt","updatedAt"]}}}},"400":{"description":"Invalid study note request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Permission denied or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_FORBIDDEN"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"Study note not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}/sources":{"post":{"operationId":"createStudyNoteSources","tags":["Study notes"],"summary":"Attach sources to a study note","description":"Creates source records for uploaded files associated with the requested study note and returns their canonical metadata. A source may carry an optional rough transcript (trimmed, at most 200,000 characters; empty is stored as null) and an optional recording duration in whole seconds (0 to 86,400). The response omits both; list sources to read them.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"bucket":{"type":"string"},"originalFilename":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number","minimum":0},"transcript":{"type":"string","maxLength":200000},"durationSeconds":{"type":"integer","minimum":0,"maximum":86400}},"required":["key","bucket"],"additionalProperties":false},"minItems":1}},"required":["sources"],"additionalProperties":false}}}},"responses":{"200":{"description":"Created study note sources","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"studyNoteId":{"type":"string","format":"uuid"},"ownerId":{"type":"integer"},"key":{"type":"string"},"bucket":{"type":"string"},"originalFilename":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"size":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","studyNoteId","ownerId","key","bucket","originalFilename","mimeType","size","createdAt","updatedAt"]}}},"required":["sources"]}}}},"400":{"description":"Invalid study note source request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Permission denied or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_FORBIDDEN"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"Study note not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"get":{"operationId":"listStudyNoteSources","tags":["Study notes"],"summary":"List study note sources","description":"Lists source files attached to a study note visible to the authenticated viewer, newest first (creation time descending, then ID descending). Each source includes a public playback URL, or null when its storage bucket has no public origin, plus its transcript, recording duration in seconds, and the first time notes were generated from it, each null when absent. Results use offset pagination; hasMore is exact.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of study note sources","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"studyNoteId":{"type":"string","format":"uuid"},"ownerId":{"type":"integer"},"key":{"type":"string"},"bucket":{"type":"string"},"originalFilename":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"size":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"url":{"type":["string","null"],"format":"uri"},"transcript":{"type":["string","null"]},"durationSeconds":{"type":["integer","null"]},"notesGeneratedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","studyNoteId","ownerId","key","bucket","originalFilename","mimeType","size","createdAt","updatedAt","url","transcript","durationSeconds","notesGeneratedAt"]}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","exclusiveMinimum":0},"hasMore":{"type":"boolean"},"nextOffset":{"type":["integer","null"],"minimum":0}},"required":["items","offset","limit","hasMore","nextOffset"]}}}},"400":{"description":"Invalid study note source request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The study note does not exist or is not visible","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"The caller exceeded the study note read limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}/sources/{sourceId}":{"delete":{"operationId":"deleteStudyNoteSource","tags":["Study notes"],"summary":"Delete a study note source","description":"Removes a source record from a study note the authenticated caller can edit. The stored file is not deleted because stored files are content-addressed and may back other sources.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"sourceId","in":"path"}],"responses":{"204":{"description":"The study note source was deleted"},"400":{"description":"Invalid study note source request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Permission denied or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_FORBIDDEN"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"The study note does not exist, or the source does not belong to it","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"The caller exceeded the study note write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/study-notes/v1/{noteId}/sources/{sourceId}/notes-generated":{"post":{"operationId":"markStudyNoteSourceNotesGenerated","tags":["Study notes"],"summary":"Mark notes as generated from a study note source","description":"Records that notes were successfully generated from a source on a study note the authenticated caller can edit. Idempotent: the first timestamp is kept and returned on every later call.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"sourceId","in":"path"}],"responses":{"200":{"description":"The stored first notes-generated time","content":{"application/json":{"schema":{"type":"object","properties":{"notesGeneratedAt":{"type":"string","format":"date-time"}},"required":["notesGeneratedAt"]}}}},"400":{"description":"Invalid study note source request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Permission denied or read-only impersonation","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["READ_ONLY_IMPERSONATION"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_FORBIDDEN"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"404":{"description":"The study note does not exist, or the source does not belong to it","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}]}}}},"429":{"description":"The caller exceeded the study note write limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The study note service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["STUDY_NOTE_SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/tournaments/v1/me":{"get":{"operationId":"listMyTournaments","tags":["Tournaments"],"summary":"List the viewer's tournaments","description":"Returns the tournaments the authenticated viewer entered that are live or ended in the last 14 days, latest end first, as one unpaginated `items` list. Each item has the viewer's best score, their current rank and the number of visible entries.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The viewer's recent tournaments","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"tournament":{"type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"country":{"type":"string","minLength":1},"stage":{"type":"string","minLength":1},"board":{"type":["string","null"]},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["live","ended"]}},"required":["id","title","country","stage","board","endsAt","status"],"additionalProperties":false},"bestScore":{"type":"integer"},"rank":{"type":"integer","exclusiveMinimum":0},"count":{"type":"integer","minimum":0}},"required":["tournament","bestScore","rank","count"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Invalid Tournaments Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Tournaments Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The tournament service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["TOURNAMENTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/tournaments/v1/users/{userId}/recent":{"get":{"operationId":"listFriendRecentTournaments","tags":["Tournaments"],"summary":"List a friend's recent tournaments","description":"Returns the tournaments a friend of the authenticated viewer entered that are live or ended in the last 14 days, latest end first, as one unpaginated `items` list, with the friend's best score, rank and the number of visible entries. A user who is not the viewer's friend returns the same 404 as an unknown user.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"exclusiveMinimum":0},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The friend's recent tournaments","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"tournament":{"type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"country":{"type":"string","minLength":1},"stage":{"type":"string","minLength":1},"board":{"type":["string","null"]},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["live","ended"]}},"required":["id","title","country","stage","board","endsAt","status"],"additionalProperties":false},"bestScore":{"type":"integer"},"rank":{"type":"integer","exclusiveMinimum":0},"count":{"type":"integer","minimum":0}},"required":["tournament","bestScore","rank","count"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Invalid Tournaments Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The user does not exist or is not the viewer's friend","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["TOURNAMENT_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Tournaments Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The tournament service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["TOURNAMENTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/tournaments/v1/{tournamentId}/board":{"get":{"operationId":"getTournamentBoard","tags":["Tournaments"],"summary":"Get a tournament board","description":"Returns one tournament board summary for the authenticated viewer. This operation is not paginated. Every row carries its rank on the whole board; an exact tie on score, time and finish time shares a rank. Only entries that are visible now are counted or returned.\n\n`view=all` returns the visible entry count and the top 10 (both shared by every viewer and up to about a minute stale), the viewer's own row (`me`, null when the viewer has not entered), and `window`: up to five rows either side of the viewer, the viewer included, or empty when the viewer has not entered. `aboveCursor` and `belowCursor` are opaque cursors for `getTournamentBoardRows`, continuing above the first and below the last row shown (the window, or the top 10 without one); each is null when nothing lies that way.\n\n`view=friends` returns, in board order, the row of every friend of the viewer who entered and the viewer's own row, in one unpaginated `items` list.\n\nA tournament that does not exist returns 404.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"tournamentId","in":"path"},{"schema":{"type":"string","enum":["all","friends"],"default":"all","description":"`all` is the whole board around the viewer; `friends` is every friend of the viewer, and the viewer, on the board."},"required":false,"description":"`all` is the whole board around the viewer; `friends` is every friend of the viewer, and the viewer, on the board.","name":"view","in":"query"}],"responses":{"200":{"description":"The tournament board summary for the viewer","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"view":{"type":"string","enum":["all"]},"tournament":{"type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"country":{"type":"string","minLength":1},"stage":{"type":"string","minLength":1},"board":{"type":["string","null"]},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["live","ended"]}},"required":["id","title","country","stage","board","endsAt","status"],"additionalProperties":false},"count":{"type":"integer","minimum":0},"top":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"rank":{"type":"integer","exclusiveMinimum":0},"participant":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"userId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","userId","name","avatar"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["player"]},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","name","avatar"],"additionalProperties":false}]},"score":{"type":"integer"},"isMe":{"type":"boolean"}},"required":["key","rank","participant","score","isMe"],"additionalProperties":false}},"me":{"type":["object","null"],"properties":{"key":{"type":"string"},"rank":{"type":"integer","exclusiveMinimum":0},"participant":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"userId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","userId","name","avatar"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["player"]},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","name","avatar"],"additionalProperties":false}]},"score":{"type":"integer"},"isMe":{"type":"boolean"}},"required":["key","rank","participant","score","isMe"],"additionalProperties":false},"window":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"rank":{"type":"integer","exclusiveMinimum":0},"participant":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"userId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","userId","name","avatar"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["player"]},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","name","avatar"],"additionalProperties":false}]},"score":{"type":"integer"},"isMe":{"type":"boolean"}},"required":["key","rank","participant","score","isMe"],"additionalProperties":false}},"aboveCursor":{"type":["string","null"]},"belowCursor":{"type":["string","null"]}},"required":["view","tournament","count","top","me","window","aboveCursor","belowCursor"],"additionalProperties":false},{"type":"object","properties":{"view":{"type":"string","enum":["friends"]},"tournament":{"type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"country":{"type":"string","minLength":1},"stage":{"type":"string","minLength":1},"board":{"type":["string","null"]},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["live","ended"]}},"required":["id","title","country","stage","board","endsAt","status"],"additionalProperties":false},"count":{"type":"integer","minimum":0},"me":{"type":["object","null"],"properties":{"key":{"type":"string"},"rank":{"type":"integer","exclusiveMinimum":0},"participant":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"userId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","userId","name","avatar"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["player"]},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","name","avatar"],"additionalProperties":false}]},"score":{"type":"integer"},"isMe":{"type":"boolean"}},"required":["key","rank","participant","score","isMe"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"rank":{"type":"integer","exclusiveMinimum":0},"participant":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"userId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","userId","name","avatar"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["player"]},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","name","avatar"],"additionalProperties":false}]},"score":{"type":"integer"},"isMe":{"type":"boolean"}},"required":["key","rank","participant","score","isMe"],"additionalProperties":false}}},"required":["view","tournament","count","me","items"],"additionalProperties":false}]}}}},"400":{"description":"Invalid Tournaments Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The tournament does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["TOURNAMENT_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Tournaments Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The tournament service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["TOURNAMENTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/data/tournaments/v1/{tournamentId}/board/rows":{"get":{"operationId":"getTournamentBoardRows","tags":["Tournaments"],"summary":"Page through a tournament board","description":"Cursor pagination over the whole board for the authenticated viewer. Each cursor carries its direction: a page from `aboveCursor` holds the rows just above, and its `nextCursor` continues further up; a page from `belowCursor` holds the rows just below, and its `nextCursor` continues further down. `items` are always in display order, rank ascending, so an upward page reads top to bottom. `nextCursor` is null when the board ends that way. Ranks are on the whole board, and only entries that are visible now are returned. A tournament that does not exist returns 404; a cursor this API did not issue returns 400.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"tournamentId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":512,"description":"Opaque cursor: `aboveCursor` or `belowCursor` from `getTournamentBoard`, or `nextCursor` from a previous page. Required; the first rows come from the board summary."},"required":true,"description":"Opaque cursor: `aboveCursor` or `belowCursor` from `getTournamentBoard`, or `nextCursor` from a previous page. Required; the first rows come from the board summary.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20,"description":"The most rows to return."},"required":false,"description":"The most rows to return.","name":"limit","in":"query"}],"responses":{"200":{"description":"The next rows of the board","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"rank":{"type":"integer","exclusiveMinimum":0},"participant":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"userId":{"type":"integer","exclusiveMinimum":0},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","userId","name","avatar"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["player"]},"name":{"type":["string","null"]},"avatar":{"type":["string","null"]}},"required":["kind","name","avatar"],"additionalProperties":false}]},"score":{"type":"integer"},"isMe":{"type":"boolean"}},"required":["key","rank","participant","score","isMe"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Invalid Tournaments Data API request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"The tournament does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["TOURNAMENT_RESOURCE_NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Too many Tournaments Data API requests","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["code","message"]}}}},"502":{"description":"The tournament service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["TOURNAMENTS_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["AUTHENTICATION_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}}}}}}}},"webhooks":{}}