# Delete task

Delete an export task.

```text
POST $CLOUDSIGMA_API_BASE/export/task/delete
```

## Before you call this API

Configure the [regional API endpoint and authentication](https://omnifabric.cloudsigma.com/docs/developer/endpoints-and-authentication.html.md), and select the target workspace.

First [Query task details](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/data-connections/export-tasks/get-export-task.html.md) to confirm the export task to be deleted.

Set the operation-specific values used in the request:

- `$TASK_ID`: ID of the export task to be deleted, fill in the `id` field of the request body.

Deletion of the currently created page is disabled while the task is running. Deleting a task does not roll back data that has been exported to the target system.

## Request example

```bash
curl -X POST "$CLOUDSIGMA_API_BASE/export/task/delete" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "'$TASK_ID'"
  }'
```

## Request body

| Field | Type | Is it required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The ID of the export task to be deleted. |

## Successful response

Returns `200` on success. `data` is `null`, indicating that the deletion request has been completed; the data that has been exported to the target system will not be rolled back.

```json
{
  "code": "OK",
  "msg": "OK",
  "data": null
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` means the interface call is successful. |
| `msg` | string | Success message with value `OK`. |
| `data` | null | Deleting the interface does not return the task object. |

## Error response

Business failure may be returned with HTTP `200` and `code` other than `OK`.

```json
{
  "code": "ErrServer",
  "msg": "Internal server error",
  "data": null
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 24 36 28

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - —
  - The request body cannot be parsed; this compatibility path returns the `error` field instead of the standard envelope.
  - Submit a JSON object containing a non-empty `id`.
* - `200`
  - `ErrServer`
  - The task does not exist, or the deletion process failed.
  - First query the task details to confirm the ID; when the task is running, please wait for the page to allow deletion.
* - `403`
  - `ErrForbidden`
  - The current identity does not have the permission to delete this task.
  - Request permission to delete the export task.
* - `503`
  - `ErrCoreAuthorizeUnavailable`
  - Authorization service is temporarily unavailable.
  - Try again later.
```

## Follow-up operations

[Query task list](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/data-connections/export-tasks/list-export-tasks.html.md) to confirm that the task no longer appears.
