> ## Documentation Index
> Fetch the complete documentation index at: https://docs.d-sports.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a server-authoritative game action

> Applies input to the session. Outcome is computed on the server. prize-wheel-spin accepts { type: "spin" } only; the client never chooses the segment. A sixth daily spin returns 409 GAME_ATTEMPTS_EXHAUSTED. guess-the-player accepts { playerId: string }; the answer is server-held and never returned in the first session scenario. A sixth guess returns 409 GAME_ATTEMPTS_EXHAUSTED. Terminal sessions return 409 GAME_ALREADY_PLAYED on restart.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/engage/games/{gameKey}/session/{sessionId}/action
openapi: 3.1.0
info:
  title: D-Sports API
  description: >-
    Public API for the D-Sports fan engagement platform (PWA backend). Most
    endpoints require Clerk Bearer authentication.
  version: 1.0.0
servers:
  - url: https://app.d-sports.org
    description: Production
  - url: http://localhost:3004
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Authentication and token exchange
  - name: Logout
    description: Session logout
  - name: Mobile auth
    description: OAuth flow for native apps
  - name: Teams
    description: Teams list and follow/unfollow
  - name: Leaderboard
    description: Leaderboards, seasons, winners, stats
  - name: Locker room
    description: Social feed posts, comments, reactions
  - name: Packs
    description: Packs list, purchase, open
  - name: User
    description: Profile, onboarding, follow, search, privacy
  - name: Quests
    description: Quests and progress
  - name: Rewards
    description: Rewards claim and redeem
  - name: Wallets
    description: Wallets and coin prices
  - name: Checkout
    description: Crypto and D-Sports Cash checkout
  - name: D-Sports Cash
    description: D-Sports Cash balance
  - name: Dashboard
    description: Dashboard stats and balance
  - name: Products
    description: Products and packs catalog
  - name: Webhooks
    description: RevenueCat webhook
  - name: Misc
    description: Image proxy, crypto prices, upload, feedback
  - name: Auth and onboarding
    description: Domain grouping for auth, profile, onboarding, and identity flows
  - name: Social and locker room
    description: Domain grouping for social feed, follows, and community interactions
  - name: Gamification
    description: >-
      Domain grouping for quests, leaderboards, points-facing outcomes, and
      rewards
  - name: Commerce and purchases
    description: >-
      Domain grouping for checkout, cash balance, webhooks, and store purchase
      flows
  - name: Collectibles and packs
    description: Domain grouping for pack lifecycle and collectible inventory
  - name: Wallet and web3
    description: Domain grouping for wallet and crypto-support operations
  - name: Moderation and reporting
    description: >-
      Domain grouping for user-facing report submission and moderation-adjacent
      endpoints
  - name: Platform and infrastructure
    description: >-
      Domain grouping for utility, infrastructure, and platform support
      endpoints
  - name: Rep
    description: Fan / Club / Player / Direct Rep earn, breakdown, and ledger
  - name: Engage
    description: Engage-domain Rep and related mobile contracts
  - name: Admin
    description: Staff-only admin operations
  - name: Binders
    description: Digital binder inventory, PIN, and card transfer
  - name: Games
    description: Team mini-game catalog and play routes
  - name: Game Engine
    description: Engage native catalog and server-authoritative daily session lifecycle
  - name: Events
    description: Game schedule, Game Center, chat, presence, and ratings
  - name: Notifications
    description: Authenticated in-app inbox
  - name: Config
    description: Public catalogs and support matrices
  - name: Discovery
    description: Suggested fans and teams
  - name: Leagues
    description: League metadata and branding
  - name: Marketplace
    description: Listings, bids, offers, cart, and shop merchandising
  - name: KYC
    description: Identity verification session helpers
paths:
  /api/v1/engage/games/{gameKey}/session/{sessionId}/action:
    post:
      tags:
        - Games
        - Game Engine
        - Engage
      summary: Submit a server-authoritative game action
      description: >-
        Applies input to the session. Outcome is computed on the server.
        prize-wheel-spin accepts { type: "spin" } only; the client never chooses
        the segment. A sixth daily spin returns 409 GAME_ATTEMPTS_EXHAUSTED.
        guess-the-player accepts { playerId: string }; the answer is server-held
        and never returned in the first session scenario. A sixth guess returns
        409 GAME_ATTEMPTS_EXHAUSTED. Terminal sessions return 409
        GAME_ALREADY_PLAYED on restart.
      parameters:
        - name: gameKey
          in: path
          required: true
          schema:
            type: string
        - name: sessionId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - input
              properties:
                input:
                  anyOf:
                    - $ref: '#/components/schemas/PrizeWheelSpinActionInput'
                    - $ref: '#/components/schemas/GuessThePlayerActionInput'
                    - type: object
                sequenceNumber:
                  type: integer
                  minimum: 1
      responses:
        '200':
          description: '{ outcome, session }'
          content:
            application/json:
              schema:
                type: object
                properties:
                  outcome:
                    anyOf:
                      - $ref: '#/components/schemas/PrizeWheelSpinActionOutcome'
                      - $ref: '#/components/schemas/GuessThePlayerActionOutcome'
                      - type: object
                  session:
                    type: object
        '400':
          description: VALIDATION_ERROR
        '401':
          description: UNAUTHORIZED
        '404':
          description: NOT_FOUND
        '409':
          description: CONFLICT, GAME_ATTEMPTS_EXHAUSTED
      security:
        - bearerAuth: []
components:
  schemas:
    PrizeWheelSpinActionInput:
      type: object
      description: prize-wheel-spin action input. The client never chooses the segment.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - spin
      additionalProperties: true
    GuessThePlayerActionInput:
      type: object
      description: guess-the-player action input. The answer is server-held.
      required:
        - playerId
      properties:
        playerId:
          type: string
          minLength: 1
    PrizeWheelSpinActionOutcome:
      type: object
      required:
        - id
        - label
        - segmentId
        - kind
        - pointsAwarded
        - collected
        - weeklyBonusClaimed
        - spinsUsed
        - spinsRemaining
        - presentOutcome
      properties:
        id:
          type: string
        label:
          type: string
        segmentId:
          type: string
        kind:
          type: string
          enum:
            - coin
            - collect
        pointsAwarded:
          type: integer
        collected:
          type: object
          additionalProperties:
            type: integer
        weeklyBonusAwarded:
          type: integer
        weeklyBonusClaimed:
          type: boolean
        spinsUsed:
          type: integer
        spinsRemaining:
          type: integer
        presentOutcome:
          type: object
          required:
            - angle
            - segmentId
          properties:
            angle:
              type: number
            segmentId:
              type: string
    GuessThePlayerActionOutcome:
      type: object
      required:
        - id
        - label
        - correct
        - attemptsUsed
        - clues
        - status
      properties:
        id:
          type: string
        label:
          type: string
          enum:
            - correct
            - incorrect
        correct:
          type: boolean
        attemptsUsed:
          type: integer
        clues:
          type: array
          items:
            type: object
            required:
              - id
              - label
              - value
              - revealed
            properties:
              id:
                type: string
              label:
                type: string
              value:
                type: string
              revealed:
                type: boolean
        status:
          type: string
          enum:
            - ACTIVE
            - WON
            - LOST
        pointsAwarded:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Clerk session token. Use Authorization: Bearer <token>.'

````