> ## 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.

# Register a Team HQ Live Activity

> Authenticated. Registers routing/audience data for an iOS Lock Screen / Dynamic Island match card, keyed per user + fixture + club. Requires UserSettings.liveScoreUpdates consent (403 FORBIDDEN otherwise). `activityId` is minted server-side and returned; the client enters it via OneSignal.LiveActivities.enter. `pushToken` is accepted and persisted but inert today — it exists only for a possible future direct-APNs migration and is never read by dispatch. Android (#697) returns success-nothing-to-register (`{ registered: true, platform: "android", activityId: null, expiresAt: null }`, no row written) after the same game/team/consent checks — Android Live Updates ride ordinary push subscriptions (OneSignal Create-message + NotificationServiceExtension) and need no registration.



## OpenAPI

````yaml /api-reference/openapi.json post /api/events/{gameId}/live-activity
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/events/{gameId}/live-activity:
    post:
      tags:
        - Events
      summary: Register a Team HQ Live Activity
      description: >-
        Authenticated. Registers routing/audience data for an iOS Lock Screen /
        Dynamic Island match card, keyed per user + fixture + club. Requires
        UserSettings.liveScoreUpdates consent (403 FORBIDDEN otherwise).
        `activityId` is minted server-side and returned; the client enters it
        via OneSignal.LiveActivities.enter. `pushToken` is accepted and
        persisted but inert today — it exists only for a possible future
        direct-APNs migration and is never read by dispatch. Android (#697)
        returns success-nothing-to-register (`{ registered: true, platform:
        "android", activityId: null, expiresAt: null }`, no row written) after
        the same game/team/consent checks — Android Live Updates ride ordinary
        push subscriptions (OneSignal Create-message +
        NotificationServiceExtension) and need no registration.
      parameters:
        - name: gameId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - teamId
              properties:
                teamId:
                  type: string
                  description: >-
                    Must be the fixture's homeTeamId or awayTeamId. Decides the
                    card theme and the minted activityId.
                platform:
                  type: string
                  default: ios
                  description: >-
                    ios writes a LiveActivityRegistration row and returns
                    activityId/expiresAt. android returns 200
                    success-nothing-to-register (platform android, null
                    activityId/expiresAt, no row written) after the same
                    game/team/consent checks — Android Live Updates ride
                    ordinary push subscriptions and need no registration. Any
                    other value is 400 VALIDATION_ERROR.
                pushToken:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Accepted and persisted but INERT — never read by dispatch.
                    Exists only for a possible future direct-APNs migration.
      responses:
        '200':
          description: >-
            Registered (iOS), or success-nothing-to-register (Android, platform
            android + null activityId/expiresAt, no row written)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    oneOf:
                      - type: object
                        description: iOS registration
                        properties:
                          registered:
                            type: boolean
                            enum:
                              - true
                          activityId:
                            type: string
                            example: hq:hockey-9001:bos:user_1
                            description: >-
                              Per-user (#558):
                              hq:{gameEventId}:{teamId}:{userId}. Minted
                              server-side; pass it verbatim to
                              OneSignal.LiveActivities.enter.
                          expiresAt:
                            type: string
                            format: date-time
                        required:
                          - registered
                          - activityId
                          - expiresAt
                      - type: object
                        description: >-
                          Android success-nothing-to-register (#697): no row
                          written
                        properties:
                          registered:
                            type: boolean
                            enum:
                              - true
                          platform:
                            type: string
                            enum:
                              - android
                          activityId:
                            type: 'null'
                          expiresAt:
                            type: 'null'
                        required:
                          - registered
                          - platform
                          - activityId
                          - expiresAt
                required:
                  - success
                  - data
        '400':
          description: >-
            VALIDATION_ERROR — teamId missing, or not one of the fixture's two
            clubs
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - error
                  - code
        '401':
          description: UNAUTHORIZED — no valid Clerk session
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - error
                  - code
        '403':
          description: FORBIDDEN — UserSettings.liveScoreUpdates is not enabled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - error
                  - code
        '404':
          description: NOT_FOUND — no such fixture
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - error
                  - code
        '500':
          description: INTERNAL_ERROR
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - error
                  - code
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Clerk session token. Use Authorization: Bearer <token>.'

````