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

# Update Leaderboard Definition

> Updates a leaderboard definition.

Allowed entity token types: title, game_server

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| LeaderboardSizeLimitExceeded | 1575 |
| MaxQueryableVersionsExceeded | 23015 |
| MaxQueryableVersionsValueNotAllowedForTier | 1591 |
| PlayFabErrorEventNotSupportedForEntityType | 23013 |
| ResetIntervalCannotBeModified | 1598 |




## OpenAPI

````yaml post /Leaderboard/UpdateLeaderboardDefinition
openapi: 3.0.0
info:
  version: '260922'
  title: PlayFab Progression API
  description: Manage entity statistics Manage entity leaderboards
  termsOfService: https://playfab.com/terms/
  contact:
    url: https://community.playfab.com/index.html
  license:
    name: Apache 2.0
    url: https://github.com/PlayFab/API_Specs/blob/master/LICENSE
servers:
  - url: https://{titleId}.playfabapi.com
    description: PlayFab title endpoint
    variables:
      titleId:
        default: your_title_id
        description: Your PlayFab title ID (hex).
security: []
tags:
  - name: Leaderboards
    description: Leaderboards APIs
  - name: Statistics
    description: Statistics APIs
paths:
  /Leaderboard/UpdateLeaderboardDefinition:
    post:
      tags:
        - Leaderboards
      summary: Update Leaderboard Definition
      description: |
        Updates a leaderboard definition.

        Allowed entity token types: title, game_server

        ## Error codes

        This operation may return the following PlayFab errors:

        | Error | Code |
        | --- | --- |
        | LeaderboardSizeLimitExceeded | 1575 |
        | MaxQueryableVersionsExceeded | 23015 |
        | MaxQueryableVersionsValueNotAllowedForTier | 1591 |
        | PlayFabErrorEventNotSupportedForEntityType | 23013 |
        | ResetIntervalCannotBeModified | 1598 |
      operationId: UpdateLeaderboardDefinition
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLeaderboardDefinitionRequest'
      responses:
        '200':
          $ref: '#/components/responses/EmptyResponse'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security:
        - EntityToken: []
components:
  schemas:
    UpdateLeaderboardDefinitionRequest:
      type: object
      properties:
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        EventEmissionConfig:
          allOf:
            - $ref: '#/components/schemas/LeaderboardEventEmissionConfig'
          description: >-
            [In Preview]: The configuration for the events emitted by this
            leaderboard. If not specified, no events will be emitted.
        Name:
          description: The name of the leaderboard to update the definition for.
          type: string
        SizeLimit:
          description: Maximum number of entries on this leaderboard
          type: number
          x-actualtype: int32
        VersionConfiguration:
          allOf:
            - $ref: '#/components/schemas/VersionConfiguration'
          description: The version reset configuration for the leaderboard definition.
      required:
        - Name
      example:
        Name: HighestScoresByLevel
        VersionConfiguration:
          MaxQueryableVersions: 1
        SizeLimit: 1000
        EventEmissionConfig:
          VersionEndConfig: {}
          EntityRankOnVersionEndConfig:
            RankLimit: 1
    LeaderboardEventEmissionConfig:
      type: object
      properties:
        EntityRankOnVersionEndConfig:
          allOf:
            - $ref: '#/components/schemas/LeaderboardEntityRankOnVersionEndConfig'
          description: >-
            This event emits the top ranks of the leaderboard when the
            leaderboard version end.
        VersionEndConfig:
          allOf:
            - $ref: '#/components/schemas/LeaderboardVersionEndConfig'
          description: This event is emitted when the leaderboard version end.
    VersionConfiguration:
      type: object
      properties:
        MaxQueryableVersions:
          description: >-
            The maximum number of versions of this leaderboard/statistic that
            can be queried. 
          type: number
          x-actualtype: int32
        ResetInterval:
          allOf:
            - $ref: '#/components/schemas/ResetInterval'
          description: >-
            Reset interval that statistics or leaderboards will reset on. When
            using Manual intervalthe reset can only be increased by calling the
            Increase version API. When using Hour interval the resetwill occur
            at the start of the next hour UTC time. When using Day interval the
            reset will occur at thestart of the next day in UTC time. When using
            the Week interval the reset will occur at the start ofthe next
            Monday in UTC time. When using Month interval the reset will occur
            at the start of the nextmonth in UTC time.
      required:
        - ResetInterval
        - MaxQueryableVersions
    EmptyResponse:
      type: object
      properties: {}
    ApiErrorWrapper:
      description: The basic wrapper around every failed API response
      type: object
      properties:
        code:
          description: Numerical HTTP code
          type: integer
        status:
          description: String HTTP code
          type: string
        error:
          description: Playfab error code
          type: string
        errorCode:
          description: Numerical PlayFab error code
          type: integer
        errorMessage:
          description: Description for the PlayFab errorCode
          type: string
        errorDetails:
          description: Detailed description of individual issues with the request object
          type: object
      required:
        - code
        - errorCode
    LeaderboardEntityRankOnVersionEndConfig:
      type: object
      properties:
        EventType:
          allOf:
            - $ref: '#/components/schemas/EventType'
          description: The type of event to emit when the leaderboard version end.
        RankLimit:
          description: >-
            The maximum number of entity to return on leaderboard version end.
            Range is 1 to 1000.
          type: number
          x-actualtype: int32
      required:
        - EventType
        - RankLimit
    LeaderboardVersionEndConfig:
      type: object
      properties:
        EventType:
          allOf:
            - $ref: '#/components/schemas/EventType'
          description: The type of event to emit when the leaderboard version end.
      required:
        - EventType
    ResetInterval:
      type: string
      enum:
        - Manual
        - Hour
        - Day
        - Week
        - Month
    EventType:
      type: string
      enum:
        - None
        - Telemetry
        - PlayStream
  responses:
    EmptyResponse:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                description: >-
                  The Http status code. If X-ReportErrorAsSuccess header is set
                  to true, this will report the actual http error code.
              status:
                type: string
                description: The Http status code as a string.
              data:
                $ref: '#/components/schemas/EmptyResponse'
    ApiErrorWrapper:
      description: This is the outer wrapper for all responses with errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorWrapper'
  securitySchemes:
    EntityToken:
      type: apiKey
      in: header
      name: X-EntityToken
      description: >-
        This API requires an Entity Session Token, available from the Entity
        GetEntityToken method.

````

## Related topics

- [Update Leaderboard Definition](/api-reference/leaderboards/update-leaderboard-definition.md)
- [PFLeaderboardsUpdateLeaderboardDefinitionAsync](/services/playfab/api-references/c/pfleaderboards/functions/pfleaderboardsupdateleaderboarddefinitionasync.md)
- [PFLeaderboardsUpdateLeaderboardDefinitionRequest](/services/playfab/api-references/c/pfleaderboardstypes/structs/pfleaderboardsupdateleaderboarddefinitionrequest.md)
- [API Leaderboard reference](/services/playfab/community/leaderboards/api-reference.md)
- [Services C API overview - PFLeaderboardsTypes.h](/services/playfab/api-references/c/pfleaderboardstypes/pfleaderboardstypes_members.md)
