> ## 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 live event session stats 

> Get stream and viewer stats for a live event session

Authentication with the "FERMION-API-KEY" header is required to use this endpoint.

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



## OpenAPI

````yaml https://backend.codedamn.com/webhook/fermion-backend-openapi.yaml post /public/get-live-event-session-stats
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-live-event-session-stats:
    post:
      tags:
        - Live
      summary: 'Get live event session stats '
      description: >-
        Get stream and viewer stats for a live event session


        Authentication with the "FERMION-API-KEY" header is required to use this
        endpoint.


        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:
                          liveEventSessionId:
                            type: string
                            description: >-
                              ID of liveEventSession - You will find this in
                              your dashboard
                          topUserCount:
                            type: number
                            minimum: 0
                            maximum: 1000
                            description: >-
                              Number of top users (by watch time) to be returned
                              in the response
                        required:
                          - liveEventSessionId
                          - topUserCount
                    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:
                                estimatedStreamDurationInMinutes:
                                  type: number
                                streamStartedAt:
                                  type: string
                                  format: date-time
                                streamEndedAt:
                                  anyOf:
                                    - type: string
                                      format: date-time
                                    - nullable: true
                                    - nullable: true
                                totalMessagesSentCount:
                                  type: number
                                instructorMessagesSentCount:
                                  type: number
                                pollsConductedCount:
                                  type: number
                                uniqueUsersCount:
                                  type: number
                                currentActivelyWatchingDistinctUserCount:
                                  type: number
                                peakConcurrentUsers:
                                  type: number
                                streamSegmentData:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      startAtIso:
                                        type: string
                                      endAtIso:
                                        type: string
                                      activelyWatchingDistinctUserCount:
                                        type: number
                                    required:
                                      - startAtIso
                                      - endAtIso
                                      - activelyWatchingDistinctUserCount
                                topUsersByWatchTime:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      fermionInternalUserId:
                                        type: string
                                        description: >-
                                          This is fermion's internal unique ID for
                                          a user
                                      userId:
                                        anyOf:
                                          - type: string
                                            description: >-
                                              This is a string that you have stored in
                                              your database that can uniquely identify
                                              a given user. This is the same as the ID
                                              that you provided if you added a
                                              participant with the API.
                                          - nullable: true
                                          - nullable: true
                                      email:
                                        anyOf:
                                          - type: string
                                            format: email
                                          - nullable: true
                                          - nullable: true
                                      name:
                                        type: string
                                      username:
                                        type: string
                                      profilePicUrl:
                                        type: string
                                        format: uri
                                      segmentsWatchedCount:
                                        type: number
                                      firstSeenAt:
                                        type: string
                                        format: date-time
                                        description: >-
                                          The timestamp when the user first
                                          started watching the stream.
                                      lastSeenAt:
                                        type: string
                                        format: date-time
                                        description: >-
                                          The timestamp when the user was watching
                                          the stream for the last time.
                                    required:
                                      - fermionInternalUserId
                                      - userId
                                      - email
                                      - name
                                      - username
                                      - profilePicUrl
                                      - segmentsWatchedCount
                                      - firstSeenAt
                                      - lastSeenAt
                              required:
                                - estimatedStreamDurationInMinutes
                                - streamStartedAt
                                - streamEndedAt
                                - totalMessagesSentCount
                                - instructorMessagesSentCount
                                - pollsConductedCount
                                - uniqueUsersCount
                                - currentActivelyWatchingDistinctUserCount
                                - peakConcurrentUsers
                                - streamSegmentData
                                - topUsersByWatchTime
                          required:
                            - status
                            - data
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - error
                            errorMessage:
                              type: string
                          required:
                            - status
                            - errorMessage
                  required:
                    - output
      security:
        - FERMION-API-KEY: []
components:
  securitySchemes:
    FERMION-API-KEY:
      name: FERMION-API-KEY
      type: apiKey
      in: header

````