openapi: 3.1.0 info: title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: Auth description: Browser and mobile authentication endpoints. - name: points description: Points management - name: redemptions description: Robux redemption requests - name: notifications description: User notifications paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /auth/user: get: tags: [Auth] operationId: getCurrentAuthUser summary: Get the currently authenticated user parameters: - $ref: '#/components/parameters/AuthorizationSessionHeader' - $ref: '#/components/parameters/SessionCookie' responses: '200': description: Auth status resolved successfully. content: application/json: schema: $ref: '#/components/schemas/AuthUserEnvelope' /login: get: tags: [Auth] operationId: beginBrowserLogin summary: Start the browser OIDC login flow parameters: - name: returnTo in: query required: false schema: type: string responses: '302': description: Redirect to the OIDC authorization endpoint. /callback: get: tags: [Auth] operationId: handleBrowserLoginCallback summary: Complete the browser OIDC login flow parameters: - name: code in: query required: false schema: type: string - name: state in: query required: false schema: type: string - name: iss in: query required: false schema: type: string format: uri responses: '302': description: Redirect to the returnTo path on success. /logout: get: tags: [Auth] operationId: logoutBrowserSession summary: Clear the session and begin OIDC logout parameters: - $ref: '#/components/parameters/AuthorizationSessionHeader' - $ref: '#/components/parameters/SessionCookie' responses: '302': description: Redirect to the OIDC provider logout URL. /mobile-auth/token-exchange: post: tags: [Auth] operationId: exchangeMobileAuthorizationCode summary: Exchange a mobile OIDC code for a session token requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MobileTokenExchangeRequest' responses: '200': description: Session created successfully. content: application/json: schema: $ref: '#/components/schemas/MobileTokenExchangeSuccess' '400': description: Missing or invalid required fields. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' '401': description: Token did not contain usable claims. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' '500': description: Token exchange failed. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' /mobile-auth/logout: post: tags: [Auth] operationId: logoutMobileSession summary: Delete a mobile session token parameters: - $ref: '#/components/parameters/AuthorizationSessionHeader' responses: '200': description: Logout processed. content: application/json: schema: $ref: '#/components/schemas/LogoutSuccess' /points/me: get: operationId: getMyPoints tags: [points] summary: Get current user's points balance responses: "200": description: Current points content: application/json: schema: $ref: "#/components/schemas/PointsBalance" /points/history: get: operationId: getPointsHistory tags: [points] summary: Get points history for current user responses: "200": description: Points history content: application/json: schema: $ref: "#/components/schemas/PointsHistoryList" /points/adjust: post: operationId: adjustPoints tags: [points] summary: Adjust points for the cousin (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AdjustPointsBody" responses: "200": description: Points adjusted content: application/json: schema: $ref: "#/components/schemas/PointsBalance" /redemptions: get: operationId: listRedemptions tags: [redemptions] summary: List redemption requests (admin sees all, cousin sees own) responses: "200": description: List of redemption requests content: application/json: schema: $ref: "#/components/schemas/RedemptionList" post: operationId: createRedemption tags: [redemptions] summary: Create a redemption request (cousin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateRedemptionBody" responses: "201": description: Redemption request created content: application/json: schema: $ref: "#/components/schemas/Redemption" /redemptions/{id}/review: post: operationId: reviewRedemption tags: [redemptions] summary: Accept or deny a redemption request (admin only) parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReviewRedemptionBody" responses: "200": description: Redemption reviewed content: application/json: schema: $ref: "#/components/schemas/Redemption" /redemptions/{id}/donate: post: operationId: markRedemptionDonated tags: [redemptions] summary: Mark an accepted redemption as donated (admin only) parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Redemption marked as donated content: application/json: schema: $ref: "#/components/schemas/Redemption" /notifications: get: operationId: listNotifications tags: [notifications] summary: Get notifications for current user responses: "200": description: Notifications content: application/json: schema: $ref: "#/components/schemas/NotificationList" /notifications/{id}/read: post: operationId: markNotificationRead tags: [notifications] summary: Mark a notification as read parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Notification marked as read content: application/json: schema: $ref: "#/components/schemas/Notification" /admin/cousin-id: get: operationId: getCousinId tags: [points] summary: Get the cousin's user ID (admin only) responses: "200": description: Cousin user ID content: application/json: schema: $ref: "#/components/schemas/CousinInfo" /admin/set-cousin: post: operationId: setCousinId tags: [points] summary: Set the cousin's user ID (admin only, first time setup) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SetCousinBody" responses: "200": description: Cousin set content: application/json: schema: $ref: "#/components/schemas/CousinInfo" /admin/claim: post: operationId: claimAdmin tags: [points] summary: Claim admin role (only works if no admin is set yet) responses: "200": description: Admin claimed content: application/json: schema: $ref: "#/components/schemas/AdminInfo" components: parameters: AuthorizationSessionHeader: name: Authorization in: header required: false description: Opaque session token — Bearer . schema: type: string SessionCookie: name: sid in: cookie required: false description: Browser session cookie. schema: type: string schemas: HealthStatus: type: object properties: status: type: string required: - status AuthUser: type: object required: [id, email, firstName, lastName, profileImageUrl] properties: id: type: string email: type: [string, 'null'] format: email firstName: type: [string, 'null'] lastName: type: [string, 'null'] profileImageUrl: type: [string, 'null'] AuthUserEnvelope: type: object required: [user] properties: user: oneOf: - $ref: '#/components/schemas/AuthUser' - type: 'null' MobileTokenExchangeRequest: type: object required: [code, code_verifier, redirect_uri, state] properties: code: type: string minLength: 1 code_verifier: type: string minLength: 1 redirect_uri: type: string minLength: 1 format: uri state: type: string minLength: 1 nonce: type: string minLength: 1 MobileTokenExchangeSuccess: type: object required: [token] properties: token: type: string LogoutSuccess: type: object required: [success] properties: success: type: boolean const: true ErrorEnvelope: type: object required: [error] properties: error: type: string PointsBalance: type: object required: [userId, points] properties: userId: type: string points: type: integer PointsHistoryEntry: type: object required: [id, userId, amount, reason, createdAt] properties: id: type: integer userId: type: string amount: type: integer reason: type: string createdAt: type: string format: date-time PointsHistoryList: type: object required: [entries] properties: entries: type: array items: $ref: "#/components/schemas/PointsHistoryEntry" AdjustPointsBody: type: object required: [amount, reason] properties: amount: type: integer reason: type: string Redemption: type: object required: [id, userId, robuxAmount, pointsCost, status, createdAt, donated] properties: id: type: integer userId: type: string robuxAmount: type: integer pointsCost: type: integer status: type: string enum: [pending, accepted, denied] note: type: [string, 'null'] createdAt: type: string format: date-time reviewedAt: type: [string, 'null'] format: date-time donated: type: boolean donatedAt: type: [string, 'null'] format: date-time RedemptionList: type: object required: [redemptions] properties: redemptions: type: array items: $ref: "#/components/schemas/Redemption" CreateRedemptionBody: type: object required: [robuxAmount] properties: robuxAmount: type: integer minimum: 1 ReviewRedemptionBody: type: object required: [action] properties: action: type: string enum: [accept, deny] note: type: [string, 'null'] Notification: type: object required: [id, userId, message, read, createdAt] properties: id: type: integer userId: type: string message: type: string read: type: boolean createdAt: type: string format: date-time NotificationList: type: object required: [notifications] properties: notifications: type: array items: $ref: "#/components/schemas/Notification" CousinInfo: type: object required: [cousinId] properties: cousinId: type: [string, 'null'] adminId: type: [string, 'null'] AdminInfo: type: object required: [adminId] properties: adminId: type: string SetCousinBody: type: object required: [cousinId] properties: cousinId: type: string