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

# Cancel Batch

> Cancel every part that has not ended.



## OpenAPI

````yaml /api-reference/agent/openapi.json post /batches/{batch_id}/cancel
openapi: 3.1.0
info:
  title: NewsCatcher Agent API
  description: >-
    Agent runs (events from a query, or news about companies), company lists and
    monitors. Authenticate with your API key in the x-api-key header.
  version: 1.0.0
servers:
  - url: https://api.newscatcherapi.com/agent
    description: Production server
security: []
paths:
  /batches/{batch_id}/cancel:
    post:
      tags:
        - runs
      summary: Cancel Batch
      description: Cancel every part that has not ended.
      operationId: cancel_batch_batches__batch_id__cancel_post
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Batch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDetail'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Too Many Requests
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BatchDetail:
      properties:
        batch_id:
          type: string
          format: uuid
          title: Batch Id
        kind:
          type: string
          title: Kind
          default: companies
        title:
          type: string
          title: Title
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
        status:
          type: string
          title: Status
        progress:
          $ref: '#/components/schemas/BatchProgress'
        runs:
          items:
            $ref: '#/components/schemas/RunSummary'
          type: array
          title: Runs
        columns:
          items:
            type: string
          type: array
          title: Columns
        rows:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Rows
          default: []
        companies:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Companies
          default: []
        window_from:
          anyOf:
            - type: string
            - type: 'null'
          title: Window From
        window_to:
          anyOf:
            - type: string
            - type: 'null'
          title: Window To
        list_id:
          anyOf:
            - type: string
            - type: 'null'
          title: List Id
        keep_updated:
          anyOf:
            - $ref: '#/components/schemas/KeepUpdatedOut'
            - type: 'null'
        monitor_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Monitor Id
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
      type: object
      required:
        - batch_id
        - title
        - status
        - progress
        - runs
        - columns
      title: BatchDetail
      description: >-
        A batch (a company list too big for one run, split into runs of up to 50
        companies) as one run: its status,

        progress, every finished part's stories and companies, and its parts.
    ErrorResponse:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
        - code
        - message
      title: ErrorResponse
      description: 'Every error: a stable code and a message to show the user.'
    BatchProgress:
      properties:
        runs_done:
          type: integer
          title: Runs Done
        runs_total:
          type: integer
          title: Runs Total
        companies_done:
          type: integer
          title: Companies Done
        companies_total:
          type: integer
          title: Companies Total
      type: object
      required:
        - runs_done
        - runs_total
        - companies_done
        - companies_total
      title: BatchProgress
      description: How far a batch got.
    RunSummary:
      properties:
        run_id:
          type: string
          format: uuid
          title: Run Id
        kind:
          type: string
          title: Kind
          default: events
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
        title:
          type: string
          title: Title
          default: ''
        mode:
          type: string
          title: Mode
        status:
          type: string
          title: Status
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
        monitor_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Monitor Id
        batch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Batch Id
      type: object
      required:
        - run_id
        - mode
        - status
      title: RunSummary
      description: A run in a list.
    KeepUpdatedOut:
      properties:
        status:
          type: string
          enum:
            - pending
            - created
            - failed
            - not_created
          title: Status
        monitor_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Monitor Id
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        schedule:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schedule
      type: object
      required:
        - status
      title: KeepUpdatedOut
      description: 'A run started with keep_updated: its monitor, once made.'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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