> ## 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 chat sessions report

> This endpoint allows retrieving company chat sessions report.

The start date is required, but the end date is by default today.

It is restricted to admin and company admin users.

Admin users can optionally filter by company.



## OpenAPI

````yaml /api-reference/openapi-v2.yaml get /api/v2/reporting/chat-sessions/
openapi: 3.0.3
info:
  title: Paradigm API
  version: xenial-xerus (v2)
  description: >-
    A versatile and adaptable tool designed to integrate Generative AI into your
    applications
servers:
  - url: https://paradigm.lighton.ai
security: []
tags:
  - name: Models
    description: Operations about AI models
  - name: Files Search
    description: Operations about files search
  - name: Files
    description: Operations about files
  - name: Upload Sessions
    description: Operations about upload sessions
  - name: Workspaces
    description: Operations about workspaces
  - name: Users
    description: Operations about users
  - name: Companies
    description: Operations about companies
  - name: SCIM
    description: Operations about SCIM
  - name: Feedbacks
    description: Operations about feedbacks
  - name: Reporting
    description: Operations about reporting
  - name: Monitoring
    description: Operations about monitoring
  - name: Platform Status
    description: Operations about platform status
paths:
  /api/v2/reporting/chat-sessions/:
    get:
      tags:
        - Reporting
      summary: Get company chat sessions report
      description: |-
        This endpoint allows retrieving company chat sessions report.

        The start date is required, but the end date is by default today.

        It is restricted to admin and company admin users.

        Admin users can optionally filter by company.
      operationId: api_v2_reporting_chat_sessions_retrieve
      parameters:
        - in: query
          name: company_id
          schema:
            type: integer
          description: The unique identifier of the company (for admin users only).
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: The end date for the report (defaults to today).
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: The start date for the report.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionsReportResponse'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    ChatSessionsReportResponse:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/RetrieveChatSessionsReportMetadata'
        reporting:
          type: array
          items:
            $ref: '#/components/schemas/CompanyChatSessionReport'
        metadata_agent:
          $ref: '#/components/schemas/RetrieveAgentThreadReportMetadata'
        reporting_agents:
          type: array
          items:
            $ref: '#/components/schemas/CompanyAgentThreadReport'
      required:
        - metadata
        - metadata_agent
        - reporting
        - reporting_agents
    RetrieveChatSessionsReportMetadata:
      type: object
      properties:
        sessions_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        model_responses_with_docs_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        unique_models_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        average_session_length:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        user_queries_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        model_responses_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        last_model_response_date:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
      required:
        - average_session_length
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - sessions_count
        - unique_models_count
        - user_queries_count
    CompanyChatSessionReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyChatSessionReportCompanyInfo'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/ChatSessionsReportPerDate'
      required:
        - company
        - dates
    RetrieveAgentThreadReportMetadata:
      type: object
      properties:
        threads_count:
          $ref: '#/components/schemas/AgentMetadata'
        unique_models_count:
          $ref: '#/components/schemas/AgentMetadata'
        average_thread_length:
          $ref: '#/components/schemas/AgentMetadata'
        user_queries_count:
          $ref: '#/components/schemas/AgentMetadata'
        model_responses_with_docs_count:
          $ref: '#/components/schemas/AgentMetadata'
        model_responses_count:
          $ref: '#/components/schemas/AgentMetadata'
        last_model_response_date:
          $ref: '#/components/schemas/AgentMetadata'
      required:
        - average_thread_length
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - threads_count
        - unique_models_count
        - user_queries_count
    CompanyAgentThreadReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyAgentThreadReportCompany'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/AgentThreadReportPerDate'
      required:
        - company
        - dates
    ReportsMetadataItemResponse:
      type: object
      properties:
        description:
          type: string
        unit:
          type: string
      required:
        - description
        - unit
    CompanyChatSessionReportCompanyInfo:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
    ChatSessionsReportPerDate:
      type: object
      properties:
        date:
          type: string
          format: date
        sessions:
          $ref: '#/components/schemas/Session'
        chats:
          $ref: '#/components/schemas/Chat'
      required:
        - chats
        - date
        - sessions
    AgentMetadata:
      type: object
      properties:
        description:
          type: string
        unit:
          type: string
      required:
        - description
        - unit
    CompanyAgentThreadReportCompany:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
    AgentThreadReportPerDate:
      type: object
      properties:
        date:
          type: string
          format: date
        threads:
          $ref: '#/components/schemas/Threads'
        agents:
          $ref: '#/components/schemas/Agent'
      required:
        - agents
        - date
        - threads
    Session:
      type: object
      properties:
        sessions_count:
          type: integer
        unique_models_count:
          type: integer
        average_session_length:
          type: number
          format: double
      required:
        - average_session_length
        - sessions_count
        - unique_models_count
    Chat:
      type: object
      properties:
        user_queries_count:
          type: integer
        model_responses_with_docs_count:
          type: integer
        model_responses_count:
          type: integer
        last_model_response_date:
          type: string
          format: date-time
      required:
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - user_queries_count
    Threads:
      type: object
      properties:
        threads_count:
          type: integer
        unique_models_count:
          type: integer
        average_thread_length:
          type: number
          format: double
      required:
        - average_thread_length
        - threads_count
        - unique_models_count
    Agent:
      type: object
      properties:
        user_queries_count:
          type: integer
        model_responses_with_docs_count:
          type: integer
        model_responses_count:
          type: integer
        last_model_response_date:
          type: string
          format: date-time
      required:
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - user_queries_count
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````