# Pause task

Pause an import task. A successful response does not return the task status, please check the details again to confirm the status.

```text
POST $CLOUDSIGMA_API_BASE/task/pause
```

## 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.

Set the operation-specific values used in the request:

- `$TASK_ID`: ID of the task to be suspended.

## Request example

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

## Request body

| Field | Type | Is it required | Description |
| --- | --- | --- | --- |
| `task_id` | string | Yes | The ID of the import task to pause. |

## Successful response

Returns `200` on success and `data` is `null`. This interface does not return the task status after suspension.

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

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` on success. |
| `msg` | string | `OK` on success. |
| `data` | null | This interface does not return the task status after suspension. |

## Error response

```json
{
  "code": "ErrForbidden",
  "msg": "permission denied",
  "data": null
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 25 30 33

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - `ErrParamInvalid`
  - The request body is invalid.
  - Fix JSON and `task_id` and try again.
* - `403`
  - `ErrForbidden`
  - The caller does not have permission to operate the task.
  - Check workspace and object authorization.
* - `503`
  - `ErrCoreAuthorizeUnavailable`
  - The service is temporarily unable to complete the authorization check.
  - Try again later.
* - `200`
  - `ErrServer`
  - The service failed to suspend the task.
  - Check both HTTP status and `code`.
```

## Follow-up operations

Use the same task ID [Query task details](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/data-connections/import-tasks/get-import-task.html.md) to confirm that it has been suspended. When you need to continue [resume task](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/data-connections/import-tasks/resume-import-task.html.md).
