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

# Cancel a context add job

> Attempts to cancel a context add job by job id.
- If the job is already completed or failed, returns 404.
- If the job is currently running ("active"), returns 409 and cannot be cancelled.
- Only jobs in "waiting" or "delayed" state can be cancelled.




## OpenAPI

````yaml DELETE /api/v1/context/add-async/{id}/cancel
openapi: 3.1.0
info:
  title: Alchemyst AI API v1 documentation
  version: 1.0.0
  description: v1 API documentation for Alchemyst AI
servers:
  - url: https://platform-backend.getalchemystai.com
    description: production
security:
  - bearerAuth: []
tags: []
paths:
  /api/v1/context/add-async/{id}/cancel:
    delete:
      tags:
        - context
      summary: Cancel a context add job
      description: >
        Attempts to cancel a context add job by job id.

        - If the job is already completed or failed, returns 404.

        - If the job is currently running ("active"), returns 409 and cannot be
        cancelled.

        - Only jobs in "waiting" or "delayed" state can be cancelled.
      operationId: cancelParticularJobInAddContextAsync
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: Job ID to cancel
      responses:
        '200':
          description: Job cancelled successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - jobId
                  - status
                  - message
                properties:
                  success:
                    type: boolean
                    example: true
                  jobId:
                    type: string
                    example: job_01HXYZABC
                  status:
                    type: string
                    example: cancelled
                  message:
                    type: string
                    example: Job cancelled successfully
        '400':
          description: Invalid job id
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - status
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid job id
                  status:
                    type: number
                    example: 400
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - status
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
                  status:
                    type: number
                    example: 401
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - status
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Payment Required
                  status:
                    type: number
                    example: 402
        '403':
          description: 'Forbidden: insufficient scope'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - status
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Forbidden: insufficient scope'
                  status:
                    type: number
                    example: 403
        '404':
          description: Job not found or already completed/failed
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - status
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Job not found
                  status:
                    type: number
                    example: 404
        '409':
          description: Job is currently running and cannot be cancelled
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    example: >-
                      Context add is running, it cannot be cancelled. You can
                      delete it after it has finished uploading, to preserve the
                      integrity of data.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal server error
                  error:
                    type: string
                    example: Error details
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````