# Delete a task and its files.

Delete a finished task identified by task_id, including all associated input files and generated outputs. Provide the `task_id` returned by the task's run endpoint.

Endpoint: POST /s2s/v2.0/task/delete
Security: BearerAuthenticationV2

## Security:

  - `BearerAuthenticationV2` (unknown)
    http bearer

## Request fields (application/json):

  - `task_id` (string, required)
    The task id returned by the task's run endpoint.
    Example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe

## Response 200:

  - `200` (unknown)
    The task and its files were deleted

## Response 200 fields (application/json):

  - `status` (integer)
    Response status
    Example: 200

## Response 400:

  - `400` (unknown)
    Failed to delete the task

## Response 400 fields (application/json):

  - `status` (integer)
    Response status
    Example: 400

  - `error` (string)
    Error message
    Example: Operation not supported

  - `error_code` (string)
    Error code:
* OperationNotSupport - The provided task_id is not accepted; use the task_id returned by the run endpoint
* OperationInvalid - The task has not finished yet and cannot be deleted
* InvalidTaskId - The task_id is malformed or no matching task was found
* InvalidParameters - task_id is missing
    Enum: "OperationNotSupport", "OperationInvalid", "InvalidTaskId", "InvalidParameters"

## Response 401:

  - `401` (unknown)
    Invalid or missing API key

## Response 401 fields (application/json):

  - `status` (integer)
    Response status
    Example: 401

  - `error` (string)
    Example: Invalid API key

