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

# Cancel Batch Execution



## OpenAPI

````yaml /api-v2.json post /batch-executions/id/{execution_id}/cancel
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /batch-executions/id/{execution_id}/cancel:
    post:
      tags:
        - Batch Executions
      summary: Cancel Batch Execution
      operationId: cancelExecution
      parameters:
        - name: execution_id
          in: path
          required: true
          schema:
            type: string
            title: Execution Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchExecutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: |-
            from meibel import MeibelClient

            client = MeibelClient(api_key="your-api-key")

            result = client.batches.executions.cancel("execution_id_value")
            print(result)
        - lang: TypeScript
          label: TypeScript
          source: >-
            import { MeibelClient } from 'meibel';


            const client = new MeibelClient({ apiKey: 'your-api-key' });


            const result = await
            client.batches.executions.cancel('execution_id_value');

            console.log(result);
        - lang: Go
          label: Go
          source: >-
            import v2 "github.com/meibel-ai/meibel-go/v2"


            client := v2.NewClient(v2.WithAPIKey("your-api-key"))

            ctx := context.Background()


            result, err := client.Batches.Executions.Cancel(ctx,
            "execution_id_value")

            if err != nil {
                log.Fatal(err)
            }

            fmt.Println(result)
components:
  schemas:
    BatchExecutionResponse:
      properties:
        id:
          type: string
          title: Id
          description: Execution ID — also the Temporal workflow ID for direct queries
        batch_definition_id:
          type: string
          title: Batch Definition Id
          description: FK to the BatchDefinition this execution ran against
        customer_id:
          type: string
          title: Customer Id
        project_id:
          type: string
          title: Project Id
        agent_urn:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Urn
        batch_spec_json:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Batch Spec Json
          description: Optional override for the tool's parameters schema
        agent_spec_json:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Agent Spec Json
        input_datasource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Input Datasource Id
        output_datasource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Output Datasource Id
        input_overrides:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Overrides
          description: Optional override for the tool's parameters schema
        total_items:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Items
        succeeded:
          anyOf:
            - type: integer
            - type: 'null'
          title: Succeeded
        failed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Failed
        start_time:
          type: string
          format: date-time
          title: Start Time
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Time
        status:
          type: string
          title: Status
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Overall error message
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/BatchItemResult'
              type: array
            - type: 'null'
          title: Items
          description: Per-item results (populated on completion by status callback)
      type: object
      required:
        - id
        - batch_definition_id
        - customer_id
        - project_id
        - start_time
        - status
      title: BatchExecutionResponse
      description: >-
        Response shape for a single batch execution. The legacy
        `batch_spec_json` / `agent_spec_json` / `agent_urn` /
        `input_datasource_id` fields are kept for client compatibility (DEL-1376
        §5.5) — they are reconstructed from the linked BatchDefinition by the
        router, not stored on the execution row.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BatchItemResult:
      properties:
        input_data_element_id:
          type: string
          title: Input Data Element Id
        filename:
          type: string
          title: Filename
        status:
          type: string
          title: Status
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        output_artifacts:
          anyOf:
            - items:
                anyOf:
                  - additionalProperties: true
                    type: object
                  - type: 'null'
              type: array
            - type: 'null'
          title: Output Artifacts
        attempts:
          anyOf:
            - type: integer
            - type: 'null'
          title: Attempts
          default: 1
      type: object
      required:
        - input_data_element_id
        - filename
        - status
      title: BatchItemResult
      description: Per-item result from the Temporal workflow.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````