---
title: "Cancels a scheduled task"
method: PUT
path: "/api/v2/tasks/{task_id}/cancel"
tags: ["Tasks", "Enterprise"]
deprecated: true
---

# Cancels a scheduled task

`PUT /api/v2/tasks/{task_id}/cancel`

> **Deprecated.**

**Deprecated**: This endpoint will no longer be supported in future releases. Please use `PUT /api/v2/jobs/{job_id}/cancel` instead.

## Response `200`

OK

- object
  - `data` ModelClientScheduledJobDisplay
    - `id` integer — This is the unique identifier for this object.
    - `client_id` string, uuid
    - `client_name` string
    - `event_id` NullInt32
      - `int32` integer
      - `valid` boolean — Valid is true if `int32` is not `null`.
    - `execution_time` string, date-time
    - `start_time` string, date-time
    - `end_time` string, date-time
    - `status` -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 — This enum describes the current status of a Job. Values are: - `-1` Invalid - `0` Ready - `1` Running - `2` Complete - `3` Canceled - `4` Timed Out - `5` Failed - `6` Ingesting - `7` Analyzing - `8` Partially Complete
    - `status_message` string
    - `session_collection` boolean
    - `local_group_collection` boolean
    - `ad_structure_collection` boolean
    - `cert_services_collection` boolean
    - `ca_registry_collection` boolean
    - `dc_registry_collection` boolean
    - `all_trusted_domains` boolean
    - `domain_controller` string
    - `ous` ModelOuDetails[]
      - `objectid` string
      - `name` string, nullable
      - `exists` boolean, nullable
      - `distinguishedname` string, nullable
      - `type` string, nullable
    - `domains` ModelDomainDetails[]
      - `objectid` string
      - `name` string, nullable
      - `exists` boolean, nullable
      - `type` string
    - `domain_results` ModelDomainCollectionResult[]
      - `id` integer — This is the unique identifier for this object.
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `deleted_at` NullTime
        - `time` string, date-time — An RFC-3339 formatted string
        - `valid` boolean — Valid is true if `time` is not `null`.
      - `job_id` integer
      - `domain_name` string — Name of the domain that was enumerated
      - `success` boolean — A boolean value indicating whether the domain enumeration succeeded
      - `message` string — A status message for a domain enumeration result
      - `user_count` integer — A count of users enumerated
      - `group_count` integer — A count of groups enumerated
      - `computer_count` integer — A count of computers enumerated
      - `gpo_count` integer — A count of gpos enumerated
      - `ou_count` integer — A count of ous enumerated
      - `container_count` integer — A count of containers enumerated
      - `aiaca_count` integer — A count of aiacas enumerated
      - `rootca_count` integer — A count of rootcas enumerated
      - `enterpriseca_count` integer — A count of enterprisecas enumerated
      - `ntauthstore_count` integer — A count of ntauthstores enumerated
      - `certtemplate_count` integer — A count of certtemplates enumerated
      - `deleted_count` integer — A count of deleted objects enumerated

## Other responses

- `400` — **Bad Request** This could be due to one of the following reasons: - JSON payload is missing or malformed - Path or query parameters are missing or invalid/malformed - The data sent is not valid (ex- sending a `string` in an `integer` field)
- `401` — **Unauthorized** This endpoint failed an authentication requirement. Either the client tried to access a protected endpoint without being authenticated, or an auth validation failed (ex- invalid credentials or expired token).
- `403` — **Forbidden** This is most commonly caused by an authenticated client trying to access a resource that it does not have permission for.
- `404` — **Not Found** This error typically comes from operations where a valid ID was passed to the request to look up an entity but the entity could not be found.
- `429` — **Too Many Requests** The client has sent too many requests within a certain time window and tripped the rate limiting middleware.
- `500` — **Internal Server Error** This is usually the result of either an unexpected database or application error. The client may try modifying or resending the request, but the error is likely not related to the client doing something wrong.

---

[API](https://skmtc.net/specterops/apis/bloodhound-api.md) · [All operations](https://skmtc.net/specterops/apis/bloodhound-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/specterops/bloodhound-api/versions/9e5dcb1a1b37/schema)
