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

# User rewards analytics

> Get user-level reward analytics including portfolio, behavior patterns, and historical performance



## OpenAPI

````yaml /openapi/analytics.json get /rewards/stats/users
openapi: 3.1.0
info:
  title: Nudj Analytics API
  version: 1.0.0
servers:
  - url: https://{subdomain}.nudj.cx/api/v2/analytics
    description: Organization API Server
    variables:
      subdomain:
        description: Your organization's subdomain (required)
        default: your-org
security: []
paths:
  /rewards/stats/users:
    get:
      tags:
        - Reward
      summary: User rewards analytics
      description: >-
        Get user-level reward analytics including portfolio, behavior patterns,
        and historical performance
      operationId: getUsersRewards
      parameters:
        - in: query
          name: communityId
          schema:
            type: string
        - in: query
          name: userId
          schema:
            type: string
        - in: query
          name: startDate
          schema:
            type: string
        - in: query
          name: endDate
          schema:
            type: string
        - in: query
          name: skip
          schema:
            type: integer
            minimum: 0
            default: 0
          required: false
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
          required: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        userId:
                          type: string
                        username:
                          type: string
                        portfolio:
                          type: object
                          properties:
                            assetsOwned:
                              type: number
                            assetsRedeemed:
                              type: number
                            entriesHeld:
                              type: number
                            giveawaysWon:
                              type: number
                            totalRewardValue:
                              type: number
                          required:
                            - assetsOwned
                            - assetsRedeemed
                            - entriesHeld
                            - giveawaysWon
                            - totalRewardValue
                        behavior:
                          type: object
                          properties:
                            avgTimeToRedeem:
                              type: number
                            redemptionRate:
                              type: number
                            giveawayParticipationRate:
                              type: number
                            favoriteRewardType:
                              type: string
                            lastRewardActivity:
                              type:
                                - string
                                - 'null'
                              format: date-time
                          required:
                            - avgTimeToRedeem
                            - redemptionRate
                            - giveawayParticipationRate
                            - favoriteRewardType
                            - lastRewardActivity
                        history:
                          type: object
                          properties:
                            totalAssetsEarned:
                              type: number
                            totalEntriesEarned:
                              type: number
                            winLossRatio:
                              type: number
                            lifetimeValue:
                              type: number
                          required:
                            - totalAssetsEarned
                            - totalEntriesEarned
                            - winLossRatio
                            - lifetimeValue
                      required:
                        - userId
                        - username
                        - portfolio
                        - behavior
                        - history
                  pagination:
                    type: object
                    properties:
                      total:
                        type: number
                      skip:
                        type: number
                      limit:
                        type: number
                    required:
                      - total
                      - skip
                      - limit
                required:
                  - data
                  - pagination
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
components:
  schemas:
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []

````