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

# Batch Request



## OpenAPI

````yaml post /api/analytics/batch
openapi: 3.1.0
info:
  title: Axion Backend API
  description: Backend API for Axion platform with desktop automation capabilities
  version: 1.0.0
servers:
  - url: https://api.getgranite.ai
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security: []
tags:
  - name: Authentication
    description: User authentication and session management
  - name: Organizations
    description: Organization management and membership
  - name: Health
    description: API health and status monitoring
  - name: Automations
    description: Automation planning and execution
  - name: MIG
    description: Managed Instance Group operations
  - name: Agent
    description: Agent execution and streaming
  - name: Onboarding
    description: Organization onboarding flow
  - name: Organization Automations
    description: Organization automation endpoint management
  - name: Organization Endpoints
    description: Public endpoints for organization automations
  - name: Analytics
    description: Analytics and reporting endpoints
paths:
  /api/analytics/batch:
    post:
      tags:
        - Analytics
      summary: Get all analytics data in a single batched request
      operationId: getBatchedAnalytics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyticsFilters'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchedAnalyticsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AnalyticsFilters:
      properties:
        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
        granularity:
          $ref: '#/components/schemas/GranularityEnum'
          default: day
        workflow_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Name
        triggered_by:
          anyOf:
            - $ref: '#/components/schemas/TriggerTypeEnum'
            - type: 'null'
        status:
          anyOf:
            - $ref: '#/components/schemas/ExecutionStatusEnum'
            - type: 'null'
      type: object
      title: AnalyticsFilters
      description: Common filters for analytics queries.
    BatchedAnalyticsResponse:
      properties:
        summary:
          $ref: '#/components/schemas/SummaryStats'
        executions_over_time:
          $ref: '#/components/schemas/ExecutionsOverTimeResponse'
        success_rate:
          $ref: '#/components/schemas/SuccessRateResponse'
        failure_breakdown:
          $ref: '#/components/schemas/FailureBreakdownResponse'
        trigger_distribution:
          $ref: '#/components/schemas/TriggerDistributionResponse'
        top_automations:
          $ref: '#/components/schemas/TopAutomationsResponse'
        duration_distribution:
          $ref: '#/components/schemas/DurationDistributionResponse'
        recent_failures:
          $ref: '#/components/schemas/RecentFailuresResponse'
        actions_per_workflow:
          $ref: '#/components/schemas/ActionsPerWorkflowResponse'
        workflow_complexity:
          $ref: '#/components/schemas/WorkflowComplexityResponse'
        endpoint_usage:
          $ref: '#/components/schemas/EndpointUsageResponse'
        workflows:
          items:
            type: string
          type: array
          title: Workflows
      type: object
      required:
        - summary
        - executions_over_time
        - success_rate
        - failure_breakdown
        - trigger_distribution
        - top_automations
        - duration_distribution
        - recent_failures
        - actions_per_workflow
        - workflow_complexity
        - endpoint_usage
        - workflows
      title: BatchedAnalyticsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GranularityEnum:
      type: string
      enum:
        - hour
        - day
        - week
        - month
      title: GranularityEnum
    TriggerTypeEnum:
      type: string
      enum:
        - manual
        - endpoint
        - scheduled
      title: TriggerTypeEnum
    ExecutionStatusEnum:
      type: string
      enum:
        - pending
        - running
        - completed
        - failed
        - cancelled
      title: ExecutionStatusEnum
    SummaryStats:
      properties:
        total_executions:
          type: integer
          title: Total Executions
          default: 0
        completed:
          type: integer
          title: Completed
          default: 0
        total_failures:
          type: integer
          title: Total Failures
          default: 0
        success_rate:
          type: number
          title: Success Rate
          default: 0
        avg_duration_ms:
          type: number
          title: Avg Duration Ms
          default: 0
        active_today:
          type: integer
          title: Active Today
          default: 0
        total_tokens:
          type: integer
          title: Total Tokens
          default: 0
      type: object
      title: SummaryStats
      description: Dashboard summary statistics.
    ExecutionsOverTimeResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/TimeSeriesDataPoint'
          type: array
          title: Data
        granularity:
          type: string
          title: Granularity
      type: object
      required:
        - data
        - granularity
      title: ExecutionsOverTimeResponse
      description: Response for executions over time.
    SuccessRateResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SuccessRateDataPoint'
          type: array
          title: Data
        granularity:
          type: string
          title: Granularity
      type: object
      required:
        - data
        - granularity
      title: SuccessRateResponse
      description: Response for success rate over time.
    FailureBreakdownResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/FailureCategoryItem'
          type: array
          title: Data
        total_failures:
          type: integer
          title: Total Failures
          default: 0
      type: object
      required:
        - data
      title: FailureBreakdownResponse
      description: Response for failure breakdown.
    TriggerDistributionResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/TriggerDistributionItem'
          type: array
          title: Data
      type: object
      required:
        - data
      title: TriggerDistributionResponse
      description: Response for trigger distribution.
    TopAutomationsResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/TopAutomationItem'
          type: array
          title: Data
        sort_by:
          type: string
          title: Sort By
      type: object
      required:
        - data
        - sort_by
      title: TopAutomationsResponse
      description: Response for top automations.
    DurationDistributionResponse:
      properties:
        stats:
          $ref: '#/components/schemas/DurationStats'
        histogram:
          items:
            $ref: '#/components/schemas/DurationHistogramBucket'
          type: array
          title: Histogram
      type: object
      required:
        - stats
      title: DurationDistributionResponse
      description: Response for duration distribution.
    RecentFailuresResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/RecentFailureItem'
          type: array
          title: Data
        total:
          type: integer
          title: Total
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
      type: object
      required:
        - data
        - total
        - limit
        - offset
      title: RecentFailuresResponse
      description: Response for recent failures.
    ActionsPerWorkflowResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/WorkflowActionsItem'
          type: array
          title: Data
      type: object
      required:
        - data
      title: ActionsPerWorkflowResponse
      description: Response for actions per workflow.
    WorkflowComplexityResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/WorkflowComplexityItem'
          type: array
          title: Data
      type: object
      required:
        - data
      title: WorkflowComplexityResponse
      description: Response for workflow complexity.
    EndpointUsageResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/EndpointUsageItem'
          type: array
          title: Data
      type: object
      required:
        - data
      title: EndpointUsageResponse
      description: Response for endpoint usage.
    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
    TimeSeriesDataPoint:
      properties:
        time:
          type: string
          title: Time
        total:
          type: integer
          title: Total
          default: 0
        completed:
          type: integer
          title: Completed
          default: 0
        failed:
          type: integer
          title: Failed
          default: 0
        running:
          type: integer
          title: Running
          default: 0
        pending:
          type: integer
          title: Pending
          default: 0
      type: object
      required:
        - time
      title: TimeSeriesDataPoint
      description: Generic time series data point.
    SuccessRateDataPoint:
      properties:
        time:
          type: string
          title: Time
        total:
          type: integer
          title: Total
          default: 0
        completed:
          type: integer
          title: Completed
          default: 0
        success_rate:
          type: number
          title: Success Rate
          default: 0
      type: object
      required:
        - time
      title: SuccessRateDataPoint
      description: Success rate time series data point.
    FailureCategoryItem:
      properties:
        category:
          type: string
          title: Category
        count:
          type: integer
          title: Count
        sample_messages:
          items:
            type: string
          type: array
          title: Sample Messages
      type: object
      required:
        - category
        - count
      title: FailureCategoryItem
      description: Failure breakdown item.
    TriggerDistributionItem:
      properties:
        trigger_type:
          type: string
          title: Trigger Type
        count:
          type: integer
          title: Count
      type: object
      required:
        - trigger_type
        - count
      title: TriggerDistributionItem
      description: Trigger distribution item.
    TopAutomationItem:
      properties:
        workflow_name:
          type: string
          title: Workflow Name
        executions:
          type: integer
          title: Executions
        completed:
          type: integer
          title: Completed
        failures:
          type: integer
          title: Failures
        success_rate:
          type: number
          title: Success Rate
        avg_duration_ms:
          type: number
          title: Avg Duration Ms
        last_execution:
          type: string
          title: Last Execution
      type: object
      required:
        - workflow_name
        - executions
        - completed
        - failures
        - success_rate
        - avg_duration_ms
        - last_execution
      title: TopAutomationItem
      description: Top automation statistics.
    DurationStats:
      properties:
        total:
          type: integer
          title: Total
          default: 0
        avg_ms:
          type: number
          title: Avg Ms
          default: 0
        min_ms:
          type: integer
          title: Min Ms
          default: 0
        max_ms:
          type: integer
          title: Max Ms
          default: 0
        p50_ms:
          type: number
          title: P50 Ms
          default: 0
        p75_ms:
          type: number
          title: P75 Ms
          default: 0
        p90_ms:
          type: number
          title: P90 Ms
          default: 0
        p95_ms:
          type: number
          title: P95 Ms
          default: 0
        p99_ms:
          type: number
          title: P99 Ms
          default: 0
      type: object
      title: DurationStats
      description: Duration statistics.
    DurationHistogramBucket:
      properties:
        bucket_start_ms:
          type: integer
          title: Bucket Start Ms
        bucket_end_ms:
          type: integer
          title: Bucket End Ms
        count:
          type: integer
          title: Count
      type: object
      required:
        - bucket_start_ms
        - bucket_end_ms
        - count
      title: DurationHistogramBucket
      description: Duration histogram bucket.
    RecentFailureItem:
      properties:
        execution_id:
          type: string
          title: Execution Id
        run_id:
          type: string
          title: Run Id
        workflow_name:
          type: string
          title: Workflow Name
        error_category:
          type: string
          title: Error Category
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        triggered_by:
          type: string
          title: Triggered By
        started_at:
          type: string
          title: Started At
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
      type: object
      required:
        - execution_id
        - run_id
        - workflow_name
        - error_category
        - triggered_by
        - started_at
      title: RecentFailureItem
      description: Recent failure item.
    WorkflowActionsItem:
      properties:
        workflow_name:
          type: string
          title: Workflow Name
        clicks:
          type: integer
          title: Clicks
          default: 0
        keystrokes:
          type: integer
          title: Keystrokes
          default: 0
        scrolls:
          type: integer
          title: Scrolls
          default: 0
        screenshots:
          type: integer
          title: Screenshots
          default: 0
        total_steps:
          type: integer
          title: Total Steps
          default: 0
      type: object
      required:
        - workflow_name
      title: WorkflowActionsItem
      description: Workflow action breakdown.
    WorkflowComplexityItem:
      properties:
        workflow_name:
          type: string
          title: Workflow Name
        complexity_score:
          type: number
          title: Complexity Score
        total_steps:
          type: integer
          title: Total Steps
        total_iterations:
          type: integer
          title: Total Iterations
        parameters_count:
          type: integer
          title: Parameters Count
        success_rate:
          type: number
          title: Success Rate
        avg_duration_ms:
          type: number
          title: Avg Duration Ms
      type: object
      required:
        - workflow_name
        - complexity_score
        - total_steps
        - total_iterations
        - parameters_count
        - success_rate
        - avg_duration_ms
      title: WorkflowComplexityItem
      description: Workflow complexity metrics.
    EndpointUsageItem:
      properties:
        endpoint_slug:
          type: string
          title: Endpoint Slug
        http_method:
          type: string
          title: Http Method
        invocations:
          type: integer
          title: Invocations
        success_count:
          type: integer
          title: Success Count
        success_rate:
          type: number
          title: Success Rate
        avg_response_time_ms:
          type: number
          title: Avg Response Time Ms
        p95_response_time_ms:
          type: number
          title: P95 Response Time Ms
      type: object
      required:
        - endpoint_slug
        - http_method
        - invocations
        - success_count
        - success_rate
        - avg_response_time_ms
        - p95_response_time_ms
      title: EndpointUsageItem
      description: Endpoint usage statistics.

````