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

# Get Team Statistics

> Returns combined usage statistics for a team, including license counts, request metrics,
top countries, top products, and recent activity.

Results are cached for 15 minutes per team.




## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/dev/teams/{teamId}/statistics
openapi: 3.0.1
info:
  title: Lukittu API
  description: >
    The Lukittu API provides comprehensive license management and verification
    services for software products.


    ## Authentication


    **Client Endpoints** (`/api/v1/client/*`): No authentication required. These
    are public endpoints for license verification.


    **Developer Endpoints** (`/api/v1/dev/*`): Require API key authentication
    via Bearer token.


    ## API Types


    - **Client API**: Used by your software to verify licenses, send heartbeats,
    and download releases

    - **Developer API**: Used for programmatic license management from your
    backend systems


    ## Rate Limiting


    All endpoints are rate-limited to prevent abuse. If you exceed the rate
    limit, you'll receive a 429 status code.


    ## Response Format


    All responses follow a consistent format with `data` and `result` objects:


    ```json

    {
      "data": {}, // Response data (null for errors)
      "result": {
        "timestamp": "2023-09-15T14:30:00Z",
        "valid": true,
        "details": "Human-readable message",
        "code": "SUCCESS_CODE" // Optional error/success code
      }
    }

    ```
  version: 1.0.0
  contact:
    name: Lukittu Community
    url: https://discord.lukittu.com
servers:
  - url: https://app.lukittu.com
    description: Production server
security: []
tags:
  - name: Client - Verify
    description: >
      Client endpoints for license verification, heartbeat monitoring, and file
      downloads.

      These endpoints are used directly by your software applications.
  - name: Dev - Licenses
    description: |
      Developer endpoints for license management operations.
      These endpoints require API key authentication.
  - name: Dev - Customers
    description: |
      Developer endpoints for customer management operations.
      These endpoints require API key authentication.
  - name: Dev - Releases
    description: |
      Developer endpoints for release management operations.
      These endpoints require API key authentication.
  - name: Dev - Statistics
    description: |
      Developer endpoints for retrieving team usage statistics.
      These endpoints require API key authentication.
paths:
  /api/v1/dev/teams/{teamId}/statistics:
    get:
      tags:
        - Dev - Statistics
      summary: Get Team Statistics
      description: >
        Returns combined usage statistics for a team, including license counts,
        request metrics,

        top countries, top products, and recent activity.


        Results are cached for 15 minutes per team.
      operationId: getTeamStatistics
      parameters:
        - $ref: '#/components/parameters/TeamId'
      responses:
        '200':
          description: Statistics retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      overview:
                        type: object
                        properties:
                          totalLicenses:
                            type: integer
                            description: Total number of licenses for the team
                          totalCustomers:
                            type: integer
                            description: Total number of customers for the team
                          totalProducts:
                            type: integer
                            description: Total number of products for the team
                          activeLicenses:
                            type: integer
                            description: Number of licenses active in the last hour
                          totalRequests:
                            type: integer
                            description: Total requests in the last 30 days
                      requests:
                        type: object
                        properties:
                          total:
                            type: integer
                            description: Total requests in the last 30 days
                          successful:
                            type: integer
                            description: Successful (VALID) requests in the last 30 days
                          failed:
                            type: integer
                            description: Failed (non-VALID) requests in the last 30 days
                          successRate:
                            type: number
                            format: float
                            description: Percentage of successful requests
                          byType:
                            type: object
                            description: Request counts grouped by type
                            additionalProperties:
                              type: integer
                            example:
                              VERIFY: 8500
                              HEARTBEAT: 3200
                              DOWNLOAD: 750
                      topCountries:
                        type: array
                        description: Top 10 countries by request count (last 30 days)
                        items:
                          type: object
                          properties:
                            country:
                              type: string
                              description: Country name
                            alpha3:
                              type: string
                              description: ISO 3166-1 alpha-3 country code
                            alpha2:
                              type: string
                              description: ISO 3166-1 alpha-2 country code
                            requests:
                              type: integer
                              description: Number of requests from this country
                      topProducts:
                        type: array
                        description: Top 5 products by license count
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: Product UUID
                            name:
                              type: string
                              description: Product name
                            licenses:
                              type: integer
                              description: Number of licenses for this product
                      recentActivity:
                        type: object
                        properties:
                          last24h:
                            type: integer
                            description: Request count in the last 24 hours
                          last7d:
                            type: integer
                            description: Request count in the last 7 days
                          last30d:
                            type: integer
                            description: Request count in the last 30 days
                  result:
                    $ref: '#/components/schemas/StandardResult'
              example:
                data:
                  overview:
                    totalLicenses: 150
                    totalCustomers: 45
                    totalProducts: 8
                    activeLicenses: 32
                    totalRequests: 12450
                  requests:
                    total: 12450
                    successful: 11200
                    failed: 1250
                    successRate: 89.96
                    byType:
                      VERIFY: 8500
                      HEARTBEAT: 3200
                      DOWNLOAD: 750
                  topCountries:
                    - country: United States of America
                      alpha3: USA
                      alpha2: US
                      requests: 5200
                    - country: Germany
                      alpha3: DEU
                      alpha2: DE
                      requests: 2100
                  topProducts:
                    - id: 789e0123-e89b-12d3-a456-426614174222
                      name: My Product
                      licenses: 50
                  recentActivity:
                    last24h: 850
                    last7d: 4200
                    last30d: 12450
                result:
                  timestamp: '2023-09-15T14:30:00Z'
                  valid: true
                  details: Statistics retrieved
        4XX:
          $ref: '#/components/responses/StandardError'
        5XX:
          $ref: '#/components/responses/StandardError'
      security:
        - bearerAuth: []
components:
  parameters:
    TeamId:
      name: teamId
      in: path
      required: true
      description: >-
        Your team's UUID. You can find this value in your team's settings on the
        Lukittu dashboard.
      schema:
        $ref: '#/components/schemas/UUID'
      example: 123e4567-e89b-12d3-a456-426614174000
  schemas:
    StandardResult:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the response was generated
        valid:
          type: boolean
          description: Indicates whether the operation was successful
        details:
          type: string
          description: Human-readable description of the result
      required:
        - timestamp
        - valid
        - details
    UUID:
      type: string
      format: uuid
      description: UUID v4 identifier
    ErrorResponse:
      type: object
      properties:
        data:
          type: object
          description: Additional error-related data
          nullable: true
        result:
          allOf:
            - $ref: '#/components/schemas/StandardResult'
            - type: object
              properties:
                valid:
                  type: boolean
                  enum:
                    - false
                  description: Always false for error responses
                code:
                  type: string
                  description: Error code indicating the specific issue
                  enum:
                    - INTERNAL_SERVER_ERROR
                    - BAD_REQUEST
                    - LICENSE_NOT_FOUND
                    - IP_LIMIT_REACHED
                    - HWID_LIMIT_REACHED
                    - PRODUCT_NOT_FOUND
                    - CUSTOMER_NOT_FOUND
                    - LICENSE_EXPIRED
                    - LICENSE_SUSPENDED
                    - TEAM_NOT_FOUND
                    - RATE_LIMIT
                    - HARDWARE_IDENTIFIER_BLACKLISTED
                    - COUNTRY_BLACKLISTED
                    - IP_BLACKLISTED
                    - RELEASE_NOT_FOUND
                    - FORBIDDEN
                    - UNAUTHORIZED
                    - INVALID_SESSION_KEY
                    - NO_ACCESS_TO_RELEASE
                    - RELEASE_ARCHIVED
                    - RELEASE_DRAFT
              required:
                - code
      required:
        - result
  responses:
    StandardError:
      description: >
        Standard API error response. All errors follow the same `{data, result}`
        structure.

        The HTTP status code indicates the general error category, while
        `result.code` provides specific error details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: apiKey
      description: >
        API key authentication for development endpoints.


        You can create API keys in your team's settings on the Lukittu
        dashboard.

        Include the API key in the Authorization header as: `Bearer
        YOUR_API_KEY`


        Example:

        ```

        Authorization: Bearer lukittu_api_key_abc123def456...

        ```

````