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

# Cancel job

## Description

The **Cancel Job** endpoint stops an asynchronous job that is queued or still running. Use it to release capacity and avoid consuming credits on a run you no longer need.

<AccordionGroup>
  <Accordion title="How It Works">
    * **Input:** Provide the `job_id` of the job you want to stop.
    * **Processing:** The system marks the job as cancelled and stops further work on it.
    * **Output:** The job's status record, in the same shape returned by [Get job status](/v2/jobs/get_job_status).
  </Accordion>

  <Accordion title="Best Practices">
    * **Cancel superseded jobs** when you resubmit with corrected input, rather than leaving both running.
    * **Confirm the outcome** by calling [Get job status](/v2/jobs/get_job_status) after cancelling.
    * **Cancelling a completed job has no effect** — check the status first if you are unsure.
  </Accordion>
</AccordionGroup>

<Icon icon="thumbtack" iconType="solid" color="red" /> **See [async jobs](/v2/async-jobs) for the full job lifecycle.**


## OpenAPI

````yaml post /v2/jobs/cancel/{job_id}
openapi: 3.1.0
info:
  title: Partner Service
  version: 0.3.18
servers:
  - url: https://api.explorium.ai
    description: AgentSource Server
security: []
paths:
  /v2/jobs/cancel/{job_id}:
    post:
      tags:
        - AsyncJobs
      summary: Cancel Job
      operationId: v2_job_cancel
      parameters:
        - required: true
          schema:
            type: string
            title: Job Id
          name: job_id
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2JobStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - APIKeyHeader: []
components:
  schemas:
    V2JobStatusResponse:
      properties:
        job_id:
          type: string
          title: Job Id
        status:
          type: string
          title: Status
        input:
          $ref: '#/components/schemas/V2JobInput'
        timing:
          $ref: '#/components/schemas/V2JobTiming'
        additional_data:
          type: object
          title: Additional Data
        credit_usage:
          $ref: '#/components/schemas/V2JobCreditUsage'
        results:
          $ref: '#/components/schemas/V2JobResults'
        error:
          type: object
          title: Error
      type: object
      required:
        - job_id
        - status
        - input
        - timing
      title: V2JobStatusResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    V2JobInput:
      properties:
        list_id:
          type: string
          title: List Id
        row_count:
          type: integer
          title: Row Count
        entity_type:
          type: string
          title: Entity Type
      type: object
      title: V2JobInput
    V2JobTiming:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
        started_at:
          type: string
          format: date-time
          title: Started At
        finished_at:
          type: string
          format: date-time
          title: Finished At
      type: object
      title: V2JobTiming
    V2JobCreditUsage:
      properties:
        total_credits:
          type: integer
          title: Total Credits
        total_results:
          type: integer
          title: Total Results
      type: object
      required:
        - total_credits
        - total_results
      title: V2JobCreditUsage
    V2JobResults:
      properties:
        format:
          type: string
          enum:
            - csv
          title: Format
        download_url:
          type: string
          title: Download Url
        expires_at:
          type: string
          format: date-time
          title: Expires At
        file_expires_at:
          type: string
          format: date-time
          title: File Expires At
      type: object
      required:
        - format
        - download_url
        - expires_at
      title: V2JobResults
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: api_key

````