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

# Batch Terminate Executions

> Terminate multiple executions in a single request.

This endpoint allows terminating multiple running executions at once.
Each execution is processed independently, so some may succeed while others fail.

Args:
    request: FastAPI request object (contains kubiya_token in state)
    batch_request: Request body with list of execution IDs and termination reason
    organization: Current organization from auth
    db: Database session

Returns:
    BatchTerminateResponse with results for each execution

Note:
    - Maximum 100 executions per request
    - Each execution is terminated independently
    - Failed terminations don't affect other executions in the batch



## OpenAPI

````yaml https://control-plane.kubiya.ai/api/openapi.json post /api/v1/executions/batch/terminate
openapi: 3.1.0
info:
  title: Agent Control Plane API
  description: Multi-tenant agent orchestration with Temporal workflows
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - name: health
    description: 🏥 **Health & Status** - Check API health and availability
  - name: authentication
    description: 🔐 **Authentication** - Token validation and auth management
  - name: agents
    description: 🤖 **Agents** - Create and manage AI agents with custom capabilities
  - name: skills
    description: 🛠️ **Tool Sets** - Manage agent skills and tool configurations
  - name: integrations
    description: 🔌 **Integrations** - Connect to external services (Kubiya managed)
  - name: custom-integrations
    description: >-
      ⚙️ **Custom Integrations** - User-defined integration instances with env
      vars, secrets, and files
  - name: integration-templates
    description: >-
      📦 **Integration Templates** - Pre-configured templates for common
      services (PostgreSQL, Redis, MongoDB, etc.)
  - name: secrets
    description: 🔑 **Secrets** - Secure credential storage and retrieval
  - name: teams
    description: 👥 **Teams** - Team management and collaboration
  - name: workflows
    description: 📊 **Workflows** - Multi-step automation and orchestration
  - name: executions
    description: ▶️ **Executions** - Track and monitor workflow runs
  - name: jobs
    description: ⏰ **Jobs** - Scheduled and webhook-triggered tasks
  - name: policies
    description: 🛡️ **Policies** - Access control and security policies
  - name: analytics
    description: 📈 **Analytics** - Usage metrics and performance monitoring
  - name: projects
    description: 📁 **Projects** - Project organization and management
  - name: environments
    description: 🌍 **Environments** - Environment configuration (dev, staging, prod)
  - name: models
    description: 🧠 **Models** - LLM model configuration and management
  - name: runtimes
    description: ⚡ **Runtimes** - Agent execution runtime environments
  - name: workers
    description: 👷 **Workers** - Worker registration and heartbeat monitoring
  - name: storage
    description: 💾 **Storage** - File storage and cloud integration
  - name: context-graph
    description: 🕸️ **Context Graph** - Knowledge graph and context management
  - name: temporal-workflows
    description: >-
      ⚙️ **Temporal Workflows** - Background workflows for context graph
      ingestion, connector operations, and scheduled jobs
  - name: templates
    description: 📝 **Templates** - Reusable configuration templates
paths:
  /api/v1/executions/batch/terminate:
    post:
      summary: Batch Terminate Executions
      description: >-
        Terminate multiple executions in a single request.


        This endpoint allows terminating multiple running executions at once.

        Each execution is processed independently, so some may succeed while
        others fail.


        Args:
            request: FastAPI request object (contains kubiya_token in state)
            batch_request: Request body with list of execution IDs and termination reason
            organization: Current organization from auth
            db: Database session

        Returns:
            BatchTerminateResponse with results for each execution

        Note:
            - Maximum 100 executions per request
            - Each execution is terminated independently
            - Failed terminations don't affect other executions in the batch
      operationId: batch_terminate_executions_api_v1_executions_batch_terminate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchTerminateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchTerminateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BatchTerminateRequest:
      properties:
        execution_ids:
          items:
            type: string
          type: array
          maxItems: 100
          minItems: 1
          title: Execution Ids
          description: List of execution IDs to terminate
        reason:
          type: string
          maxLength: 500
          minLength: 1
          title: Reason
          description: Termination reason
      type: object
      required:
        - execution_ids
        - reason
      title: BatchTerminateRequest
      description: Request to terminate multiple executions
    BatchTerminateResponse:
      properties:
        total_requested:
          type: integer
          title: Total Requested
          description: Total number of executions requested for termination
        total_succeeded:
          type: integer
          title: Total Succeeded
          description: Number of successfully terminated executions
        total_failed:
          type: integer
          title: Total Failed
          description: Number of failed terminations
        results:
          items:
            $ref: '#/components/schemas/BatchTerminateResult'
          type: array
          title: Results
          description: Results for each execution
      type: object
      required:
        - total_requested
        - total_succeeded
        - total_failed
        - results
      title: BatchTerminateResponse
      description: Response after batch terminating executions
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BatchTerminateResult:
      properties:
        execution_id:
          type: string
          title: Execution Id
          description: Execution ID
        success:
          type: boolean
          title: Success
          description: Whether termination was successful
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Id
          description: Workflow ID if successful
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if failed
        terminated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Terminated At
          description: Termination timestamp if successful
      type: object
      required:
        - execution_id
        - success
      title: BatchTerminateResult
      description: Result for a single execution in batch termination
    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: 'Enter your Kubiya API token (format: Bearer <token>)'

````