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

# Cancel Job

> Stop a queued or running import

Stop an import that is queued or still running. The contacts and prospects it has not
started are skipped. Everything it already imported (profiles, prospects, opportunities)
stays, and the job's status becomes `CANCELLED`.

Cancelling a job that is already cancelled is safe: it returns `200` with
`already_cancelled: true` and changes nothing. A job that already finished returns `409`.
Account research runs cannot be cancelled (`422`).

> [!NOTE]
>
> Also available to AI assistants as the `cancel_job` tool on the
> [MCP server](https://docs.clustr-ai.com/mcp-server.md).

```bash cURL theme={null}
curl -X POST "https://api.clustr-ai.com/api/public/jobs/job_jctzmfh41nr4v8hvs87eakgs48/cancel" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python theme={null}
import requests

requests.post(
    "https://api.clustr-ai.com/api/public/jobs/job_jctzmfh41nr4v8hvs87eakgs48/cancel",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
```

```javascript JavaScript theme={null}
await fetch("https://api.clustr-ai.com/api/public/jobs/job_jctzmfh41nr4v8hvs87eakgs48/cancel", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY" },
});
```

```json 200 theme={null}
{
  "success": true,
  "data": {
    "clustr_job_id": "job_jctzmfh41nr4v8hvs87eakgs48",
    "job_id": "job_abc123",
    "status": "CANCELLED",
    "already_cancelled": false,
    "message": "Import cancelled. What it already imported stays."
  }
}
```

```json 409 theme={null}
{
  "success": false,
  "error": {
    "message": "run already finished (COMPLETED)",
    "code": "CONFLICT"
  }
}
```


## OpenAPI

````yaml POST /jobs/{id}/cancel
openapi: 3.1.0
info:
  title: Clustr Public API
  description: >
    Programmatic access to your Clustr network: import connectors, search warm
    intros (opportunities), and manage target accounts.


    ## Authentication

    All endpoints require a Bearer token (API key) in the `Authorization`
    header.


    ```

    Authorization: Bearer <your_api_key>

    ```


    API keys can be created and managed from the [API settings
    page](https://app.clustr-ai.com/api).
  version: '1.0'
  contact:
    name: Clustr Support
    url: https://clustr-ai.com
servers:
  - url: https://api.clustr-ai.com/api/public
    description: Production
security:
  - BearerAuth: []
paths:
  /jobs/{id}/cancel:
    post:
      tags:
        - Jobs
      summary: Cancel Job
      description: >
        Cancel a queued or running import. Contacts and prospects it has not
        started are

        skipped; everything it already imported stays. Cancelling twice is safe.
      operationId: cancelJob
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: >-
            The job's Clustr ID (`job_…`), from [List
            Jobs](/api-reference/list-jobs) or the import that

            started it. The id from earlier responses also works.
          example: job_svrka9jsp23zx5aat6xty0255j
      responses:
        '200':
          description: The job is cancelled
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      clustr_job_id:
                        type: string
                        description: >-
                          The job's Clustr ID, for example
                          `job_hgj38r3t4pxy63cg2c3b5xagn5`. Follow the job with
                          [Get Job

                          Status](/api-reference/get-job-status).
                        example: job_hgj38r3t4pxy63cg2c3b5xagn5
                      job_id:
                        type: string
                        description: >-
                          Kept for integrations built before Clustr IDs. New
                          integrations should use `clustr_job_id`.
                      status:
                        type: string
                        enum:
                          - CANCELLED
                      already_cancelled:
                        type: boolean
                        description: >-
                          True when the job was already cancelled; nothing
                          changed
                      message:
                        type: string
        '401':
          description: Invalid or missing API key
        '404':
          description: Job not found
        '409':
          description: The job already finished
        '422':
          description: >-
            The job is an account research run, and account research cannot be
            cancelled
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: The API key you created on the API settings page of the Clustr app.

````

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