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

# Get leaderboard 

> Get leaderboard of the top ranking users in your school

Rate limit: Maximum 60 requests in a window of 1m.



## OpenAPI

````yaml https://backend.codedamn.com/webhook/fermion-backend-openapi.yaml post /public/get-school-leaderboard
openapi: 3.0.0
info:
  version: 1.0.0
  title: Fermion Backend API
  description: Documentation for interacting with the Fermion API
  contact:
    name: Fermion Support
    email: support@codedamn.com
servers:
  - url: https://backend.codedamn.com/api
    description: Fermion primary backend server
security: []
externalDocs:
  description: Fermion Docs
  url: https://docs.fermion.app
paths:
  /public/get-school-leaderboard:
    post:
      tags:
        - Gamification
      summary: 'Get leaderboard '
      description: |-
        Get leaderboard of the top ranking users in your school

        Rate limit: Maximum 60 requests in a window of 1m.
      requestBody:
        description: API Request Body
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          data:
                            type: object
                            properties:
                              fermionSchoolId:
                                type: string
                                minLength: 1
                                description: Your school ID
                              period:
                                type: string
                                enum:
                                  - Today
                                  - ThisWeek
                                  - ThisMonth
                                  - AllTime
                                description: >-
                                  The period for which you want to request
                                  leaderboard
                              limit:
                                type: integer
                                minimum: 1
                                maximum: 500
                                description: >-
                                  The number of top users to include in the
                                  leaderboard
                            required:
                              - fermionSchoolId
                              - period
                              - limit
                        required:
                          - data
                    required:
                      - data
              required:
                - data
      responses:
        '200':
          description: API Response Body
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    output:
                      anyOf:
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - ok
                            data:
                              type: object
                              properties:
                                leaderboardUsers:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      rank:
                                        type: integer
                                        minimum: 1
                                        maximum: 500
                                        description: >-
                                          Rank or position of user in the
                                          leaderboard
                                      xpTotal:
                                        type: integer
                                        description: Total XP of the user
                                      xpDeltaInPeriod:
                                        type: integer
                                        description: >-
                                          XP the user gained or lost in the given
                                          period
                                      fermionUserId:
                                        type: string
                                        minLength: 1
                                        description: Internal fermion user ID of the user
                                      saasUserId:
                                        anyOf:
                                          - type: string
                                            minLength: 1
                                          - nullable: true
                                          - nullable: true
                                        description: The user ID of the user in your DB
                                      userCreatedAtIso:
                                        type: string
                                        format: date-time
                                        description: >-
                                          The date when the user joined in ISO
                                          format
                                      name:
                                        type: string
                                        minLength: 2
                                        maxLength: 100
                                        description: Name of the user
                                      username:
                                        type: string
                                        minLength: 3
                                        maxLength: 24
                                        pattern: ^[a-zA-Z0-9]+$
                                        description: Username of the user
                                      profilePicUrl:
                                        type: string
                                        format: uri
                                        description: Profile Photo URL of the user
                                    required:
                                      - rank
                                      - xpTotal
                                      - xpDeltaInPeriod
                                      - fermionUserId
                                      - saasUserId
                                      - userCreatedAtIso
                                      - name
                                      - username
                                      - profilePicUrl
                              required:
                                - leaderboardUsers
                          required:
                            - status
                            - data
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - error
                            errorMessage:
                              type: string
                          required:
                            - status
                            - errorMessage
                  required:
                    - output

````