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

# Get Execution Analytics

> Get execution analytics and statistics.

Provides:
- Success/failure rates
- Average execution times
- Most active triggers
- Error analysis
- Performance trends



## OpenAPI

````yaml get /api/v1/flows/analytics
openapi: 3.1.0
info:
  title: ThenaAgentStudio
  description: |2-

        ThenaCrew AI CRM Renewal System

        An intelligent platform to automate customer renewal insights and communications through multi-agent workflows.

        Key Features:
        * AI-powered renewal analysis
        * Personalized communication generation
        * Automated opportunity tracking
        * Multi-agent workflow orchestration
        
  version: 1.0.0
servers:
  - url: https://agent-studio.thena.ai
    description: Production server
  - url: http://localhost:8008
    description: Local development server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management endpoints
  - name: Chat
    description: Chat and messaging endpoints
paths:
  /api/v1/flows/analytics:
    get:
      tags:
        - flow-execution
      summary: Get Execution Analytics
      description: |-
        Get execution analytics and statistics.

        Provides:
        - Success/failure rates
        - Average execution times
        - Most active triggers
        - Error analysis
        - Performance trends
      operationId: get_execution_analytics_api_v1_flows_analytics_get
      parameters:
        - name: time_period
          in: query
          required: false
          schema:
            type: string
            description: 'Time period: 1h, 24h, 7d, 30d'
            default: 24h
            title: Time Period
          description: 'Time period: 1h, 24h, 7d, 30d'
        - name: flow_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by specific flow
            title: Flow Id
          description: Filter by specific flow
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionAnalyticsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ExecutionAnalyticsResponse:
      properties:
        analytics:
          $ref: '#/components/schemas/ExecutionAnalytics'
          description: Execution analytics data
        generated_at:
          type: string
          format: date-time
          title: Generated At
          description: When analytics were generated
      type: object
      required:
        - analytics
      title: ExecutionAnalyticsResponse
      description: Response model for execution analytics.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExecutionAnalytics:
      properties:
        time_period:
          type: string
          title: Time Period
          description: Time period for analytics
        flow_statistics:
          additionalProperties:
            $ref: '#/components/schemas/ExecutionStatistics'
          type: object
          title: Flow Statistics
          description: Statistics per flow
        agent_statistics:
          additionalProperties:
            $ref: '#/components/schemas/ExecutionStatistics'
          type: object
          title: Agent Statistics
          description: Statistics per agent
        trigger_statistics:
          additionalProperties:
            type: integer
          type: object
          title: Trigger Statistics
          description: Execution count by trigger type
        hourly_distribution:
          additionalProperties:
            type: integer
          type: object
          title: Hourly Distribution
          description: Executions by hour of day
        error_analysis:
          additionalProperties:
            type: integer
          type: object
          title: Error Analysis
          description: Error count by type
        performance_trends:
          additionalProperties:
            items:
              type: number
            type: array
          type: object
          title: Performance Trends
          description: Performance trends over time
      type: object
      required:
        - time_period
        - flow_statistics
        - agent_statistics
        - trigger_statistics
        - hourly_distribution
        - error_analysis
        - performance_trends
      title: ExecutionAnalytics
      description: Comprehensive execution analytics.
    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
    ExecutionStatistics:
      properties:
        total_executions:
          type: integer
          title: Total Executions
          description: Total number of executions
        successful_executions:
          type: integer
          title: Successful Executions
          description: Number of successful executions
        failed_executions:
          type: integer
          title: Failed Executions
          description: Number of failed executions
        average_duration_ms:
          type: number
          title: Average Duration Ms
          description: Average execution duration
        success_rate:
          type: number
          title: Success Rate
          description: Success rate as a percentage
        total_tokens_used:
          type: integer
          title: Total Tokens Used
          description: Total tokens used across all executions
          default: 0
        total_cost:
          type: number
          title: Total Cost
          description: Total estimated cost
          default: 0
        last_execution:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Execution
          description: Timestamp of last execution
      type: object
      required:
        - total_executions
        - successful_executions
        - failed_executions
        - average_duration_ms
        - success_rate
      title: ExecutionStatistics
      description: Flow execution statistics.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````