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

# Update a leaderboard



## OpenAPI

````yaml /api-reference/openapi.json patch /projects/{projectId}/leaderboards/{id}
openapi: 3.0.0
info:
  title: EngageFabric API
  description: >-
    EngageFabric is a multi-tenant SaaS gamification framework. This API
    provides endpoints for managing players, tracking events, quests,
    adventures, leaderboards, lobbies, and real-time features.
  version: 1.0.0
  contact:
    name: EngageFabric Support
    url: https://engagefabric.com
    email: support@engagefabric.com
  license:
    name: Proprietary
    url: https://engagefabric.com/terms
servers:
  - url: https://api.engagefabric.com
    description: Production
  - url: http://localhost:3000
    description: Development
security: []
tags:
  - name: auth
    description: Authentication endpoints
  - name: tenants
    description: Tenant management
  - name: projects
    description: Project management
  - name: players
    description: Player management and game state
  - name: events
    description: Event ingestion and tracking
  - name: quests
    description: Quest management and progress
  - name: adventures
    description: Adventure/season management
  - name: leaderboards
    description: Leaderboard rankings
  - name: lobbies
    description: Multiplayer lobby management
  - name: chat
    description: Real-time chat
  - name: rules
    description: Rules engine configuration
paths:
  /projects/{projectId}/leaderboards/{id}:
    patch:
      tags:
        - Leaderboards
      summary: Update a leaderboard
      operationId: LeaderboardController_update
      parameters:
        - name: projectId
          required: true
          in: path
          description: Project ID
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Leaderboard ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLeaderboardDto'
      responses:
        '200':
          description: Leaderboard updated
        '404':
          description: Leaderboard not found
      security:
        - bearer: []
components:
  schemas:
    UpdateLeaderboardDto:
      type: object
      properties:
        name:
          type: string
          description: Leaderboard name
          example: Weekly XP Champions
          maxLength: 255
        description:
          type: string
          description: Leaderboard description
          example: Top players by XP earned this week
        type:
          type: string
          description: Leaderboard type
          enum:
            - GLOBAL
            - SEGMENTED
            - TIME_BOXED
            - SEASONAL
          default: GLOBAL
        metric:
          type: string
          description: Metric to rank by (e.g., "xp", "wins", "points")
          example: xp
          maxLength: 100
        sortOrder:
          type: string
          description: Sort order for rankings
          enum:
            - ASC
            - DESC
          default: DESC
        startDate:
          format: date-time
          type: string
          description: Start date for time-boxed leaderboards
          example: '2025-01-01T00:00:00Z'
        endDate:
          format: date-time
          type: string
          description: End date for time-boxed leaderboards
          example: '2025-01-31T23:59:59Z'
        resetSchedule:
          type: string
          description: Reset schedule for recurring leaderboards
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
            - SEASONAL
        segmentField:
          type: string
          description: Field to segment by (e.g., "metadata.region")
          example: metadata.region
          maxLength: 255
        maxEntries:
          type: number
          description: Maximum entries to track
          default: 1000
          minimum: 10
          maximum: 100000
        minScore:
          type: number
          description: Minimum score to appear on leaderboard
          example: 0
        showTopN:
          type: number
          description: Number of top entries to show by default
          default: 100
          minimum: 1
          maximum: 1000
        iconUrl:
          type: string
          description: Icon URL for the leaderboard
          example: https://cdn.example.com/icons/trophy.png
        metadata:
          type: object
          description: Additional metadata
          example:
            theme: gold
            category: competitive
        status:
          type: string
          description: Leaderboard status
          enum:
            - DRAFT
            - ACTIVE
            - PAUSED
            - ARCHIVED
        isActive:
          type: boolean
          description: Whether the leaderboard is active

````