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

# Get Summary

> Endpoint to retrieve summarized interaction counts over a specified date range, grouped by daily, weekly, or monthly intervals.
Optionally filters by API titles and supports flexible time granularity in results.

Args:
    request (SummaryRequest): The request body containing filter options:
        - start_date (datetime): Start date of the summary range.
        - end_date (datetime): End date of the summary range.
        - api_title (List[str], optional): List of API titles to filter by.
        - time_frame (str, optional): Time granularity - 'daily', 'weekly', or 'monthly'.

Returns:
    dict: A dictionary mapping time buckets (daily/weekly/monthly) to counts of interactions,
          either grouped by API title or as a total count.

Example Response:
    {
        "2024-04-01": {"API A": 12, "API B": 8},
        "2024-04-02": {"API A": 9, "API B": 5}
    }



## OpenAPI

````yaml post /api/interaction/summary
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/interaction/summary:
    post:
      tags:
        - Interaction
      summary: Get Summary
      description: >-
        Endpoint to retrieve summarized interaction counts over a specified date
        range, grouped by daily, weekly, or monthly intervals.

        Optionally filters by API titles and supports flexible time granularity
        in results.


        Args:
            request (SummaryRequest): The request body containing filter options:
                - start_date (datetime): Start date of the summary range.
                - end_date (datetime): End date of the summary range.
                - api_title (List[str], optional): List of API titles to filter by.
                - time_frame (str, optional): Time granularity - 'daily', 'weekly', or 'monthly'.

        Returns:
            dict: A dictionary mapping time buckets (daily/weekly/monthly) to counts of interactions,
                  either grouped by API title or as a total count.

        Example Response:
            {
                "2024-04-01": {"API A": 12, "API B": 8},
                "2024-04-02": {"API A": 9, "API B": 5}
            }
      operationId: get_summary
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SummaryRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    SummaryRequest:
      properties:
        summary_type:
          type: string
          pattern: ^(api_usage|action_breakdown)$
          title: Summary Type
          default: api_usage
        time_frame:
          anyOf:
            - type: string
              pattern: ^(hourly|daily|weekly|monthly)$
            - type: 'null'
          title: Time Frame
          default: daily
        start_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start Date
        end_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Date
        api_title:
          items:
            type: string
          type: array
          title: Api Title
      type: object
      title: SummaryRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````