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

# Get company activity metrics

> Return company-wide activity metrics: number of workspaces, number of indexed (embedded) documents, and the count of search + ask (RAG) calls across all of the company's API keys over the last 30 days (served from the cached usage histogram).

**Authorization:** any authenticated member of the target company, or an instance admin (SysAdmin, Account Manager, or DPO Admin) for any company.



## OpenAPI

````yaml /api-reference/openapi-v3-instance.yaml get /api/v3/instance/companies/{id}/metrics
openapi: 3.1.0
info:
  title: LightOn API
  version: 3.15.0 (v3-instance)
  description: >-
    LightOn gives you an API to search, parse, and ingest documents at scale.
    Build knowledge-retrieval pipelines without managing vector databases or OCR
    models.
servers:
  - url: https://paradigm.lighton.ai
security: []
tags:
  - name: Models
    description: Operations about AI models
  - name: Workspaces
    description: Operations about workspaces
  - name: Users
    description: Operations about users
  - name: User Groups
    description: Operations about user groups
  - name: Companies
    description: Operations about companies
paths:
  /api/v3/instance/companies/{id}/metrics:
    get:
      tags:
        - Usage
      summary: Get company activity metrics
      description: >-
        Return company-wide activity metrics: number of workspaces, number of
        indexed (embedded) documents, and the count of search + ask (RAG) calls
        across all of the company's API keys over the last 30 days (served from
        the cached usage histogram).


        **Authorization:** any authenticated member of the target company, or an
        instance admin (SysAdmin, Account Manager, or DPO Admin) for any
        company.
      operationId: api_v3_instance_companies_metrics_retrieve
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMetricsResponse'
          description: ''
        '401':
          description: Unauthenticated - missing or invalid API key.
        '404':
          description: Not Found - company does not exist or is not visible.
        '503':
          description: >-
            API is under maintenance. Check `GET /api/v3/system/status` for
            active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
      security:
        - bearerAuth: []
components:
  schemas:
    CompanyMetricsResponse:
      type: object
      properties:
        workspaces:
          type: integer
          description: Number of workspaces in the company.
        indexed_files:
          type: integer
          description: >-
            Number of documents in the company that finished indexing
            (embedded).
        retrieval_calls_30d:
          type: integer
          description: >-
            Search + ask (RAG) calls across the company's API keys over the last
            30 days.
        top_workspaces:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceFileCount'
          description: >-
            Up to the 5 workspaces with the most indexed documents, largest
            first.
        other_files:
          type: integer
          description: >-
            Indexed documents held by all workspaces beyond the top 5 (the
            'Others' bucket).
      required:
        - indexed_files
        - other_files
        - retrieval_calls_30d
        - top_workspaces
        - workspaces
    ServiceMaintenance503:
      type: object
      description: >-
        Returned by the maintenance middleware when the requested endpoint is
        blocked.
      required:
        - detail
        - error
        - mode
      properties:
        detail:
          type: string
          example: System is under maintenance.
        error:
          type: string
          example: service_maintenance
        mode:
          type: string
          enum:
            - full_shutdown
            - warning_banner
          description: >-
            `full_shutdown` blocks all traffic; `warning_banner` also blocks and
            shows a dismissible toast.
        reason:
          type: string
          description: Operator-supplied maintenance reason, if any.
        started_at:
          type: string
          format: date-time
        endpoint_category_names:
          type: array
          items:
            type: string
          description: >-
            Non-empty only for category-scoped periods. Empty means all
            endpoints are affected.
    WorkspaceFileCount:
      type: object
      properties:
        name:
          type: string
          description: Workspace name.
        files:
          type: integer
          description: Number of indexed (embedded) documents in the workspace.
      required:
        - files
        - name
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````