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

# Batch execute

> Executes playbooks for multiple production issues in a single request. Each item in the inputList
can either provide a message link or details. If bookName is specified for an item,
the playbook is identified by name and messageLink/title are optional. Maximum 10 items per batch.




## OpenAPI

````yaml POST /playbook/execution/batch
openapi: 3.0.3
info:
  title: Wild Moose Execution API
  description: >-
    API for running playbook-based debugging agents to investigate production
    issues
  version: 1.0.0
servers:
  - url: https://api.wildmoose.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /playbook/execution/batch:
    post:
      tags:
        - Playbook Execution
      summary: Execute concurrent investigations for multiple issues
      description: >
        Executes playbooks for multiple production issues in a single request.
        Each item in the inputList

        can either provide a message link or details. If bookName is specified
        for an item,

        the playbook is identified by name and messageLink/title are optional.
        Maximum 10 items per batch.
      operationId: batchRunPlaybooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchPlaybookExecutionInput'
            example:
              inputList:
                - messageLink: https://slack.com/archives/C1234567890/p1234567890123456
                - title: High memory usage detected
                  time: '2025-01-15T10:30:00Z'
                  attributes:
                    host: web-server-01
                    environment: production
                - bookName: perf-checks
                  time: '2025-01-15T10:30:00Z'
              liveRun: false
              channelId: C1234567890
      responses:
        '200':
          description: Batch playbook execution completed
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlaybookExecutionResult'
              example:
                - highlights: >-
                    Root cause: Database connection pool exhaustion. The CPU
                    spike correlates with increased database queries from the
                    application layer. Immediate action: Scale database
                    connection pool from 20 to 50 connections.
                  gadgetsHighlights: []
                  enrichmentLink: https://slack.com/archives/C1234567890/p6543210987654321
                  actionResults:
                    - title: Check system metrics
                      shortAnswer: CPU usage is at 85%
                      mostImportantLink: https://grafana.example.com/dashboard/cpu
                - error: Failed to run playbook for alert High memory usage detected
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              example:
                - error: inputList exceeds maximum size or invalid input format
        '401':
          description: Unauthorized - Invalid or missing JWT token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - API not enabled for organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Client ID not configured for organization
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BatchPlaybookExecutionInput:
      type: object
      required:
        - inputList
      properties:
        inputList:
          type: array
          description: Array of playbook execution inputs (maximum 10 items)
          maxItems: 10
          minItems: 1
          items:
            $ref: '#/components/schemas/PlaybookExecutionInput'
          example:
            - messageLink: https://slack.com/archives/C1234567890/p1234567890123456
            - title: High memory usage detected
              time: '2025-01-15T10:30:00Z'
              attributes:
                host: web-server-01
        liveRun:
          type: boolean
          description: >-
            If true, sends enrichment results to the incident management tool
            for all executions
          default: false
        channelId:
          type: string
          description: A Slack channel ID where results should be posted
          example: C1234567890
    PlaybookExecutionResult:
      type: object
      properties:
        error:
          type: string
          description: Error message if the playbook execution failed
          example: 'Failed to execute playbook: timeout'
        highlights:
          type: string
          description: >-
            Bottom-line summary containing root cause analysis, conclusions, and
            key insights derived from the playbook execution
          example: >-
            Root cause: Database connection pool exhaustion. The CPU spike
            correlates with increased database queries from the application
            layer. Immediate action: Scale database connection pool from 20 to
            50 connections.
        gadgetsHighlights:
          type: array
          description: Array of gadget highlight results
          items:
            $ref: '#/components/schemas/GadgetHighlights'
        enrichmentLink:
          type: string
          description: >-
            Link to the Slack message thread where enrichment results were
            posted (only present when channelId was specified)
          example: https://slack.com/archives/C1234567890/p6543210987654321
        actionableMitigations:
          type: array
          description: Array of actionable mitigations
          items:
            $ref: '#/components/schemas/ActionableMitigation'
        actionResults:
          type: array
          description: Array of action execution results
          items:
            $ref: '#/components/schemas/ActionResult'
    ValidationError:
      oneOf:
        - type: object
          properties:
            error:
              type: array
              description: Array of validation issue objects
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                    example:
                      - body
                      - messageLink
                  message:
                    type: string
                    example: Required
        - type: object
          properties:
            error:
              type: string
              description: Validation error message
              example: Invalid input format
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: Internal server error
    PlaybookExecutionInput:
      type: object
      description: >
        Playbook execution input. Either messageLink or time must be provided to
        specify when

        the issue occurred. If bookName is not provided, either messageLink or
        title must be

        specified to identify which playbook to run.
      oneOf:
        - $ref: '#/components/schemas/BookNameInput'
        - $ref: '#/components/schemas/MessageLinkInput'
        - $ref: '#/components/schemas/AlertDetailsInput'
    GadgetHighlights:
      type: object
      required:
        - title
      properties:
        title:
          type: string
          description: The title of the gadget
        args:
          type: object
          description: Arguments sent to the gadget
        highlights:
          type: string
          description: >-
            Summary containing conclusions and key insights derived from the
            gadget execution
          example: The high error rate is driven by latency across multiple regions.
    ActionableMitigation:
      type: object
      required:
        - toolName
      properties:
        toolName:
          type: string
          description: The name of the tool
        customName:
          type: string
          description: A custom name for the tool (optional)
        url:
          type: string
          description: A url target for the tool
        action:
          type: object
          description: An action target for the tool
    ActionResult:
      type: object
      properties:
        title:
          type: string
          description: Title of the action
          example: Check system metrics
        shortAnswer:
          type: string
          description: Short answer summary from the action
          example: CPU usage is at 85%
        mostImportantLink:
          type: string
          description: >-
            Key link to view raw action results in the original observability
            tool
          example: https://grafana.example.com/dashboard/cpu
    BookNameInput:
      allOf:
        - $ref: '#/components/schemas/ExecutionTargetParams'
        - type: object
          required:
            - bookName
          properties:
            bookName:
              type: string
              description: |
                Name of the playbook to run.
              example: perf-checks
            time:
              type: string
              format: date-time
              description: >
                The time when the issue occurred (ISO 8601 datetime). Optional,
                defaults to now.
              example: '2025-01-15T10:30:00Z'
    MessageLinkInput:
      allOf:
        - $ref: '#/components/schemas/ExecutionTargetParams'
        - type: object
          required:
            - messageLink
          properties:
            bookName:
              type: string
              description: |
                Name of the playbook to run.
              example: perf-checks
            messageLink:
              type: string
              description: >
                The link to a Slack message describing the issue (e.g., an alert
                or incident message). If bookName is provided - used to extract
                issue details and time.
              example: https://slack.com/archives/C1234567890/p1234567890123456
    AlertDetailsInput:
      allOf:
        - $ref: '#/components/schemas/ExecutionTargetParams'
        - type: object
          properties:
            time:
              type: string
              format: date-time
              description: >
                The time when the issue occurred (ISO 8601 datetime). Optional,
                defaults to now.
              example: '2025-01-15T10:30:00Z'
            attributes:
              type: object
              additionalProperties:
                type: string
              description: >-
                Attributes of the issue as key-value pairs, used to scope the
                issue and parameterize execution
              example:
                host: web-server-01
                environment: production
                severity: high
            details:
              type: string
              description: Additional details about the issue
              example: CPU usage has been above 80% for the past 15 minutes
          anyOf:
            - properties:
                bookName:
                  type: string
                  description: |
                    Name of the playbook to run.
                  example: perf-checks
              required:
                - bookName
            - properties:
                title:
                  type: string
                  description: >
                    The title of the alert/issue. Optional if bookName is
                    provided (used as issue context).
                  example: CPU Utilization is too high - avg idle time below 20%
              required:
                - title
    ExecutionTargetParams:
      type: object
      properties:
        liveRun:
          type: boolean
          description: If true, sends enrichment results to the incident management tool
          default: false
        channelId:
          type: string
          description: A Slack channel ID where results should be posted
          example: C1234567890
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token obtained from Auth0

````