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

# Automation audit insights

> Returns automation execution breakdowns, active automation totals, and best-effort automation recommendations.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /insights/_automation_audit
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /insights/_automation_audit:
    post:
      tags:
        - todo
      summary: Automation audit insights
      description: >-
        Returns automation execution breakdowns, active automation totals, and
        best-effort automation recommendations.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_todo_insights.AutomationAuditRequest
        description: Automation audit request
        required: true
      responses:
        '200':
          description: Automation audit response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_todo_insights.automationAuditResponse
        '400':
          description: Bad request - invalid request body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - admin scope and workflow insights feature flag required
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Group not found
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_todo_insights.AutomationAuditRequest:
      type: object
      properties:
        assignee:
          type: string
        assignee_type:
          type: string
        start_date:
          type: string
    pkg_routes_todo_insights.automationAuditResponse:
      type: object
      properties:
        active_automations:
          type: array
          items:
            $ref: >-
              #/components/schemas/pkg_routes_todo_insights.automationAuditBreakdownItem
        active_without_automation:
          $ref: >-
            #/components/schemas/pkg_routes_todo_insights.automationAuditTaskTotal
        completed_automations:
          type: array
          items:
            $ref: >-
              #/components/schemas/pkg_routes_todo_insights.automationAuditBreakdownItem
        filters:
          $ref: '#/components/schemas/pkg_routes_todo_insights.automationAuditFilters'
        recommendations:
          $ref: >-
            #/components/schemas/pkg_routes_todo_insights.automationAuditRecommendationResponse
    pkg_routes_todo_insights.automationAuditBreakdownItem:
      type: object
      properties:
        automation_description:
          type: string
        automation_id:
          type: string
        automation_name:
          type: string
        task_count:
          type: integer
    pkg_routes_todo_insights.automationAuditTaskTotal:
      type: object
      properties:
        task_count:
          type: integer
    pkg_routes_todo_insights.automationAuditFilters:
      type: object
      properties:
        assignee_id:
          type: string
        assignee_type:
          type: string
        end_date:
          type: string
        start_date:
          type: string
        user_ids:
          type: array
          items:
            type: string
        users:
          type: array
          items:
            $ref: '#/components/schemas/pkg_routes_todo_insights.insightUserReference'
    pkg_routes_todo_insights.automationAuditRecommendationResponse:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
        summary:
          type: string
        templates:
          type: array
          items:
            $ref: >-
              #/components/schemas/pkg_routes_todo_insights.automationAuditRecommendationGroup
    pkg_routes_todo_insights.insightUserReference:
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        user_id:
          type: string
    pkg_routes_todo_insights.automationAuditRecommendationGroup:
      type: object
      properties:
        tasks:
          type: array
          items:
            $ref: >-
              #/components/schemas/pkg_routes_todo_insights.automationAuditRecommendationTask
        template_id:
          type: string
        template_title:
          type: string
    pkg_routes_todo_insights.automationAuditRecommendationTask:
      type: object
      properties:
        open_task_count:
          type: integer
        rationale:
          type: string
        suggested_automation_description:
          type: string
        suggested_automation_id:
          type: string
        suggested_automation_name:
          type: string
        task_description:
          type: string
        task_id:
          type: string
        task_number:
          type: integer
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.