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

# Batch Delete Jobs

> Hard-delete jobs in bulk. Eligible: terminal status OR archived.

In-flight jobs must be cancelled first (per-key error `in_flight`).
Always returns 200 — inspect `details`.

**Authentication Required**: Requires `job:cancel` permission.



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/jobs/batch-delete
openapi: 3.1.0
info:
  description: >-
    Public API for the MerchantOps product catalog, pricing, and publishing
    surface.
  title: MerchantOps API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.merchantops.ai
security: []
paths:
  /api/jobs/batch-delete:
    post:
      tags:
        - Jobs
      summary: Batch Delete Jobs
      description: |-
        Hard-delete jobs in bulk. Eligible: terminal status OR archived.

        In-flight jobs must be cancelled first (per-key error `in_flight`).
        Always returns 200 — inspect `details`.

        **Authentication Required**: Requires `job:cancel` permission.
      operationId: batch_delete_jobs
      parameters:
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: X-Organization-ID
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
        - in: cookie
          name: stytch_session
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Stytch Session
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkJobIdsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDeleteJobsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    BulkJobIdsRequest:
      description: Request body for the jobs batch-archive / batch-delete endpoints.
      properties:
        job_ids:
          items:
            type: string
          maxItems: 500
          minItems: 1
          title: Job Ids
          type: array
      required:
        - job_ids
      title: BulkJobIdsRequest
      type: object
    BatchDeleteJobsResponse:
      properties:
        deleted:
          title: Deleted
          type: integer
        details:
          items:
            $ref: '#/components/schemas/JobBulkActionDetail'
          title: Details
          type: array
      required:
        - deleted
        - details
      title: BatchDeleteJobsResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    JobBulkActionDetail:
      properties:
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Error code when status='error' (not_found, already_archived,
            not_terminal, in_flight)
          title: Error
        job_id:
          title: Job Id
          type: string
        status:
          description: '"archived" | "deleted" | "error"'
          title: Status
          type: string
      required:
        - job_id
        - status
      title: JobBulkActionDetail
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````