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

# Cancel Job

> Cancel and delete a pending job.

Only jobs in 'pending' status can be cancelled. Running, completed,
failed, retrying, and dead jobs cannot be cancelled.

Args:
    job_id: ID of the job to cancel.

Raises:
    404: Job not found.
    400: Job is not in pending status.



## OpenAPI

````yaml delete /api/v1/admin/jobs/{job_id}
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/admin/jobs/{job_id}:
    delete:
      tags:
        - admin
        - jobs
        - Jobs
      summary: Cancel Job
      description: |-
        Cancel and delete a pending job.

        Only jobs in 'pending' status can be cancelled. Running, completed,
        failed, retrying, and dead jobs cannot be cancelled.

        Args:
            job_id: ID of the job to cancel.

        Raises:
            404: Job not found.
            400: Job is not in pending status.
      operationId: cancel_job_api_v1_admin_jobs__job_id__delete
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````