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

# Get analytics

> Returns workspace-level analytics including summary KPIs, app distribution per user, the workspace credit pool, per-member credit-limit aggregates, and credit consumption.

    Data is real-time from the database.



## OpenAPI

````yaml /developers/references/monitoring-api/monitoring-openapi.json get /analytics/{workspace_id}
openapi: 3.1.0
info:
  title: Base44 Workspace Monitoring API
  description: |2-

        Workspace monitoring and analytics API.
        
        Access usage analytics, user engagement metrics, and governance data for your workspace.
        
        **Features:**
        - Workspace-level analytics and KPIs
        - User activity tracking and credit consumption
        - app engagement metrics and security governance
        
        **Authentication:** Required for all endpoints (admin or owner role)
        
        Use the 🔒 **Authorize** button above to enter your API key.
        
        **Rate Limits:**
        - Analytics endpoints: 50 requests per minute per user
        - User list: 50 requests per minute per user
        - User detail: 75 requests per minute per user
        - User apps: 50 requests per minute per user
        - App list: 50 requests per minute per user
        - App analytics: 50 requests per minute per user
        
        Enterprise workspaces get 2x these limits.
        
        Rate limits are applied per authenticated user and enforced using token-bucket algorithm.
        
  version: 1.2.1
servers:
  - url: https://app.base44.com/api/v1/monitoring
    description: Monitoring API
security:
  - ApiKeyAuth: []
tags:
  - name: analytics
    description: >-
      Workspace-level analytics and KPIs including usage, engagement, and cost
      metrics.
  - name: users
    description: User management, activity tracking, and credit consumption data.
  - name: apps
    description: App-level analytics, engagement metrics, and governance flags.
  - name: superagents
    description: Super Agent inventory and analytics.
paths:
  /analytics/{workspace_id}:
    get:
      tags:
        - analytics
      summary: Get analytics
      description: >-
        Returns workspace-level analytics including summary KPIs, app
        distribution per user, the workspace credit pool, per-member
        credit-limit aggregates, and credit consumption.

            Data is real-time from the database.
      operationId: get_workspace_analytics_analytics__workspace_id__get
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            title: Workspace Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Start date in `YYYY-MM-DD` format. Defaults to billing period
              start.
            title: From
          description: Start date in `YYYY-MM-DD` format. Defaults to billing period start.
          example: '2026-06-01'
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              End date in `YYYY-MM-DD` format. Defaults to current date. Max 1
              year range.
            title: To
          description: >-
            End date in `YYYY-MM-DD` format. Defaults to current date. Max 1
            year range.
          example: '2026-06-30'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceAnalytics'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkspaceAnalytics:
      properties:
        summary:
          $ref: '#/components/schemas/AnalyticsSummary'
          description: High-level workspace summary.
        user_distribution:
          $ref: '#/components/schemas/AnalyticsUserDistribution'
          description: User distribution breakdown.
        app_distribution:
          $ref: '#/components/schemas/AnalyticsAppDistribution'
        seats:
          $ref: '#/components/schemas/SeatsUtilization'
          description: >-
            **Deprecated:** Workspace seat utilization metrics. Use
            `credit_pool` instead. Workspaces on the current billing model share
            a credit pool with no per-user seats, so this block reports zeros
            for them.
          deprecated: true
        credit_pool:
          $ref: '#/components/schemas/CreditPool'
          description: Workspace credit pool state for the current credit reset period.
        member_allocations:
          $ref: '#/components/schemas/MemberAllocationsSummary'
          description: >-
            Aggregate view of per-member credit limits drawn from the shared
            pool.
        credits:
          $ref: '#/components/schemas/CreditsSummary'
          description: Credits consumption summary.
      type: object
      required:
        - summary
        - user_distribution
        - app_distribution
        - seats
        - credit_pool
        - member_allocations
        - credits
      title: WorkspaceAnalytics
      description: Workspace analytics data.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AnalyticsSummary:
      properties:
        total_applications:
          type: integer
          title: Total Applications
          description: Total number of apps.
          example: 127
        total_superagents:
          type: integer
          title: Total Superagents
          description: Total number of Super Agents.
          example: 7
        avg_apps_per_user:
          type: number
          minimum: 0
          title: Avg Apps Per User
          description: Average number of apps per user.
          example: 3.2
        avg_superagents_per_user:
          type: number
          minimum: 0
          title: Avg Superagents Per User
          description: Average number of Super Agents per user.
          example: 0.4
        total_registered_users:
          type: integer
          title: Total Registered Users
          description: Total number of active workspace users, including guests.
          example: 42
        total_workspace_members:
          type: integer
          title: Total Workspace Members
          description: Total number of active non-guest workspace users.
          example: 36
        total_guest_users:
          type: integer
          title: Total Guest Users
          description: Total number of active guest users.
          example: 6
        active_users_last_30d:
          type: integer
          title: Active Users Last 30D
          description: Number of users who consumed message credits in the last 30 days.
          example: 38
        published_apps:
          type: integer
          title: Published Apps
          description: Number of published apps.
          example: 89
      type: object
      required:
        - total_applications
        - total_superagents
        - avg_apps_per_user
        - avg_superagents_per_user
        - total_registered_users
        - total_workspace_members
        - total_guest_users
        - active_users_last_30d
        - published_apps
      title: AnalyticsSummary
      description: High-level workspace analytics summary.
    AnalyticsUserDistribution:
      properties:
        by_seat_type:
          items:
            $ref: '#/components/schemas/AnalyticsSeatTypeDistribution'
          type: array
          title: By Seat Type
          description: >-
            **Deprecated:** Distribution of users by seat type. Use
            `credit_pool` and `member_allocations` instead. Workspaces on the
            current billing model share a single credit pool and report this as
            one bucket.
          deprecated: true
        total_users:
          type: integer
          title: Total Users
          description: Total number of users.
          example: 42
      type: object
      required:
        - by_seat_type
        - total_users
      title: AnalyticsUserDistribution
      description: User distribution breakdown by various dimensions.
    AnalyticsAppDistribution:
      properties:
        apps_per_user_ranges:
          items:
            $ref: '#/components/schemas/AnalyticsAppCountBucket'
          type: array
          title: Apps Per User Ranges
          description: Distribution of users by number of apps they own.
        median_apps_per_user:
          type: number
          title: Median Apps Per User
          description: Median number of apps per user.
          example: 2.5
        total_users:
          type: integer
          title: Total Users
          description: Total number of users.
          example: 42
      type: object
      required:
        - apps_per_user_ranges
        - median_apps_per_user
        - total_users
      title: AnalyticsAppDistribution
      description: App distribution statistics.
    SeatsUtilization:
      properties:
        total:
          type: integer
          title: Total
          description: Total number of seats.
          example: 50
        assigned:
          type: integer
          title: Assigned
          description: Number of seats assigned to users.
          example: 42
        available:
          type: integer
          title: Available
          description: Number of available seats. Calculated as `total` - `assigned`.
          example: 8
        utilization_percent:
          type: number
          maximum: 100
          minimum: 0
          title: Utilization Percent
          description: >-
            Percentage of seats being utilized. Calculated as `assigned` /
            `total` * `100`.
          example: 84
      type: object
      required:
        - total
        - assigned
        - available
        - utilization_percent
      title: SeatsUtilization
      description: |-
        **Deprecated:** Workspace seat utilization metrics.

        Use `WorkspaceAnalytics.credit_pool` instead. Workspaces on the current
        billing model share a credit pool with no per-user seats, so this block
        reports zeros for them.
    CreditPool:
      properties:
        period_start:
          type: string
          title: Period Start
          description: Start of the credit reset period in `YYYY-MM-DDTHH:MM:SSZ` format.
          example: '2025-10-01T00:00:00Z'
        period_end:
          type: string
          title: Period End
          description: End of the credit reset period in `YYYY-MM-DDTHH:MM:SSZ` format.
          example: '2025-11-01T00:00:00Z'
        tier:
          type: string
          title: Tier
          description: >-
            Subscription tier identifier, such as `"free"`, `"builder_1"`,
            `"business_1"`, or `"enterprise"`.
          example: enterprise
        tier_display_name:
          type: string
          title: Tier Display Name
          description: Human-readable tier name.
          example: Enterprise
        messages:
          $ref: '#/components/schemas/CreditPoolBucket'
          description: >-
            Message credit pool. The `limit` includes monthly tier credits,
            bonus credits, and any gift-card balance.
            `gift_card_credits_remaining` is already counted in `limit` and is
            shown separately for visibility only. Don't add it to `limit`.
        integration:
          $ref: '#/components/schemas/CreditPoolBucket'
          description: Integration credit pool. Includes monthly tier limit + bonus.
        daily_message_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Daily Message Limit
          description: Daily message credit limit. `null` when no daily limit applies.
        daily_message_used:
          type: number
          minimum: 0
          title: Daily Message Used
          description: Message credits consumed today.
          example: 320
        bonus_message_credits:
          type: integer
          minimum: 0
          title: Bonus Message Credits
          description: Active workspace bonus message credits included in `messages.limit`.
          example: 500
        bonus_integration_credits:
          type: integer
          minimum: 0
          title: Bonus Integration Credits
          description: >-
            Active workspace bonus integration credits included in
            `integration.limit`.
          example: 0
        rollover_message_credits:
          type: integer
          minimum: 0
          title: Rollover Message Credits
          description: >-
            **Deprecated:** Message rollover credits. Removed in the current
            billing model. There is no rollover, so this always reports `0` and
            is retained only for response-shape compatibility.
          deprecated: true
        rollover_integration_credits:
          type: integer
          minimum: 0
          title: Rollover Integration Credits
          description: >-
            **Deprecated:** Integration rollover credits. Removed in the current
            billing model. There is no rollover, so this always reports `0` and
            is retained only for response-shape compatibility.
          deprecated: true
        gift_card_credits_remaining:
          type: number
          minimum: 0
          title: Gift Card Credits Remaining
          description: >-
            Gift card balance available to the workspace. Consumed before tier
            credits. This balance is already counted in `messages.limit` and is
            shown here for visibility only. Don't add it to `messages.limit`.
            Reported as a float to preserve fractional balances.
          example: 0
        is_over_limit:
          type: boolean
          title: Is Over Limit
          description: >-
            Whether the workspace has exceeded its monthly or daily message
            credit limit.
          example: false
        is_past_due:
          type: boolean
          title: Is Past Due
          description: >-
            Whether the subscription is past due. Limits may be downgraded when
            past due.
          example: false
      type: object
      required:
        - period_start
        - period_end
        - tier
        - tier_display_name
        - messages
        - integration
        - daily_message_limit
        - daily_message_used
        - bonus_message_credits
        - bonus_integration_credits
        - rollover_message_credits
        - rollover_integration_credits
        - gift_card_credits_remaining
        - is_over_limit
        - is_past_due
      title: CreditPool
      description: >-
        Workspace credit pool state for the current credit reset period.


        This replaces `SeatsUtilization` under the current billing model. The
        `messages` and

        `integration` fields each report their own limit/used/remaining. The

        period is the credit reset window, which matches the billing UI. For

        yearly subscriptions with monthly resets, this is the monthly window.
    MemberAllocationsSummary:
      properties:
        members_with_limit:
          type: integer
          minimum: 0
          title: Members With Limit
          description: Number of members who have an effective per-member credit limit.
          example: 18
        members_over_limit:
          type: integer
          minimum: 0
          title: Members Over Limit
          description: >-
            Number of members who have exceeded their per-member limit in the
            current credit reset period.
          example: 2
        default_member_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Default Member Limit
          description: >-
            Default per-member credit limit applied per credit reset period to
            members without an explicit override. `null` when no default is set.
          example: 1000
        capability_enabled:
          type: boolean
          title: Capability Enabled
          description: >-
            Whether the workspace's tier includes the per-member credit limit
            capability. When `false`, all members share the pool freely.
          example: true
      type: object
      required:
        - members_with_limit
        - members_over_limit
        - default_member_limit
        - capability_enabled
      title: MemberAllocationsSummary
      description: Aggregate view of per-member credit limits across the workspace.
    CreditsSummary:
      properties:
        message_credits:
          type: number
          title: Message Credits
          description: Total message credits consumed.
          example: 12450
        integration_credits:
          type: number
          title: Integration Credits
          description: Total integration credits consumed.
          example: 3280
        total_credits:
          type: number
          title: Total Credits
          description: >-
            Combined total credits consumed. Calculated as `message_credits` +
            `integration_credits`.
          example: 15730
        message_credits_distribution:
          items:
            $ref: '#/components/schemas/AnalyticsCreditBucket'
          type: array
          title: Message Credits Distribution
          description: Distribution of users by message credit usage.
        integration_credits_distribution:
          items:
            $ref: '#/components/schemas/AnalyticsCreditBucket'
          type: array
          title: Integration Credits Distribution
          description: Distribution of users by integration credit usage.
      type: object
      required:
        - message_credits
        - integration_credits
        - total_credits
      title: CreditsSummary
      description: Credits consumption summary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AnalyticsSeatTypeDistribution:
      properties:
        seat_type:
          type: string
          title: Seat Type
          description: >-
            Subscription tier, such as `"starter"`, `"builder"`, `"pro"`, or
            `"elite"`.
          example: pro
        count:
          type: integer
          minimum: 0
          title: Count
          description: Number of users with this seat type.
          example: 24
        percentage:
          type: number
          maximum: 100
          minimum: 0
          title: Percentage
          description: Percentage of total users.
          example: 35.8
      type: object
      required:
        - seat_type
        - count
        - percentage
      title: AnalyticsSeatTypeDistribution
      description: >-
        **Deprecated:** Distribution of users by seat type.


        Use `WorkspaceAnalytics.credit_pool` and `member_allocations` instead.
        On the

        current billing model all members share the workspace tier, so this
        collapses

        to a single bucket.
    AnalyticsAppCountBucket:
      properties:
        range:
          type: string
          title: Range
          description: >-
            App count range, such as `"0"`, `"1-2"`, `"3-5"`, `"6-10"`, or
            `"10+"`.
          example: 1-2
        count:
          type: integer
          title: Count
          description: Number of users in this range.
          example: 25
      type: object
      required:
        - range
        - count
      title: AnalyticsAppCountBucket
      description: Single bucket in app count distribution histogram.
    CreditPoolBucket:
      properties:
        limit:
          anyOf:
            - type: number
            - type: 'null'
          title: Limit
          description: >-
            Credits available in the pool for the current period. `null` means
            unlimited. Reported as a float to preserve fractional balances and
            consumption.
          example: 20000
        used:
          type: number
          minimum: 0
          title: Used
          description: Credits consumed in the current period.
          example: 12450
        remaining:
          anyOf:
            - type: number
            - type: 'null'
          title: Remaining
          description: Credits remaining. `null` when `limit` is `null` (unlimited).
          example: 7550
      type: object
      required:
        - limit
        - used
        - remaining
      title: CreditPoolBucket
      description: Limit/used/remaining for one portion of the workspace credit pool.
    AnalyticsCreditBucket:
      properties:
        range:
          type: string
          title: Range
          description: Credit range. For example, `"0"'`, `"1-10"`, or `"11-50"`.
          example: 11-50
        count:
          type: integer
          title: Count
          description: Number of users in the range.
          example: 18
      type: object
      required:
        - range
        - count
      title: AnalyticsCreditBucket
      description: Single bucket in credit distribution histogram
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        API key for authentication. See the Authentication page for your API for
        details on how to get your key.

````